strapi-plugin-preview-button
Version:
A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.
21,258 lines • 812 kB
JavaScript
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
import * as React from "react";
import { forwardRef, memo, useCallback, useMemo, useDebugValue, useState, useEffect, useRef, useLayoutEffect, createContext as createContext$1, createElement, useContext, useReducer, lazy } from "react";
import { useIntl } from "react-intl";
import { CopyToClipboard } from "react-copy-to-clipboard";
import styled, { useTheme, createGlobalStyle, styled as styled$1 } from "styled-components";
import { Button, Main, Flex, Loader, EmptyStateLayout, Box, Link, Alert, Typography, useCallbackRef, useComposedRefs, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Popover, Dialog, SearchForm, Searchbar, IconButton, Pagination as Pagination$1, PreviousLink, PageLink, Dots, NextLink, Table as Table$1, Thead, Tr, Th, Tooltip, Tbody, Td, Tag, Menu, Status, VisuallyHidden, Modal, LinkButton, IconButtonGroup } from "@strapi/design-system";
import { useNotification as useNotification$1, useAPIErrorHandler as useAPIErrorHandler$1, useFetchClient, useStrapiApp as useStrapiApp$1 } from "@strapi/strapi/admin";
import * as qs from "qs";
import qs__default, { parse, stringify } from "qs";
import { useLocation, useNavigate, NavLink, useBlocker, Link as Link$1, useParams, useMatch, useSearchParams } from "react-router-dom";
import "react-dom/client";
import "lodash/isFunction";
import "lodash/merge";
import "lodash/pick";
import createNextState2, { enableES5, isDraftable, isDraft, enablePatches, applyPatches, produceWithPatches, original, produce } from "immer";
import { shallowEqual, batch, useDispatch, useSelector, useStore } from "react-redux";
import pipe from "lodash/fp/pipe";
import clone$1 from "lodash/clone";
import toPath from "lodash/toPath";
import isEqual from "lodash/isEqual";
import get from "lodash/get";
import "lodash/set";
import ReactDOM, { unstable_batchedUpdates as unstable_batchedUpdates$1 } from "react-dom";
import "lodash/defaultsDeep";
import camelCase from "lodash/camelCase";
import has from "lodash/has";
import mapValues from "lodash/mapValues";
import snakeCase from "lodash/snakeCase";
import mapKeys from "lodash/mapKeys";
import "lodash/omit";
import throttle$1 from "lodash/throttle";
import "lodash/fp/mapValues";
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
const v2 = glob[path];
if (v2) {
return typeof v2 === "function" ? v2() : Promise.resolve(v2);
}
return new Promise((_, reject) => {
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
reject.bind(
null,
new Error(
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
)
)
);
});
};
const SvgAlien = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 2A12.014 12.014 0 0 0 4 14c0 3 1.57 6.883 4.201 10.375C10.85 27.894 13.764 30 16 30s5.151-2.101 7.799-5.625C26.43 20.875 28 17 28 14A12.014 12.014 0 0 0 16 2M8 14.5A1.5 1.5 0 0 1 9.5 13a4.5 4.5 0 0 1 4.5 4.5 1.5 1.5 0 0 1-1.5 1.5A4.5 4.5 0 0 1 8 14.5M18 25h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 0 2m1.5-6a1.5 1.5 0 0 1-1.5-1.5 4.5 4.5 0 0 1 4.5-4.5 1.5 1.5 0 0 1 1.5 1.5 4.5 4.5 0 0 1-4.5 4.5" }) });
};
const ForwardRef$5c = forwardRef(SvgAlien);
const ForwardRef$5d = ForwardRef$5c;
const SvgArchive = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28 6H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2v11a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V13a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2m-9 12h-6a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2m9-7H4V8h24z" }) });
};
const ForwardRef$5a = forwardRef(SvgArchive);
const ForwardRef$5b = ForwardRef$5a;
const SvgArrowClockwise = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30.5 7v6a1.5 1.5 0 0 1-1.5 1.5h-6a1.5 1.5 0 0 1 0-3h2.137l-2.375-2.173-.047-.046a9.5 9.5 0 1 0-6.84 16.219H16a9.44 9.44 0 0 0 6.519-2.59 1.5 1.5 0 1 1 2.061 2.181A12.43 12.43 0 0 1 16 28.5h-.171a12.5 12.5 0 1 1 8.985-21.368L27.5 9.59V7a1.5 1.5 0 0 1 3 0" }) });
};
const ForwardRef$58 = forwardRef(SvgArrowClockwise);
const ForwardRef$59 = ForwardRef$58;
const SvgArrowDown = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m26.061 19.061-9 9a1.503 1.503 0 0 1-2.125 0l-9-9a1.503 1.503 0 1 1 2.125-2.125l6.439 6.439V5a1.5 1.5 0 1 1 3 0v18.375l6.439-6.44a1.502 1.502 0 1 1 2.125 2.125z" }) });
};
const ForwardRef$56 = forwardRef(SvgArrowDown);
const ForwardRef$57 = ForwardRef$56;
const SvgArrowLeft = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 16a1.5 1.5 0 0 1-1.5 1.5H8.625l6.44 6.439a1.502 1.502 0 1 1-2.125 2.125l-9-9a1.5 1.5 0 0 1 0-2.125l9-9a1.503 1.503 0 0 1 2.125 2.125L8.625 14.5H27a1.5 1.5 0 0 1 1.5 1.5" }) });
};
const ForwardRef$54 = forwardRef(SvgArrowLeft);
const ForwardRef$55 = ForwardRef$54;
const SvgArrowRight = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m28.061 17.061-9 9a1.503 1.503 0 1 1-2.125-2.125l6.439-6.436H5a1.5 1.5 0 1 1 0-3h18.375l-6.436-6.44a1.503 1.503 0 0 1 2.125-2.125l9 9a1.5 1.5 0 0 1-.003 2.126" }) });
};
const ForwardRef$52 = forwardRef(SvgArrowRight);
const ForwardRef$53 = ForwardRef$52;
const SvgArrowUp = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26.061 15.061a1.5 1.5 0 0 1-2.125 0L17.5 8.625V27a1.5 1.5 0 1 1-3 0V8.625l-6.439 6.436a1.503 1.503 0 1 1-2.125-2.125l9-9a1.5 1.5 0 0 1 2.125 0l9 9a1.5 1.5 0 0 1 0 2.125" }) });
};
const ForwardRef$50 = forwardRef(SvgArrowUp);
const ForwardRef$51 = ForwardRef$50;
const SvgArrowsCounterClockwise = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M11 13.5H5A1.5 1.5 0 0 1 3.5 12V6a1.5 1.5 0 0 1 3 0v1.733C8.581 5.683 11.786 3.5 16 3.5c5.558 0 8.92 3.299 9.061 3.439a1.5 1.5 0 0 1-2.117 2.125C22.889 9.01 20.25 6.5 16 6.5c-3.625 0-6.367 2.21-8 4h3a1.5 1.5 0 1 1 0 3m16 5h-6a1.5 1.5 0 1 0 0 3h3c-1.625 1.79-4.375 4-8 4-4.25 0-6.889-2.511-6.944-2.565A1.5 1.5 0 0 0 6.94 25.06c.141.141 3.504 3.44 9.061 3.44 4.214 0 7.419-2.183 9.5-4.233V26a1.5 1.5 0 1 0 3 0v-6a1.5 1.5 0 0 0-1.5-1.5" }) });
};
const ForwardRef$4_ = forwardRef(SvgArrowsCounterClockwise);
const ForwardRef$4$ = ForwardRef$4_;
const SvgBell = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27.725 21.993C27.031 20.798 26 17.416 26 13a10 10 0 0 0-20 0c0 4.418-1.032 7.797-1.726 8.993A2 2 0 0 0 6 25h5.101a5 5 0 0 0 9.798 0H26a2 2 0 0 0 1.725-3.008M16 27a3 3 0 0 1-2.828-2h5.656A3 3 0 0 1 16 27" }) });
};
const ForwardRef$4Y = forwardRef(SvgBell);
const ForwardRef$4Z = ForwardRef$4Y;
const SvgBold = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M22.135 14.308A6.001 6.001 0 0 0 17.5 4.5H9A1.5 1.5 0 0 0 7.5 6v19A1.5 1.5 0 0 0 9 26.5h10a6.5 6.5 0 0 0 3.135-12.192M10.5 7.5h7a3 3 0 0 1 0 6h-7zm8.5 16h-8.5v-7H19a3.5 3.5 0 1 1 0 7" }) });
};
const ForwardRef$4W = forwardRef(SvgBold);
const ForwardRef$4X = ForwardRef$4W;
const SvgBook = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 4v20a1 1 0 0 1-1 1H9a2 2 0 0 0-2 2h17a1 1 0 0 1 0 2H6a1 1 0 0 1-1-1V7a4 4 0 0 1 4-4h17a1 1 0 0 1 1 1" }) });
};
const ForwardRef$4U = forwardRef(SvgBook);
const ForwardRef$4V = ForwardRef$4U;
const SvgBriefcase = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M19 14a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 1 1m10-5v16a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V6a3 3 0 0 1 3-3h6a3 3 0 0 1 3 3v1h5a2 2 0 0 1 2 2M12 7h8V6a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1zm15 7.201V9H5v5.201A23 23 0 0 0 16 17a23 23 0 0 0 11-2.799" }) });
};
const ForwardRef$4S = forwardRef(SvgBriefcase);
const ForwardRef$4T = ForwardRef$4S;
const SvgBulletList = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M9.5 8A1.5 1.5 0 0 1 11 6.5h16a1.5 1.5 0 0 1 0 3H11A1.5 1.5 0 0 1 9.5 8M27 14.5H11a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3m0 8H11a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3M5.5 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0-8a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 16a2 2 0 1 0 0 4 2 2 0 0 0 0-4" }) });
};
const ForwardRef$4Q = forwardRef(SvgBulletList);
const ForwardRef$4R = ForwardRef$4Q;
const SvgCalendar = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26 4h-3V3a1 1 0 0 0-2 0v1H11V3a1 1 0 0 0-2 0v1H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 6H6V6h3v1a1 1 0 0 0 2 0V6h10v1a1 1 0 0 0 2 0V6h3z" }) });
};
const ForwardRef$4O = forwardRef(SvgCalendar);
const ForwardRef$4P = ForwardRef$4O;
const SvgCar = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30 14h-1.35l-3.472-7.812A2 2 0 0 0 23.35 5H8.65a2 2 0 0 0-1.828 1.188L3.35 14H2a1 1 0 0 0 0 2h1v10a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2v-2h12v2a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V16h1a1 1 0 0 0 0-2m-20 6H8a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2m12 0a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2z" }) });
};
const ForwardRef$4M = forwardRef(SvgCar);
const ForwardRef$4N = ForwardRef$4M;
const SvgCaretDown = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m26.708 12.708-10 10a1 1 0 0 1-1.415 0l-10-10A1 1 0 0 1 6 11h20a1 1 0 0 1 .707 1.707" }) });
};
const ForwardRef$4K = forwardRef(SvgCaretDown);
const ForwardRef$4L = ForwardRef$4K;
const SvgCaretUp = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26.924 20.383A1 1 0 0 1 26 21H6a1 1 0 0 1-.708-1.707l10-10a1 1 0 0 1 1.415 0l10 10a1 1 0 0 1 .217 1.09" }) });
};
forwardRef(SvgCaretUp);
const SvgCast = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M7 26a1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 0 1 0-2 3 3 0 0 1 3 3m-3-7a1 1 0 0 0 0 2 5 5 0 0 1 5 5 1 1 0 1 0 2 0 7.01 7.01 0 0 0-7-7m0-4a1 1 0 0 0 0 2 9.01 9.01 0 0 1 9 9 1 1 0 0 0 2 0A11.01 11.01 0 0 0 4 15M27 5H5a2 2 0 0 0-2 2v5a1 1 0 0 0 1 1 13.014 13.014 0 0 1 13 13 1 1 0 0 0 1 1h9a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2" }) });
};
const ForwardRef$4G = forwardRef(SvgCast);
const ForwardRef$4H = ForwardRef$4G;
const SvgCastleTurret = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M25 3h-1a2 2 0 0 0-2 2v2h-3.5V5a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v2H10V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v5.586A1.98 1.98 0 0 0 5.586 12L7 13.414V27a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V13.414L26.414 12A1.98 1.98 0 0 0 27 10.586V5a2 2 0 0 0-2-2m-6 24h-6v-8a3 3 0 0 1 6 0z" }) });
};
const ForwardRef$4E = forwardRef(SvgCastleTurret);
const ForwardRef$4F = ForwardRef$4E;
const SvgChartBubble = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-5-2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-3-5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-3 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M25 24H7a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v13h17a1 1 0 0 1 0 2" }) });
};
const ForwardRef$4C = forwardRef(SvgChartBubble);
const ForwardRef$4D = ForwardRef$4C;
const SvgChartCircle = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M3.094 14.443a12.8 12.8 0 0 1 2.914-6.72 2 2 0 0 1 2.953-.138l3.459 3.533a1.98 1.98 0 0 1 .211 2.56 3.2 3.2 0 0 0-.462.968.5.5 0 0 1-.478.354h-8.1a.5.5 0 0 1-.497-.557m14.08-11.435A2 2 0 0 0 15 5v5.084a1.98 1.98 0 0 0 1.656 1.97 4 4 0 0 1 .677 7.72.51.51 0 0 0-.333.476v8.154a.5.5 0 0 0 .558.5A13.04 13.04 0 0 0 29 16.185C29.094 9.4 23.899 3.61 17.174 3.008M14.656 19.77a4 4 0 0 1-2.425-2.427.51.51 0 0 0-.475-.343H3.59a.5.5 0 0 0-.5.556A13.01 13.01 0 0 0 14.443 28.91a.5.5 0 0 0 .556-.5V20.25a.51.51 0 0 0-.343-.48" }) });
};
const ForwardRef$4A = forwardRef(SvgChartCircle);
const ForwardRef$4B = ForwardRef$4A;
const SvgChartPie = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m0 2a11 11 0 0 1 8.984 4.659L16 14.845zm0 22a11 11 0 0 1-8.984-4.659l18.97-10.951A11 11 0 0 1 16 27" }) });
};
const ForwardRef$4y = forwardRef(SvgChartPie);
const ForwardRef$4z = ForwardRef$4y;
const SvgCheck = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m29.061 10.061-16 16a1.5 1.5 0 0 1-2.125 0l-7-7a1.504 1.504 0 0 1 2.125-2.125L12 22.875 26.939 7.939a1.502 1.502 0 1 1 2.125 2.125z" }) });
};
const ForwardRef$4w = forwardRef(SvgCheck);
const ForwardRef$4x = ForwardRef$4w;
const SvgCheckCircle = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m5.708 10.708-7 7a1 1 0 0 1-1.415 0l-3-3a1 1 0 0 1 1.415-1.415L14 18.586l6.293-6.293a1 1 0 0 1 1.415 1.415" }) });
};
const ForwardRef$4u = forwardRef(SvgCheckCircle);
const ForwardRef$4v = ForwardRef$4u;
const SvgChevronDown = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m27.061 13.061-10 10a1.503 1.503 0 0 1-2.125 0l-10-10a1.503 1.503 0 1 1 2.125-2.125L16 19.875l8.939-8.94a1.502 1.502 0 1 1 2.125 2.125z" }) });
};
forwardRef(SvgChevronDown);
const SvgChevronLeft = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M21.061 24.939a1.503 1.503 0 0 1-2.125 2.125l-10-10a1.5 1.5 0 0 1 0-2.125l10-10a1.503 1.503 0 0 1 2.125 2.125L12.125 16z" }) });
};
forwardRef(SvgChevronLeft);
const SvgChevronRight = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m23.061 17.061-10 10a1.503 1.503 0 0 1-2.125-2.125L19.875 16l-8.936-8.939a1.502 1.502 0 1 1 2.125-2.125l10 10a1.5 1.5 0 0 1-.003 2.125" }) });
};
forwardRef(SvgChevronRight);
const SvgChevronUp = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27.061 21.061a1.503 1.503 0 0 1-2.125 0L16 12.125l-8.939 8.936a1.503 1.503 0 0 1-2.125-2.125l10-10a1.5 1.5 0 0 1 2.125 0l10 10a1.5 1.5 0 0 1 0 2.125" }) });
};
forwardRef(SvgChevronUp);
const SvgClock = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m7 14h-7a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v6h6a1 1 0 0 1 0 2" }) });
};
const ForwardRef$4k = forwardRef(SvgClock);
const ForwardRef$4l = ForwardRef$4k;
const SvgClockCounterClockwise = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28 16a12 12 0 0 1-20.236 8.728 1.002 1.002 0 0 1 1.375-1.456 10 10 0 1 0-.21-14.343c-.441.446-.857.885-1.26 1.321l2.039 2.043A1 1 0 0 1 9 14H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1.707-.707L6.25 8.838c.402-.437.817-.875 1.258-1.32A12 12 0 0 1 28 16M16 9a1 1 0 0 0-1 1v6a1 1 0 0 0 .485.858l5 3a.999.999 0 0 0 1.486-1.1 1 1 0 0 0-.456-.616L17 15.434V10a1 1 0 0 0-1-1" }) });
};
forwardRef(SvgClockCounterClockwise);
const SvgCloud = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M20.008 5a11.01 11.01 0 0 0-9.847 6.084A10.9 10.9 0 0 0 9 15.966 1.023 1.023 0 0 1 8.071 17 1 1 0 0 1 7 16a13 13 0 0 1 .668-4.115.5.5 0 0 0-.594-.647A8.01 8.01 0 0 0 1 19c0 4.399 3.719 8 8.125 8H20a11.01 11.01 0 0 0 10.991-11.435C30.764 9.693 25.884 5 20.008 5" }) });
};
const ForwardRef$4g = forwardRef(SvgCloud);
const ForwardRef$4h = ForwardRef$4g;
const SvgCloudUpload = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30.991 15.565C30.764 9.693 25.884 5 20.008 5a11.01 11.01 0 0 0-9.847 6.084A10.9 10.9 0 0 0 9 15.966 1.023 1.023 0 0 1 8.071 17 1 1 0 0 1 7 16a13 13 0 0 1 .668-4.115.5.5 0 0 0-.594-.647A8.01 8.01 0 0 0 1 19c0 4.399 3.719 8 8.125 8H20a11.01 11.01 0 0 0 10.991-11.435m-7.283 3.143a1 1 0 0 1-1.415 0L20 16.414V24a1 1 0 0 1-2 0v-7.586l-2.293 2.293a1 1 0 0 1-1.415-1.415l4-4a1 1 0 0 1 1.415 0l4 4a1 1 0 0 1 0 1.415" }) });
};
forwardRef(SvgCloudUpload);
const SvgCode = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M8.96 12.153 4.342 16l4.618 3.848a1.5 1.5 0 1 1-1.92 2.305l-6-5a1.5 1.5 0 0 1 0-2.305l6-5a1.5 1.5 0 0 1 1.92 2.304m22 2.694-6-5a1.5 1.5 0 1 0-1.92 2.306L27.658 16l-4.618 3.848a1.5 1.5 0 1 0 1.92 2.305l6-5a1.5 1.5 0 0 0 0-2.305M20.512 3.59a1.5 1.5 0 0 0-1.922.898l-8 22a1.5 1.5 0 0 0 2.82 1.024l8-22a1.5 1.5 0 0 0-.898-1.922" }) });
};
const ForwardRef$4c = forwardRef(SvgCode);
const ForwardRef$4d = ForwardRef$4c;
const SvgCodeBlock = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 256 256", fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M200 40h-32a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v80a16 16 0 0 0 16 16h8v64a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m-93.66 21.66a8 8 0 0 1 11.32-11.32l24 24a8 8 0 0 1 0 11.32l-24 24a8 8 0 0 1-11.32-11.32L124.69 80Zm-64 24a8 8 0 0 1 0-11.32l24-24a8 8 0 0 1 11.32 11.32L59.31 80l18.35 18.34a8 8 0 0 1-11.32 11.32ZM200 200H56v-64h96a16 16 0 0 0 16-16V56h32Z" }) });
};
const ForwardRef$4a = forwardRef(SvgCodeBlock);
const ForwardRef$4b = ForwardRef$4a;
const SvgCoffee = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26 10H4a1 1 0 0 0-1 1v6a12.04 12.04 0 0 0 4.068 9H4a1 1 0 0 0 0 2h22a1 1 0 0 0 0-2h-3.067a12.1 12.1 0 0 0 3.375-5.011A5 5 0 0 0 31 16v-1a5 5 0 0 0-5-5m3 6a3 3 0 0 1-2.15 2.875Q27 17.944 27 17v-4.828A3 3 0 0 1 29 15zM14 7V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0m4 0V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0m-8 0V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0" }) });
};
const ForwardRef$48 = forwardRef(SvgCoffee);
const ForwardRef$49 = ForwardRef$48;
const SvgCog = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29.743 13.401a1 1 0 0 0-.487-.675l-3.729-2.125-.015-4.202a1 1 0 0 0-.353-.76 14 14 0 0 0-4.59-2.584 1 1 0 0 0-.808.074L16 5.23l-3.765-2.106a1 1 0 0 0-.809-.075 14 14 0 0 0-4.585 2.594 1 1 0 0 0-.354.758L6.47 10.61 2.74 12.734a1 1 0 0 0-.486.675 13.3 13.3 0 0 0 0 5.195 1 1 0 0 0 .486.675l3.729 2.125.015 4.204a1 1 0 0 0 .353.76 14 14 0 0 0 4.59 2.583 1 1 0 0 0 .808-.073L16 26.768l3.765 2.107a1.013 1.013 0 0 0 .809.073 14 14 0 0 0 4.585-2.592 1 1 0 0 0 .354-.759l.018-4.206 3.729-2.125a1 1 0 0 0 .486-.675c.34-1.713.338-3.477-.003-5.19M16 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10" }) });
};
const ForwardRef$46 = forwardRef(SvgCog);
const ForwardRef$47 = ForwardRef$46;
const SvgCollapse = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M18.5 12V6a1.5 1.5 0 1 1 3 0v4.5H26a1.5 1.5 0 1 1 0 3h-6a1.5 1.5 0 0 1-1.5-1.5M12 18.5H6a1.5 1.5 0 1 0 0 3h4.5V26a1.5 1.5 0 1 0 3 0v-6a1.5 1.5 0 0 0-1.5-1.5m14 0h-6a1.5 1.5 0 0 0-1.5 1.5v6a1.5 1.5 0 1 0 3 0v-4.5H26a1.5 1.5 0 1 0 0-3m-14-14A1.5 1.5 0 0 0 10.5 6v4.5H6a1.5 1.5 0 1 0 0 3h6a1.5 1.5 0 0 0 1.5-1.5V6A1.5 1.5 0 0 0 12 4.5" }) });
};
const ForwardRef$44 = forwardRef(SvgCollapse);
const ForwardRef$45 = ForwardRef$44;
const SvgCommand = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M22.5 17.5h-2v-3h2a5 5 0 1 0-5-5v2h-3v-2a5 5 0 1 0-5 5h2v3h-2a5 5 0 1 0 5 5v-2h3v2a5 5 0 1 0 5-5m-2-8a2 2 0 1 1 2 2h-2zm-13 0a2 2 0 0 1 4 0v2h-2a2 2 0 0 1-2-2m4 13a2 2 0 1 1-2-2h2zm3-8h3v3h-3zm8 10a2 2 0 0 1-2-2v-2h2a2 2 0 0 1 0 4" }) });
};
const ForwardRef$42 = forwardRef(SvgCommand);
const ForwardRef$43 = ForwardRef$42;
const SvgCrop = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30.5 24a1.5 1.5 0 0 1-1.5 1.5h-3.5V29a1.5 1.5 0 1 1-3 0v-3.5H8A1.5 1.5 0 0 1 6.5 24V9.5H3a1.5 1.5 0 0 1 0-3h3.5V3a1.5 1.5 0 0 1 3 0v19.5H29a1.5 1.5 0 0 1 1.5 1.5M13 9.5h9.5V19a1.5 1.5 0 1 0 3 0V8A1.5 1.5 0 0 0 24 6.5H13a1.5 1.5 0 0 0 0 3" }) });
};
const ForwardRef$40 = forwardRef(SvgCrop);
const ForwardRef$41 = ForwardRef$40;
const SvgCross = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26.061 23.939a1.503 1.503 0 0 1-2.125 2.125L16 18.125l-7.939 7.936a1.503 1.503 0 1 1-2.125-2.125L13.875 16 5.939 8.061a1.503 1.503 0 1 1 2.125-2.125L16 13.875l7.939-7.94a1.502 1.502 0 1 1 2.125 2.125L18.125 16z" }) });
};
const ForwardRef$3_ = forwardRef(SvgCross);
const ForwardRef$3$ = ForwardRef$3_;
const SvgCrossCircle = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m4.708 16.293a1 1 0 0 1-1.415 1.415L16 17.414l-3.293 3.293a1 1 0 0 1-1.415-1.415L14.587 16l-3.293-3.293a1 1 0 1 1 1.415-1.415L16 14.587l3.293-3.293a1 1 0 0 1 1.415 1.415L17.414 16z" }) });
};
forwardRef(SvgCrossCircle);
const SvgCrown = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30.48 9.524a1.51 1.51 0 0 0-1.668-.213l-6.276 3.125-5.24-8.704a1.514 1.514 0 0 0-2.592 0l-5.24 8.708L3.19 9.315a1.514 1.514 0 0 0-2.113 1.825l4.625 14.17a1 1 0 0 0 1.46.55C7.194 25.841 10.39 24 16 24s8.806 1.841 8.835 1.859a1 1 0 0 0 1.464-.549l4.625-14.166a1.51 1.51 0 0 0-.444-1.62M21.98 19.6a1 1 0 0 1-1.159.811 28.5 28.5 0 0 0-9.652 0 1 1 0 0 1-.348-1.97 30.6 30.6 0 0 1 10.348 0 1 1 0 0 1 .816 1.159z" }) });
};
const ForwardRef$3W = forwardRef(SvgCrown);
const ForwardRef$3X = ForwardRef$3W;
const SvgCursor = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27.414 24a2 2 0 0 1 0 2.829l-.585.585a2 2 0 0 1-2.829 0l-6.906-6.905-2.735 6.292A1.98 1.98 0 0 1 12.533 28h-.098a1.98 1.98 0 0 1-1.801-1.375L4.1 6.615A1.994 1.994 0 0 1 6.615 4.1l20.01 6.534a2 2 0 0 1 .176 3.725l-6.292 2.735z" }) });
};
const ForwardRef$3U = forwardRef(SvgCursor);
const ForwardRef$3V = ForwardRef$3U;
const SvgDatabase = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3C9.271 3 4 6.075 4 10v12c0 3.925 5.271 7 12 7s12-3.075 12-7V10c0-3.925-5.271-7-12-7m10 13c0 1.203-.985 2.429-2.701 3.365C21.366 20.419 18.774 21 16 21s-5.366-.581-7.299-1.635C6.985 18.429 6 17.203 6 16v-2.08C8.133 15.795 11.779 17 16 17s7.868-1.21 10-3.08zm-2.701 9.365C21.366 26.419 18.774 27 16 27s-5.366-.581-7.299-1.635C6.985 24.429 6 23.203 6 22v-2.08C8.133 21.795 11.779 23 16 23s7.868-1.21 10-3.08V22c0 1.203-.985 2.429-2.701 3.365" }) });
};
const ForwardRef$3S = forwardRef(SvgDatabase);
const ForwardRef$3T = ForwardRef$3S;
const SvgDiscuss = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29 12a2 2 0 0 0-2-2h-4V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v16a1 1 0 0 0 1.625.777L9 19.25V23a2 2 0 0 0 2 2h11.699l4.676 3.778A1 1 0 0 0 29 28zm-5.319 11.223a1 1 0 0 0-.625-.223H11v-4h10a2 2 0 0 0 2-2v-5h4v13.906z" }) });
};
const ForwardRef$3Q = forwardRef(SvgDiscuss);
const ForwardRef$3R = ForwardRef$3Q;
const SvgDownload = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 19v7a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 26v-7a1.5 1.5 0 0 1 3 0v6.5h19V19a1.5 1.5 0 1 1 3 0m-13.561 1.061a1.5 1.5 0 0 0 2.125 0l5-5a1.502 1.502 0 1 0-2.125-2.125L17.5 15.375V5a1.5 1.5 0 1 0-3 0v10.375l-2.439-2.436a1.502 1.502 0 1 0-2.125 2.125z" }) });
};
forwardRef(SvgDownload);
const SvgDrag = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M13.5 7.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0m7 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4m-9 4.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4m9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4m-9 8.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4m9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4" }) });
};
const ForwardRef$3M = forwardRef(SvgDrag);
const ForwardRef$3N = ForwardRef$3M;
const SvgDuplicate = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 4H11a1 1 0 0 0-1 1v5H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-5h5a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1m-1 16h-4v-9a1 1 0 0 0-1-1h-9V6h14z" }) });
};
const ForwardRef$3K = forwardRef(SvgDuplicate);
const ForwardRef$3L = ForwardRef$3K;
const SvgEarth = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m11 13c.001 1.411-.27 2.81-.8 4.118l-5.587-3.437a2 2 0 0 0-.78-.279l-2.853-.385a2.01 2.01 0 0 0-2 .983h-1.09l-.475-.983a1.99 1.99 0 0 0-1.375-1.083l-1-.216.978-1.718h2.088c.338 0 .67-.087.966-.25l1.532-.845q.202-.113.375-.268l3.364-3.042a1.99 1.99 0 0 0 .407-2.458l-.045-.08A11.01 11.01 0 0 1 27 16M5 16a10.94 10.94 0 0 1 1.068-4.725l1.417 3.784a2 2 0 0 0 1.453 1.25l2.678.576.476.99a2.01 2.01 0 0 0 1.8 1.125h.186l-.904 2.029a2 2 0 0 0 .357 2.171l.018.018L16 25.742l-.242 1.25A11.014 11.014 0 0 1 5 16" }) });
};
const ForwardRef$3I = forwardRef(SvgEarth);
const ForwardRef$3J = ForwardRef$3I;
const SvgEarthStriked = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: [
/* @__PURE__ */ jsx("path", { d: "M20.689 3.88A13 13 0 0 0 16 3a13 13 0 0 0-8.155 23.124l1.02-1.765A11 11 0 0 1 5 16a10.94 10.94 0 0 1 1.068-4.724l1.417 3.784a2 2 0 0 0 1.453 1.25l2.678.576.476.99q.113.226.275.418l1.169-2.025-.121-.25a1.99 1.99 0 0 0-1.375-1.084l-1-.217.978-1.717h2.088c.338 0 .67-.087.966-.25l.726-.4z" }),
/* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "m24 2.144 1.732 1-1.58 2.736q.54.435 1.036.932A13.01 13.01 0 0 1 29 16a13 13 0 0 1-17.69 12.124l-1.578 2.732-1.732-1zm-.86 5.49-4.936 8.549 1.628.22c.277.037.543.132.78.278l5.588 3.436c.53-1.308.801-2.706.8-4.117a11.01 11.01 0 0 0-3.86-8.367M13.92 23.6l-1.593 2.76a11 11 0 0 0 3.43.631l.242-1.25z", clipRule: "evenodd" })
] });
};
forwardRef(SvgEarthStriked);
const SvgEmotionHappy = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-4.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m10.365 7.5C20.579 21.724 18.441 23 16 23s-4.579-1.275-5.865-3.5a1.001 1.001 0 0 1 1.477-1.31q.157.129.253.31C12.799 20.114 14.266 21 16 21s3.201-.887 4.135-2.5a1 1 0 1 1 1.73 1M20.5 15a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3" }) });
};
const ForwardRef$3E = forwardRef(SvgEmotionHappy);
const ForwardRef$3F = ForwardRef$3E;
const SvgEmotionUnhappy = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-4.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m10 10.865a1 1 0 0 1-1.365-.365C19.201 20.886 17.734 20 16 20s-3.201.887-4.135 2.5a1.001 1.001 0 1 1-1.73-1C11.421 19.276 13.559 18 16 18s4.579 1.275 5.865 3.5a1 1 0 0 1-.365 1.365M20.5 15a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3" }) });
};
const ForwardRef$3C = forwardRef(SvgEmotionUnhappy);
const ForwardRef$3D = ForwardRef$3C;
const SvgExpand = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27.5 6v5a1.5 1.5 0 1 1-3 0V7.5H21a1.5 1.5 0 0 1 0-3h5A1.5 1.5 0 0 1 27.5 6M11 24.5H7.5V21a1.5 1.5 0 0 0-3 0v5A1.5 1.5 0 0 0 6 27.5h5a1.5 1.5 0 1 0 0-3m15-5a1.5 1.5 0 0 0-1.5 1.5v3.5H21a1.5 1.5 0 1 0 0 3h5a1.5 1.5 0 0 0 1.5-1.5v-5a1.5 1.5 0 0 0-1.5-1.5m-15-15H6A1.5 1.5 0 0 0 4.5 6v5a1.5 1.5 0 0 0 3 0V7.5H11a1.5 1.5 0 0 0 0-3" }) });
};
const ForwardRef$3A = forwardRef(SvgExpand);
const ForwardRef$3B = ForwardRef$3A;
const SvgExternalLink = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 13a1.5 1.5 0 1 1-3 0V8.625l-7.439 7.439a1.503 1.503 0 1 1-2.125-2.125L23.375 6.5H19a1.5 1.5 0 0 1 0-3h8A1.5 1.5 0 0 1 28.5 5zM23 16a1.5 1.5 0 0 0-1.5 1.5v8h-15v-15h8a1.5 1.5 0 1 0 0-3H6A2.5 2.5 0 0 0 3.5 10v16A2.5 2.5 0 0 0 6 28.5h16a2.5 2.5 0 0 0 2.5-2.5v-8.5A1.5 1.5 0 0 0 23 16" }) });
};
const ForwardRef$3y = forwardRef(SvgExternalLink);
const ForwardRef$3z = ForwardRef$3y;
const SvgEye = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30.914 15.595c-.044-.099-1.103-2.447-3.457-4.801C24.322 7.657 20.36 6 16 6S7.679 7.657 4.542 10.794C2.19 13.148 1.125 15.5 1.086 15.595a1 1 0 0 0 0 .812c.044.1 1.103 2.447 3.456 4.8C7.68 24.344 11.64 26 16 26s8.321-1.657 11.458-4.792c2.353-2.354 3.412-4.702 3.456-4.8a1 1 0 0 0 0-.813M16 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10" }) });
};
const ForwardRef$3w = forwardRef(SvgEye);
const ForwardRef$3x = ForwardRef$3w;
const SvgEyeStriked = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M6.74 4.328a1 1 0 1 0-1.48 1.345l2.405 2.646c-4.54 2.786-6.493 7.081-6.579 7.276a1 1 0 0 0 0 .813c.044.098 1.103 2.446 3.456 4.8C7.68 24.343 11.64 26 16 26c2.24.013 4.459-.448 6.509-1.354l2.75 3.027a1 1 0 1 0 1.48-1.345zm11.125 15.21a4 4 0 0 1-5.209-5.73zm13.049-3.13c-.053.117-1.319 2.92-4.17 5.475a1 1 0 0 1-1.408-.072L12.675 7.884a1 1 0 0 1 .575-1.66A17 17 0 0 1 16 6c4.36 0 8.321 1.658 11.458 4.794 2.353 2.354 3.412 4.702 3.456 4.801a1 1 0 0 1 0 .813" }) });
};
const ForwardRef$3u = forwardRef(SvgEyeStriked);
const ForwardRef$3v = ForwardRef$3u;
const SvgFaders = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M17 15v12a1 1 0 0 1-2 0V15a1 1 0 0 1 2 0m8 9a1 1 0 0 0-1 1v2a1 1 0 0 0 2 0v-2a1 1 0 0 0-1-1m3-6h-2V5a1 1 0 0 0-2 0v13h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1M7 20a1 1 0 0 0-1 1v6a1 1 0 1 0 2 0v-6a1 1 0 0 0-1-1m3-6H8V5a1 1 0 0 0-2 0v9H4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1m9-6h-2V5a1 1 0 0 0-2 0v3h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1" }) });
};
const ForwardRef$3s = forwardRef(SvgFaders);
const ForwardRef$3t = ForwardRef$3s;
const SvgFeather = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m26.48 16.851-7.474 7.559a1.97 1.97 0 0 1-1.4.585H9.415l-3.707 3.712a1.001 1.001 0 0 1-1.415-1.415l2.823-2.822L15.588 16h10.537a.5.5 0 0 1 .355.851m.607-13.03a8 8 0 0 0-10.737.518l-1.2 1.185a.5.5 0 0 0-.15.351v7.875l6.875-6.875a1 1 0 0 1 1.414 1.414L17.589 14h11.047a.5.5 0 0 0 .445-.27 8.01 8.01 0 0 0-1.994-9.909M7.854 20.904 13 15.758V8.845a.5.5 0 0 0-.851-.355L7.586 13A1.99 1.99 0 0 0 7 14.414v6.136a.5.5 0 0 0 .854.354" }) });
};
const ForwardRef$3q = forwardRef(SvgFeather);
const ForwardRef$3r = ForwardRef$3q;
const SvgFile = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m26.708 10.293-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V11a1 1 0 0 0-.293-.707M19 11V5.5l5.5 5.5z" }) });
};
const ForwardRef$3o = forwardRef(SvgFile);
const ForwardRef$3p = ForwardRef$3o;
const SvgFileCsv = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 256 256", fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m213.66 82.34-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66M152 88V44l44 44ZM48 180c0 11 7.18 20 16 20a14.18 14.18 0 0 0 10.06-4.5 8.21 8.21 0 0 1 10.9-.91 8 8 0 0 1 .82 11.81A30.06 30.06 0 0 1 64 216c-17.64 0-32-16.15-32-36s14.36-36 32-36a30 30 0 0 1 21.39 9.19 8.26 8.26 0 0 1 .73 11.09 8 8 0 0 1-11.9.38A14.17 14.17 0 0 0 64 160c-8.82 0-16 9-16 20m103.81 16.31a20.82 20.82 0 0 1-9.19 15.23C137.43 215 131 216 125.13 216a61.1 61.1 0 0 1-15.13-2 8 8 0 1 1 4.3-15.41c4.38 1.2 14.95 2.7 19.55-.36.88-.59 1.83-1.52 2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56 20.56 0 0 1 9-14.95c11.84-8 30.71-3.31 32.83-2.76a8 8 0 0 1-4.07 15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54 4.54 0 0 0-2 3.67c-.12.9-.14 1.09 1.11 1.9 2.31 1.49 6.45 2.68 10.45 3.84 9.79 2.83 26.35 7.66 24.11 24.97M215.42 155l-19.89 55.68a8 8 0 0 1-15.06 0L160.58 155a8.21 8.21 0 0 1 4.5-10.45 8 8 0 0 1 10.45 4.76l12.47 34.9 12.47-34.9a8 8 0 0 1 10.45-4.76 8.23 8.23 0 0 1 4.5 10.45" }) });
};
forwardRef(SvgFileCsv);
const SvgFileError = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m26.708 10.293-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V11a1 1 0 0 0-.293-.707m-7 11a1 1 0 0 1-1.415 1.415L16 20.414l-2.293 2.293a1 1 0 0 1-1.415-1.415L14.587 19l-2.293-2.293a1 1 0 1 1 1.415-1.415L16 17.587l2.293-2.293a1 1 0 0 1 1.415 1.415L17.414 19zM19 11V5.5l5.5 5.5z" }) });
};
const ForwardRef$3k = forwardRef(SvgFileError);
const ForwardRef$3l = ForwardRef$3k;
const SvgFilePdf = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M6 15h20a1 1 0 0 0 1-1v-3a1 1 0 0 0-.293-.707l-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v9a1 1 0 0 0 1 1m13-9.5 5.5 5.5H19zM28 19a1 1 0 0 1-1 1h-3v2h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1M8 18H6a1 1 0 0 0-1 1v7a1 1 0 1 0 2 0v-1h1a3.5 3.5 0 1 0 0-7m0 5H7v-3h1a1.5 1.5 0 1 1 0 3m8-5h-2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h2a4.5 4.5 0 1 0 0-9m0 7h-1v-5h1a2.5 2.5 0 0 1 0 5" }) });
};
const ForwardRef$3i = forwardRef(SvgFilePdf);
const ForwardRef$3j = ForwardRef$3i;
const SvgFileXls = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 256 256", fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M44 120h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4m108-76 44 44h-44Zm4 164.53a8.18 8.18 0 0 1-8.25 7.47H120a8 8 0 0 1-8-8v-55.73a8.18 8.18 0 0 1 7.47-8.25 8 8 0 0 1 8.53 8v48h20a8 8 0 0 1 8 8.51m-61.49-51.88L77.83 180l16.68 23.35a8 8 0 0 1-13 9.3L68 193.76l-13.49 18.89a8 8 0 1 1-13-9.3L58.17 180l-16.68-23.35a8 8 0 0 1 2.3-11.46 8.19 8.19 0 0 1 10.88 2.38L68 166.24l13.49-18.89a8 8 0 0 1 13 9.3Zm121.28 39.66a20.81 20.81 0 0 1-9.18 15.23c-5.19 3.46-11.67 4.46-17.49 4.46a60.6 60.6 0 0 1-15.19-2 8 8 0 0 1 4.31-15.41c4.38 1.21 14.94 2.71 19.54-.35.89-.6 1.84-1.52 2.15-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58 20.58 0 0 1 8.95-14.94c11.84-8 30.72-3.31 32.83-2.76a8 8 0 0 1-4.07 15.48c-4.48-1.17-15.22-2.56-19.82.56a4.54 4.54 0 0 0-2 3.67c-.11.9-.13 1.08 1.12 1.9 2.31 1.49 6.45 2.68 10.45 3.84 9.87 2.82 26.39 7.65 24.18 24.96" }) });
};
forwardRef(SvgFileXls);
const SvgFileZip = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 256 256", fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M184 144h-16a8 8 0 0 0-8 8v55.73a8.17 8.17 0 0 0 7.47 8.25 8 8 0 0 0 8.53-8v-8h7.4c15.24 0 28.14-11.92 28.59-27.15A28 28 0 0 0 184 144m-.35 40H176v-24h8a12 12 0 0 1 12 13.16A12.25 12.25 0 0 1 183.65 184M136 152v55.73a8.17 8.17 0 0 1-7.47 8.25 8 8 0 0 1-8.53-8v-55.71a8.17 8.17 0 0 1 7.47-8.25A8 8 0 0 1 136 152m-40 56.53a8.17 8.17 0 0 1-8.27 7.47h-31.5a8.27 8.27 0 0 1-6-2.5 8 8 0 0 1-1.18-9.5l25.16-44H56.27a8.17 8.17 0 0 1-8.27-7.47 8 8 0 0 1 8-8.53h31.77a8.27 8.27 0 0 1 6 2.5A8 8 0 0 1 95 156l-25.21 44H88a8 8 0 0 1 8 8.53M213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66M152 88V44l44 44Z" }) });
};
forwardRef(SvgFileZip);
const SvgFilter = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M25.5 16a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 1 1 0-3h16a1.5 1.5 0 0 1 1.5 1.5M29 8.5H3a1.5 1.5 0 0 0 0 3h26a1.5 1.5 0 1 0 0-3m-10 12h-6a1.5 1.5 0 1 0 0 3h6a1.5 1.5 0 1 0 0-3" }) });
};
const ForwardRef$3c = forwardRef(SvgFilter);
const ForwardRef$3d = ForwardRef$3c;
const SvgFolder = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 9H16.414L13 5.586A1.98 1.98 0 0 0 11.586 5H5a2 2 0 0 0-2 2v18.078A1.926 1.926 0 0 0 4.924 27H27.11A1.89 1.89 0 0 0 29 25.111V11a2 2 0 0 0-2-2M5 7h6.586l2 2H5z" }) });
};
const ForwardRef$3a = forwardRef(SvgFolder);
const ForwardRef$3b = ForwardRef$3a;
const SvgGift = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 9h-4.385q.075-.06.146-.125A3.7 3.7 0 0 0 24 6.196 4.08 4.08 0 0 0 19.805 2a3.7 3.7 0 0 0-2.68 1.239A6.9 6.9 0 0 0 16 5.049a6.9 6.9 0 0 0-1.125-1.81A3.7 3.7 0 0 0 12.195 2 4.08 4.08 0 0 0 8 6.196a3.7 3.7 0 0 0 1.239 2.679q.072.06.146.125H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2v8a2 2 0 0 0 2 2h7.5a.5.5 0 0 0 .5-.5V15H5v-4h10v4h2v-4h10v4H17v11.5a.5.5 0 0 0 .5.5H25a2 2 0 0 0 2-2v-8a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2M10.564 7.375A1.7 1.7 0 0 1 10 6.125 2.076 2.076 0 0 1 12.074 4h.061a1.71 1.71 0 0 1 1.25.563c1.049 1.185 1.419 3.15 1.549 4.365-1.22-.13-3.184-.5-4.37-1.553m10.875 0c-1.186 1.05-3.155 1.42-4.375 1.55.148-1.314.561-3.237 1.561-4.361A1.7 1.7 0 0 1 19.875 4h.061A2.077 2.077 0 0 1 22 6.135a1.7 1.7 0 0 1-.564 1.24z" }) });
};
const ForwardRef$38 = forwardRef(SvgGift);
const ForwardRef$39 = ForwardRef$38;
const SvgGlobe = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m9.796 8h-4.428a17.8 17.8 0 0 0-2.533-5.625A11.05 11.05 0 0 1 25.796 11M16 5.014c1.5 1.625 2.625 3.693 3.296 5.986h-6.592C13.375 8.707 14.5 6.641 16 5.014M12 16c0-1.005.084-2.009.25-3h7.5a18.2 18.2 0 0 1 0 6h-7.5a18 18 0 0 1-.25-3m.704 5h6.592c-.671 2.293-1.796 4.359-3.296 5.986-1.5-1.627-2.625-3.693-3.296-5.986m6.131 5.625A17.8 17.8 0 0 0 21.367 21h4.43a11.05 11.05 0 0 1-6.962 5.625M21.776 19a20.2 20.2 0 0 0 0-6h4.808a11 11 0 0 1 0 6z" }) });
};
const ForwardRef$36 = forwardRef(SvgGlobe);
const ForwardRef$37 = ForwardRef$36;
const SvgGraphQl = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M13.29 28.226 6.765 24.46a2.822 2.822 0 1 1-2.708-4.693v-7.532a2.824 2.824 0 1 1 2.708-4.693l6.525-3.767a2.824 2.824 0 1 1 5.42 0l6.524 3.766a2.822 2.822 0 1 1 2.71 4.693v7.533a2.824 2.824 0 1 1-2.71 4.694l-6.524 3.766A2.825 2.825 0 0 1 16 31.84a2.822 2.822 0 0 1-2.71-3.614M16 5.806q.413-.002.791-.113l8.531 14.776a2.8 2.8 0 0 0-.791 1.37H7.467a2.8 2.8 0 0 0-.79-1.369L15.21 5.693q.377.11.791.112M7.468 23.178l-.033.12 6.526 3.767A2.81 2.81 0 0 1 16 26.195c.802 0 1.526.334 2.04.871l6.523-3.766-.032-.121zM5.397 12.233a2.824 2.824 0 0 0 2.038-3.532l6.526-3.767q.043.045.088.088L5.517 19.8l-.12-.032zM26.482 19.8q.06-.018.121-.033v-7.532a2.824 2.824 0 0 1-2.04-3.534L18.04 4.934q-.045.045-.089.088z", clipRule: "evenodd" }) });
};
forwardRef(SvgGraphQl);
const SvgGridFour = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 7v7.5a.5.5 0 0 1-.5.5H17V5.5a.5.5 0 0 1 .5-.5H25a2 2 0 0 1 2 2M14.5 5H7a2 2 0 0 0-2 2v7.5a.5.5 0 0 0 .5.5H15V5.5a.5.5 0 0 0-.5-.5m12 12H17v9.5a.5.5 0 0 0 .5.5H25a2 2 0 0 0 2-2v-7.5a.5.5 0 0 0-.5-.5M5 17.5V25a2 2 0 0 0 2 2h7.5a.5.5 0 0 0 .5-.5V17H5.5a.5.5 0 0 0-.5.5" }) });
};
const ForwardRef$32 = forwardRef(SvgGridFour);
const ForwardRef$33 = ForwardRef$32;
const SvgGridNine = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M10.5 6.5v5h-7A.5.5 0 0 1 3 11V8a2 2 0 0 1 2-2h5a.5.5 0 0 1 .5.5m2 19a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5v-5h-7zM3 21v3a2 2 0 0 0 2 2h5a.5.5 0 0 0 .5-.5v-5h-7a.5.5 0 0 0-.5.5m0-7v4a.5.5 0 0 0 .5.5h7v-5h-7a.5.5 0 0 0-.5.5m16-8h-6a.5.5 0 0 0-.5.5v5h7v-5A.5.5 0 0 0 19 6m9.5 7.5h-7v5h7a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 0-.5-.5m-16 5h7v-5h-7zM27 6h-5a.5.5 0 0 0-.5.5v5h7a.5.5 0 0 0 .5-.5V8a2 2 0 0 0-2-2m1.5 14.5h-7v5a.5.5 0 0 0 .5.5h5a2 2 0 0 0 2-2v-3a.5.5 0 0 0-.5-.5" }) });
};
const ForwardRef$30 = forwardRef(SvgGridNine);
const ForwardRef$31 = ForwardRef$30;
const SvgHandHeart = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.791 17.633a3.04 3.04 0 0 0-2.326-.597C28.813 14.666 30 12.31 30 10c0-3.309-2.661-6-5.933-6A5.95 5.95 0 0 0 19.5 6.094 5.95 5.95 0 0 0 14.932 4C11.663 4 9 6.691 9 10c0 1.375.405 2.711 1.258 4.125a4 4 0 0 0-1.844 1.05L5.586 18H2a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h13q.123 0 .242-.03l8-2a1 1 0 0 0 .15-.05l4.858-2.067.055-.025a3.074 3.074 0 0 0 .491-5.195zm-1.362 3.393-4.75 2.023L14.875 25H7v-5.586l2.829-2.828A1.98 1.98 0 0 1 11.242 16H17.5a1.5 1.5 0 0 1 0 3H14a1 1 0 0 0 0 2h4q.113 0 .224-.025l8.375-1.926.038-.01a1.075 1.075 0 0 1 .788 1.987z" }) });
};
const ForwardRef$2_ = forwardRef(SvgHandHeart);
const ForwardRef$2$ = ForwardRef$2_;
const SvgHashtag = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28 10.5h-5.475l.951-5.231a1.5 1.5 0 1 0-2.952-.538L19.475 10.5h-4.95l.951-5.231a1.5 1.5 0 1 0-2.952-.538L11.475 10.5H6a1.5 1.5 0 0 0 0 3h4.93l-.909 5H4a1.5 1.5 0 0 0 0 3h5.475l-.951 5.231a1.5 1.5 0 0 0 1.207 1.75q.134.022.269.019a1.5 1.5 0 0 0 1.475-1.233l1.05-5.767h4.95l-.951 5.231a1.5 1.5 0 1 0 2.952.543l1.049-5.774H26a1.5 1.5 0 1 0 0-3h-4.93l.909-5H28a1.5 1.5 0 1 0 0-3m-9.979 8H13.07l.909-5h4.951z" }) });
};
const ForwardRef$2Y = forwardRef(SvgHashtag);
const ForwardRef$2Z = ForwardRef$2Y;
const SvgHeadingFive = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M31.5 22.5a5 5 0 0 1-5 5 4.94 4.94 0 0 1-3.571-1.45 1.5 1.5 0 0 1 2.142-2.1 1.94 1.94 0 0 0 1.429.55 2 2 0 0 0 0-4 1.94 1.94 0 0 0-1.429.55 1.5 1.5 0 0 1-2.551-1.3l1-6A1.5 1.5 0 0 1 25 12.5h5a1.5 1.5 0 1 1 0 3h-3.729l-.338 2.029q.283-.03.567-.029a5 5 0 0 1 5 5M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5" }) });
};
const ForwardRef$2W = forwardRef(SvgHeadingFive);
const ForwardRef$2X = ForwardRef$2W;
const SvgHeadingFour = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M32 22a1.5 1.5 0 0 1-1.5 1.5V26a1.5 1.5 0 1 1-3 0v-2.5H23a1.5 1.5 0 0 1-1.422-1.974l3-9a1.5 1.5 0 0 1 2.845.948L25.08 20.5H27.5V18a1.5 1.5 0 1 1 3 0v2.5A1.5 1.5 0 0 1 32 22M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5" }) });
};
const ForwardRef$2U = forwardRef(SvgHeadingFour);
const ForwardRef$2V = ForwardRef$2U;
const SvgHeadingOne = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29.5 14v12a1.5 1.5 0 1 1-3 0v-9.198l-.668.448a1.503 1.503 0 0 1-1.665-2.5l3-2A1.5 1.5 0 0 1 29.5 14M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5" }) });
};
const ForwardRef$2S = forwardRef(SvgHeadingOne);
const ForwardRef$2T = ForwardRef$2S;
const SvgHeadingSix = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m27.133 17.541 1.655-2.772a1.5 1.5 0 1 0-2.576-1.538l-4.03 6.75q-.018.029-.032.059a5 5 0 1 0 4.983-2.5zM26.5 24.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4M19.5 7v15a1.5 1.5 0 1 1-3 0v-6h-10v6a1.5 1.5 0 0 1-3 0V7a1.5 1.5 0 0 1 3 0v6h10V7a1.5 1.5 0 1 1 3 0" }) });
};
const ForwardRef$2Q = forwardRef(SvgHeadingSix);
const ForwardRef$2R = ForwardRef$2Q;
const SvgHeadingThree = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M31.5 22.5a5 5 0 0 1-8.571 3.5 1.5 1.5 0 1 1 2.142-2.099A2 2 0 1 0 26.5 20.5a1.5 1.5 0 0 1-1.229-2.36l1.854-2.64H24a1.5 1.5 0 1 1 0-3h6a1.5 1.5 0 0 1 1.229 2.36l-2.293 3.275A5 5 0 0 1 31.5 22.5M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5" }) });
};
const ForwardRef$2O = forwardRef(SvgHeadingThree);
const ForwardRef$2P = ForwardRef$2O;
const SvgHeadingTwo = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M19.5 7v15a1.5 1.5 0 1 1-3 0v-6h-10v6a1.5 1.5 0 0 1-3 0V7a1.5 1.5 0 0 1 3 0v6h10V7a1.5 1.5 0 1 1 3 0M30 24.5h-3l3.593-4.791a4.499 4.499 0 1 0-7.837-4.209 1.5 1.5 0 1 0 2.829 1q.076-.218.216-.402a1.5 1.5 0 1 1 2.394 1.807L22.8 25.1a1.5 1.5 0 0 0 1.2 2.4h6a1.5 1.5 0 1 0 0-3" }) });
};
const ForwardRef$2M = forwardRef(SvgHeadingTwo);
const ForwardRef$2N = ForwardRef$2M;
const SvgHeadphones = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29 17v7a3 3 0 0 1-3 3h-2a3 3 0 0 1-3-3v-5a3 3 0 0 1 3-3h2.956A10.964 10.964 0 0 0 16.081 6H16A11 11 0 0 0 5.045 16H8a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a13.014 13.014 0 0 1 22.236-9.167A12.93 12.93 0 0 1 29 17" }) });
};
const ForwardRef$2K = forwardRef(SvgHeadphones);
const ForwardRef$2L = ForwardRef$2K;
const SvgHeart = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30 11.75c0 8.75-12.974 15.833-13.526 16.125a1 1 0 0 1-.948 0C14.974 27.582 2 20.5 2 11.75A7.76 7.76 0 0 1 9.75 4c2.581 0 4.841 1.11 6.25 2.986C17.409 5.11 19.669 4 22.25 4A7.76 7.76 0 0 1 30 11.75" }) });
};
const ForwardRef$2I = forwardRef(SvgHeart);
const ForwardRef$2J = ForwardRef$2I;
const SvgHouse = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28 14.444V26a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V14.444a2 2 0 0 1 .646-1.473l10-9.435.014-.013a2 2 0 0 1 2.705.013l10 9.435A2 2 0 0 1 28 14.444" }) });
};
const ForwardRef$2G = forwardRef(SvgHouse);
const ForwardRef$2H = ForwardRef$2G;
const SvgImage = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-7.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M5 25v-3.5l6.5-6.5 10 10zm22 0h-2.671l-4.5-4.5 2.5-2.5L27 22.672z" }) });
};
const ForwardRef$2E = forwardRef(SvgImage);
const ForwardRef$2F = ForwardRef$2E;
const SvgImages = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 5H9a2 2 0 0 0-2 2v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2v-2h2a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M23 25H5V11h2v10a2 2 0 0 0 2 2h14zm4-4H9v-4.5l4.5-4.5 6.208 6.208a1 1 0 0 0 1.413 0L24.33 15 27 17.672z" }) });
};
const ForwardRef$2C = forwardRef(SvgImages);
const ForwardRef$2D = ForwardRef$2C;
const SvgIndentDecrease = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 16a1.5 1.5 0 0 1-1.5 1.5H15a1.5 1.5 0 0 1 0-3h12a1.5 1.5 0 0 1 1.5 1.5M15 9.5h12a1.5 1.5 0 0 0 0-3H15a1.5 1.5 0 0 0 0 3m12 13H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 0 0 0-3m-18-4a1.5 1.5 0 0 0 1.061-2.561L6.125 12l3.936-3.94a1.503 1.503 0 1 0-2.125-2.125l-5 5a1.5 1.5 0 0 0 0 2.125l5 5A1.5 1.5 0 0 0 9 18.5" }) });
};
forwardRef(SvgIndentDecrease);
const SvgIndentIncrease = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 16a1.5 1.5 0 0 1-1.5 1.5H15a1.5 1.5 0 0 1 0-3h12a1.5 1.5 0 0 1 1.5 1.5M15 9.5h12a1.5 1.5 0 0 0 0-3H15a1.5 1.5 0 0 0 0 3m12 13H5a1.5 1.5 0 0 0 0 3h22a1.5 1.5 0 1 0 0-3M3.939 18.06a1.5 1.5 0 0 0 2.125 0l5-5a1.5 1.5 0 0 0 0-2.125l-5-5a1.503 1.503 0 0 0-2.125 2.125L7.875 12l-3.936 3.939a1.5 1.5 0 0 0 0 2.122" }) });
};
forwardRef(SvgIndentIncrease);
const SvgInformation = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M17 23a2 2 0 0 1-2-2v-5a1 1 0 0 1 0-2 2 2 0 0 1 2 2v5a1 1 0 0 1 0 2" }) });
};
const ForwardRef$2w = forwardRef(SvgInformation);
const ForwardRef$2x = ForwardRef$2w;
const SvgItalic = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M25.5 7A1.5 1.5 0 0 1 24 8.5h-3.919l-5 15H18a1.5 1.5 0 1 1 0 3H8a1.5 1.5 0 1 1 0-3h3.919l5-15H14a1.5 1.5 0 0 1 0-3h10A1.5 1.5 0 0 1 25.5 7" }) });
};
const ForwardRef$2u = forwardRef(SvgItalic);
const ForwardRef$2v = ForwardRef$2u;
const SvgKey = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M20 2a10.01 10.01 0 0 0-9.511 13.098l-7.196 7.195A1 1 0 0 0 3 23v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-2h2a1 1 0 0 0 1-1v-2h2a1 1 0 0 0 .707-.293l1.195-1.196A10 10 0 1 0 20 2m2.5 9.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4" }) });
};
const ForwardRef$2s = forwardRef(SvgKey);
const ForwardRef$2t = ForwardRef$2s;
const SvgLayout = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M5 7h22v5H5zm22 18H14V14h13z" }) });
};
const ForwardRef$2q = forwardRef(SvgLayout);
const ForwardRef$2r = ForwardRef$2q;
const SvgLightbulb = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M22 29a1 1 0 0 1-1 1H11a1 1 0 1 1 0-2h10a1 1 0 0 1 1 1m5-16a10.94 10.94 0 0 1-4.205 8.651A2.03 2.03 0 0 0 22 23.25V24a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-.75a2 2 0 0 0-.779-1.582A10.95 10.95 0 0 1 5 13.06C4.967 7.104 9.782 2.143 15.735 2A11 11 0 0 1 27 13m-4.014-1.168a7.2 7.2 0 0 0-5.82-5.818 1 1 0 1 0-.332 1.972c2.071.349 3.829 2.106 4.18 4.182a1 1 0 0 0 1.972-.335" }) });
};
const ForwardRef$2o = forwardRef(SvgLightbulb);
const ForwardRef$2p = ForwardRef$2o;
const SvgLightning = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m21.731 14.683-14 15a1 1 0 0 1-1.711-.875l1.832-9.167L.65 16.936a1 1 0 0 1-.375-1.625l14-15a1 1 0 0 1 1.71.875l-1.837 9.177 7.204 2.7a1 1 0 0 1 .375 1.62z" }) });
};
forwardRef(SvgLightning);
const SvgLink = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M17.046 23.441a1.5 1.5 0 0 1 0 2.125l-.742.743a7.502 7.502 0 1 1-10.61-10.61l3.015-3.014A7.5 7.5 0 0 1 19 12.375a1.506 1.506 0 0 1-2 2.25 4.5 4.5 0 0 0-6.171.184l-3.013 3.01a4.5 4.5 0 0 0 6.365 6.365l.743-.743a1.5 1.5 0 0 1 2.122 0m9.26-17.75a7.51 7.51 0 0 0-10.61 0l-.742.743a1.503 1.503 0 1 0 2.125 2.125l.742-.743a4.5 4.5 0 0 1 6.365 6.365l-3.014 3.015a4.5 4.5 0 0 1-6.172.179 1.506 1.506 0 1 0-2 2.25 7.5 7.5 0 0 0 10.288-.304l3.014-3.014a7.51 7.51 0 0 0 .004-10.613z" }) });
};
const ForwardRef$2k = forwardRef(SvgLink);
const ForwardRef$2l = ForwardRef$2k;
const SvgList = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 16a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5M5 9.5h22a1.5 1.5 0 0 0 0-3H5a1.5 1.5 0 0 0 0 3m22 13H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 1 0 0-3" }) });
};
forwardRef(SvgList);
const SvgListPlus = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M3.5 8A1.5 1.5 0 0 1 5 6.5h22a1.5 1.5 0 0 1 0 3H5A1.5 1.5 0 0 1 3.5 8M5 17.5h22a1.5 1.5 0 1 0 0-3H5a1.5 1.5 0 1 0 0 3m13 5H5a1.5 1.5 0 1 0 0 3h13a1.5 1.5 0 1 0 0-3m11 0h-1.5V21a1.5 1.5 0 1 0-3 0v1.5H23a1.5 1.5 0 1 0 0 3h1.5V27a1.5 1.5 0 1 0 3 0v-1.5H29a1.5 1.5 0 1 0 0-3" }) });
};
const ForwardRef$2g = forwardRef(SvgListPlus);
const ForwardRef$2h = ForwardRef$2g;
const SvgLoader = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M17.5 4v4a1.5 1.5 0 1 1-3 0V4a1.5 1.5 0 1 1 3 0m4.156 7.844a1.5 1.5 0 0 0 1.062-.44l2.828-2.829a1.503 1.503 0 1 0-2.125-2.125l-2.825 2.833a1.5 1.5 0 0 0 1.06 2.56M28 14.5h-4a1.5 1.5 0 1 0 0 3h4a1.5 1.5 0 1 0 0-3m-5.282 6.096a1.501 1.501 0 0 0-2.451 1.638c.075.182.186.348.326.487l2.828 2.829a1.503 1.503 0 0 0 2.125-2.125zM16 22.5a1.5 1.5 0 0 0-1.5 1.5v4a1.5 1.5 0 1 0 3 0v-4a1.5 1.5 0 0 0-1.5-1.5m-6.717-1.904-2.83 2.829A1.503 1.503 0 0 0 8.58 25.55l2.829-2.829a1.503 1.503 0 0 0-2.125-2.125M9.5 16A1.5 1.5 0 0 0 8 14.5H4a1.5 1.5 0 1 0 0 3h4A1.5 1.5 0 0 0 9.5 16m-.925-9.546A1.503 1.503 0 0 0 6.45 8.579l2.833 2.825a1.503 1.503 0 0 0 2.125-2.125z" }) });
};
const ForwardRef$2e = forwardRef(SvgLoader);
const ForwardRef$2f = ForwardRef$2e;
const SvgLock = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26 10h-4V7a6 6 0 1 0-12 0v3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V12a2 2 0 0 0-2-2M16 20.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M20 10h-8V7a4 4 0 1 1 8 0z" }) });
};
const ForwardRef$2c = forwardRef(SvgLock);
const ForwardRef$2d = ForwardRef$2c;
const SvgMagic = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M31 19a1 1 0 0 1-1 1h-2v2a1 1 0 0 1-2 0v-2h-2a1 1 0 0 1 0-2h2v-2a1 1 0 1 1 2 0v2h2a1 1 0 0 1 1 1M7 9h2v2a1 1 0 1 0 2 0V9h2a1 1 0 0 0 0-2h-2V5a1 1 0 0 0-2 0v2H7a1 1 0 0 0 0 2m16 15h-1v-1a1 1 0 0 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 1 0 2 0v-1h1a1 1 0 0 0 0-2m4.414-14L10 27.414a2 2 0 0 1-2.828 0l-2.587-2.585a2 2 0 0 1 0-2.829L22 4.586a2 2 0 0 1 2.829 0l2.585 2.585a2 2 0 0 1 0 2.829M26 8.586 23.414 6l-4 4L22 12.586z" }) });
};
const ForwardRef$2a = forwardRef(SvgMagic);
const ForwardRef$2b = ForwardRef$2a;
const SvgMail = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28 6H4a1 1 0 0 0-1 1v17a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a1 1 0 0 0-1-1M12.339 16 5 22.726V9.274zm1.48 1.356 1.5 1.381a1 1 0 0 0 1.352 0l1.5-1.38L25.421 24H6.571zM19.66 16 27 9.273v13.455z" }) });
};
const ForwardRef$28 = forwardRef(SvgMail);
const ForwardRef$29 = ForwardRef$28;
const SvgManyToMany = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M11 7q0 .432-.088.838L16 10.382l5.088-2.544a4 4 0 1 1 .895 1.789L18.236 11.5l3.747 1.873a4 4 0 1 1 0 5.253L18.236 20.5l3.747 1.874a4 4 0 1 1-.895 1.788L16 21.618l-5.088 2.544Q11 24.567 11 25a4 4 0 1 1-.983-2.626l3.747-1.874-3.747-1.873a4 4 0 1 1 0-5.253l3.747-1.874-3.747-1.874A4 4 0 1 1 11 7M9 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0m2.236 8h9.528L16 12.618zM9 25a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-2-7a2 2 0 1 0 0-4 2 2 0 0 0 0 4M27 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-2 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4m2-11a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-11 3.382L20.764 17h-9.528z", clipRule: "evenodd" }) });
};
const ForwardRef$26 = forwardRef(SvgManyToMany);
const ForwardRef$27 = ForwardRef$26;
const SvgManyToOne = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M14.8 8.254a4 4 0 1 0-1.082 1.682l7.483 4.81a4 4 0 0 0-.075.254H10.874A4.002 4.002 0 0 0 3 16a4 4 0 0 0 7.874 1h10.252q.033.128.075.254l-7.484 4.81a4 4 0 1 0 1.082 1.682l7.484-4.81a4 4 0 1 0 0-5.871zM11 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4M9 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0m16 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4", clipRule: "evenodd" }) });
};
const ForwardRef$24 = forwardRef(SvgManyToOne);
const ForwardRef$25 = ForwardRef$24;
const SvgManyWays = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M18.842 3.227a1 1 0 1 0-.445 1.95l1.747.399L9.6 12.959a4 4 0 1 0 0 6.081l10.546 7.385-1.748.399a1 1 0 1 0 .445 1.95l3.945-.9a1 1 0 0 0 .77-1.1l-.503-4.014a1 1 0 0 0-1.985.248l.223 1.779-10.545-7.384a4 4 0 0 0 .127-.403h14.712l-1.293 1.293a1 1 0 1 0 1.414 1.414l3-3a1 1 0 0 0 0-1.414l-3-3a1 1 0 0 0-1.414 1.414L25.586 15H10.874a4 4 0 0 0-.127-.403l10.544-7.383-.222 1.778a1 1 0 0 0 1.984.249l.503-4.015a1 1 0 0 0-.77-1.099zM9 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0", clipRule: "evenodd" }) });
};
const ForwardRef$22 = forwardRef(SvgManyWays);
const ForwardRef$23 = ForwardRef$22;
const SvgMessage = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 6H5a2 2 0 0 0-2 2v20a1.98 1.98 0 0 0 1.156 1.813 1.986 1.986 0 0 0 2.141-.299L10.312 26H27a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2M10.5 17.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3" }) });
};
const ForwardRef$20 = forwardRef(SvgMessage);
const ForwardRef$21 = ForwardRef$20;
const SvgMicrophone = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M10 16V8a6 6 0 1 1 12 0v8a6 6 0 1 1-12 0m16 0a1 1 0 0 0-2 0 8 8 0 0 1-16 0 1 1 0 1 0-2 0 10.014 10.014 0 0 0 9 9.95V29a1 1 0 0 0 2 0v-3.05A10.014 10.014 0 0 0 26 16" }) });
};
const ForwardRef$1_ = forwardRef(SvgMicrophone);
const ForwardRef$1$ = ForwardRef$1_;
const SvgMinus = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 16a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5" }) });
};
forwardRef(SvgMinus);
const SvgMinusCircle = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m5 14H11a1 1 0 0 1 0-2h10a1 1 0 0 1 0 2" }) });
};
forwardRef(SvgMinusCircle);
const SvgMonitor = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26 5H6a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h20a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3M20 27h-8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2" }) });
};
const ForwardRef$1U = forwardRef(SvgMonitor);
const ForwardRef$1V = ForwardRef$1U;
const SvgMoon = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29.443 18.776a13.1 13.1 0 0 1-4.626 6.614A13 13 0 0 1 4 15a12.9 12.9 0 0 1 2.61-7.815 13.1 13.1 0 0 1 6.614-4.625 1 1 0 0 1 1.25 1.25 11.01 11.01 0 0 0 13.725 13.725 1 1 0 0 1 1.25 1.25z" }) });
};
const ForwardRef$1S = forwardRef(SvgMoon);
const ForwardRef$1T = ForwardRef$1S;
const SvgMore = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M18 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0M7.5 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4m17 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4" }) });
};
const ForwardRef$1Q = forwardRef(SvgMore);
const ForwardRef$1R = ForwardRef$1Q;
const SvgMove = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M10.939 8.061a1.5 1.5 0 0 1 0-2.125l4-4a1.5 1.5 0 0 1 2.125 0l4 4a1.503 1.503 0 1 1-2.125 2.125L17.5 6.625V12a1.5 1.5 0 1 1-3 0V6.625l-1.439 1.436a1.5 1.5 0 0 1-2.122 0m8 15.875L17.5 25.375V20a1.5 1.5 0 1 0-3 0v5.375l-1.439-1.44a1.504 1.504 0 0 0-2.125 2.125l4 4a1.5 1.5 0 0 0 2.125 0l4-4a1.502 1.502 0 1 0-2.125-2.125zm11.125-9-4-4a1.503 1.503 0 0 0-2.125 2.125l1.436 1.439H20a1.5 1.5 0 0 0 0 3h5.375l-1.44 1.439a1.503 1.503 0 0 0 2.125 2.125l4-4a1.5 1.5 0 0 0 .001-2.125zM6.625 17.5H12a1.5 1.5 0 1 0 0-3H6.625l1.44-1.439a1.503 1.503 0 1 0-2.125-2.125l-4 4a1.5 1.5 0 0 0 0 2.125l4 4a1.503 1.503 0 0 0 2.125-2.125z" }) });
};
forwardRef(SvgMove);
const SvgMusicNotes = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26.615 3.214a.99.99 0 0 0-.857-.183l-16 4a1 1 0 0 0-.758.97v13.762a4.5 4.5 0 1 0 2 3.737V13.781l14-3.5v7.482a4.5 4.5 0 1 0 2 3.737V4a1 1 0 0 0-.385-.786" }) });
};
const ForwardRef$1M = forwardRef(SvgMusicNotes);
const ForwardRef$1N = ForwardRef$1M;
const SvgNumberList = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 16a1.5 1.5 0 0 1-1.5 1.5H14.5a1.5 1.5 0 1 1 0-3H27a1.5 1.5 0 0 1 1.5 1.5m-14-6.5H27a1.5 1.5 0 0 0 0-3H14.5a1.5 1.5 0 0 0 0 3m12.5 13H14.5a1.5 1.5 0 1 0 0 3H27a1.5 1.5 0 1 0 0-3M5.5 7.414V13a1.5 1.5 0 0 0 3 0V5a1.5 1.5 0 0 0-2.17-1.341l-2 1a1.5 1.5 0 0 0 1.17 2.75zm4.966 12.107a3.46 3.46 0 0 0-1.4-2.329 3.61 3.61 0 0 0-4.954.683 3.5 3.5 0 0 0-.52.942 1.5 1.5 0 0 0 2.818 1.027.5.5 0 0 1 .072-.125.6.6 0 0 1 .813-.103.48.48 0 0 1 .201.325.45.45 0 0 1-.096.347l-.016.02-3.585 4.794A1.5 1.5 0 0 0 5 27.5h4a1.5 1.5 0 1 0 0-3H8l1.785-2.389a3.43 3.43 0 0 0 .681-2.59" }) });
};
const ForwardRef$1K = forwardRef(SvgNumberList);
const ForwardRef$1L = ForwardRef$1K;
const SvgOneToMany = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M17.2 8.254a4 4 0 1 1 1.082 1.682l-7.482 4.81q.04.125.074.254h10.252A4.002 4.002 0 0 1 29 16a4 4 0 0 1-7.874 1H10.874q-.033.128-.075.254l7.484 4.81a4 4 0 1 1-1.082 1.682l-7.484-4.81a4 4 0 1 1 0-5.871zM21 9a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4m2-11a2 2 0 1 0 4 0 2 2 0 0 0-4 0M7 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4", clipRule: "evenodd" }) });
};
const ForwardRef$1I = forwardRef(SvgOneToMany);
const ForwardRef$1J = ForwardRef$1I;
const SvgOneToOne = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10.874 17A4.002 4.002 0 0 1 3 16a4 4 0 0 1 7.874-1h10.252A4.002 4.002 0 0 1 29 16a4 4 0 0 1-7.874 1zM7 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4m18 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4", clipRule: "evenodd" }) });
};
const ForwardRef$1G = forwardRef(SvgOneToOne);
const ForwardRef$1H = ForwardRef$1G;
const SvgOneWay = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M28.924 16.384c-.05.12-.124.231-.217.324l-4 4a1 1 0 0 1-1.632-.324 1 1 0 0 1 .217-1.09L25.585 17H10.875A4.002 4.002 0 0 1 3 16a4 4 0 0 1 7.874-1h14.712l-2.294-2.293a1 1 0 0 1 1.415-1.415l4 4a1 1 0 0 1 .217 1.09M7 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4", clipRule: "evenodd" }) });
};
const ForwardRef$1E = forwardRef(SvgOneWay);
const ForwardRef$1F = ForwardRef$1E;
const SvgPaintBrush = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29 4a1 1 0 0 0-1-1c-5.51 0-11.164 6.214-14.304 10.329A7.5 7.5 0 0 0 4 20.5c0 3.86-2.443 5.591-2.559 5.671A1 1 0 0 0 2 28h9.5a7.5 7.5 0 0 0 7.171-9.696C22.788 15.164 29 9.51 29 4M15.553 14.194a48 48 0 0 1 1.26-1.569 9.5 9.5 0 0 1 2.562 2.561q-.738.618-1.569 1.262a7.6 7.6 0 0 0-2.254-2.254m5.337-.335a11.6 11.6 0 0 0-2.75-2.75c3.973-4.316 6.969-5.625 8.738-5.989-.357 1.77-1.672 4.766-5.988 8.739" }) });
};
const ForwardRef$1C = forwardRef(SvgPaintBrush);
const ForwardRef$1D = ForwardRef$1C;
const SvgPaintRoller = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M31 13v6.25a2.01 2.01 0 0 1-1.45 1.922L17 24.75V29a1 1 0 0 1-2 0v-4.25a2.01 2.01 0 0 1 1.45-1.922L29 19.25V13h-2v3a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3H2a1 1 0 0 1 0-2h2V8a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v3h2a2 2 0 0 1 2 2" }) });
};
forwardRef(SvgPaintRoller);
const SvgPalette = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M25.096 6.736A12.9 12.9 0 0 0 16 3h-.134A13 13 0 0 0 3 16c0 5.375 3.323 9.883 8.67 11.771A4 4 0 0 0 17 24a2 2 0 0 1 2-2h5.776a3.976 3.976 0 0 0 3.9-3.11c.224-.984.332-1.99.324-3a12.9 12.9 0 0 0-3.904-9.154M10.5 21a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5-3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3" }) });
};
forwardRef(SvgPalette);
const SvgPaperPlane = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.925 5.543v.018L21.65 29.554A1.985 1.985 0 0 1 19.728 31a1.98 1.98 0 0 1-1.803-1.144l-4.464-9.423a.5.5 0 0 1 .099-.568l7.158-7.159a1 1 0 0 0-1.414-1.413l-7.169 7.157a.5.5 0 0 1-.567.099l-9.376-4.441A2.05 2.05 0 0 1 1 12.17a1.99 1.99 0 0 1 1.446-1.815L26.44 3.08h.018a2 2 0 0 1 2.468 2.463" }) });
};
const ForwardRef$1w = forwardRef(SvgPaperPlane);
const ForwardRef$1x = ForwardRef$1w;
const SvgPaperclip = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m26.56 17.061-10.257 10.25a7.501 7.501 0 0 1-10.607-10.61l12.27-12.236a5 5 0 0 1 7.07 7.074l-.021.02L13.04 23.086a1.503 1.503 0 0 1-2.121-.041 1.5 1.5 0 0 1 .041-2.121L22.924 9.409a2 2 0 1 0-2.838-2.82L7.816 18.82a4.5 4.5 0 1 0 6.366 6.364l10.258-10.25a1.503 1.503 0 0 1 2.125 2.125z" }) });
};
const ForwardRef$1u = forwardRef(SvgPaperclip);
const ForwardRef$1v = ForwardRef$1u;
const SvgParagraph = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M3.5 8A1.5 1.5 0 0 1 5 6.5h22a1.5 1.5 0 0 1 0 3H5A1.5 1.5 0 0 1 3.5 8M5 14.5h16a1.5 1.5 0 1 0 0-3H5a1.5 1.5 0 1 0 0 3m22 2H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 1 0 0-3m-6 5H5a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3" }) });
};
const ForwardRef$1s = forwardRef(SvgParagraph);
const ForwardRef$1t = ForwardRef$1s;
const SvgPencil = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m28.414 9.171-5.585-5.586a2 2 0 0 0-2.829 0L4.586 19A1.98 1.98 0 0 0 4 20.414V26a2 2 0 0 0 2 2h5.586A1.98 1.98 0 0 0 13 27.414L28.414 12a2 2 0 0 0 0-2.829M24 13.585 18.414 8l3-3L27 10.585z" }) });
};
const ForwardRef$1q = forwardRef(SvgPencil);
const ForwardRef$1r = ForwardRef$1q;
const SvgPhone = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.985 21.885A7.03 7.03 0 0 1 22 28c-9.925 0-18-8.075-18-18a7.03 7.03 0 0 1 6.115-6.985 2 2 0 0 1 2.078 1.19l2.64 5.894v.015a2 2 0 0 1-.16 1.886 1 1 0 0 1-.07.096L12 15.181c.936 1.903 2.926 3.875 4.854 4.814l3.042-2.589q.045-.037.094-.07a2 2 0 0 1 1.896-.175l.017.008 5.888 2.639a2 2 0 0 1 1.194 2.077" }) });
};
const ForwardRef$1o = forwardRef(SvgPhone);
const ForwardRef$1p = ForwardRef$1o;
const SvgPin = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m29.416 13-6.683 6.706c.57 1.584.806 4.236-1.65 7.5a2 2 0 0 1-1.458.794h-.141a2 2 0 0 1-1.415-.586l-6.033-6.04-5.328 5.333a1 1 0 1 1-1.415-1.415l5.332-5.328-6.037-6.038a2 2 0 0 1 .162-2.972c3.178-2.564 6.219-2.06 7.55-1.643L19 2.587a2 2 0 0 1 2.829 0l7.586 7.585A2 2 0 0 1 29.416 13" }) });
};
const ForwardRef$1m = forwardRef(SvgPin);
const ForwardRef$1n = ForwardRef$1m;
const SvgPinMap = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 2A11.013 11.013 0 0 0 5 13c0 9.413 10 16.521 10.426 16.819a1 1 0 0 0 1.148 0C17 29.52 27 22.413 27 13A11.01 11.01 0 0 0 16 2m0 7a4 4 0 1 1 0 8 4 4 0 0 1 0-8" }) });
};
const ForwardRef$1k = forwardRef(SvgPinMap);
const ForwardRef$1l = ForwardRef$1k;
const SvgPlane = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30 17v4a1 1 0 0 1-1.196.98L19.5 20.125v2.966l2.207 2.206A1 1 0 0 1 22 26v3a1 1 0 0 1-1.375.929L16 28.078l-4.625 1.85A1 1 0 0 1 10 29v-3a1 1 0 0 1 .293-.707l2.207-2.207v-2.961L3.196 21.98A1 1 0 0 1 2 21v-4a1 1 0 0 1 .553-.895l9.947-4.972V5.5a3.5 3.5 0 1 1 7 0v5.633l9.948 4.972A1 1 0 0 1 30 17" }) });
};
const ForwardRef$1i = forwardRef(SvgPlane);
const ForwardRef$1j = ForwardRef$1i;
const SvgPlant = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M25.676 18.884a7.6 7.6 0 0 1-3.978 1.107 9 9 0 0 1-3.42-.707A6.94 6.94 0 0 0 17 23.314V27a1 1 0 0 1-1.066 1A1.023 1.023 0 0 1 15 26.969v-1.555l-4.828-4.828A6.6 6.6 0 0 1 7.93 21a5.73 5.73 0 0 1-2.99-.834C2.216 18.511.75 14.702 1.034 9.974a1 1 0 0 1 .94-.94c4.728-.28 8.537 1.182 10.187 3.906a5.75 5.75 0 0 1 .806 3.56.5.5 0 0 1-.86.304l-2.4-2.513a1 1 0 0 0-1.415 1.414l6.736 6.906q.01-.146.026-.291a8.57 8.57 0 0 1 2.33-4.933l6.323-6.682a1 1 0 0 0-1.413-1.415l-6.125 6.477a.5.5 0 0 1-.848-.217c-.592-2.185-.331-4.36.8-6.228 2.233-3.685 7.428-5.657 13.898-5.277a1 1 0 0 1 .94.94c.375 6.471-1.598 11.666-5.283 13.899" }) });
};
const ForwardRef$1g = forwardRef(SvgPlant);
const ForwardRef$1h = ForwardRef$1g;
const SvgPlay = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30 16a1.97 1.97 0 0 1-.95 1.689L11.04 28.706a2 2 0 0 1-2.767-.688A2 2 0 0 1 8 27.016V4.984a1.98 1.98 0 0 1 1.015-1.728 2 2 0 0 1 2.025.038L29.05 14.31A1.97 1.97 0 0 1 30 16" }) });
};
const ForwardRef$1e = forwardRef(SvgPlay);
const ForwardRef$1f = ForwardRef$1e;
const SvgPlus = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 16a1.5 1.5 0 0 1-1.5 1.5h-9.5V27a1.5 1.5 0 1 1-3 0v-9.5H5a1.5 1.5 0 1 1 0-3h9.5V5a1.5 1.5 0 1 1 3 0v9.5H27a1.5 1.5 0 0 1 1.5 1.5" }) });
};
const ForwardRef$1c = forwardRef(SvgPlus);
const ForwardRef$1d = ForwardRef$1c;
const SvgPlusCircle = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.016 13.016 0 0 0 16 3m5 14h-4v4a1 1 0 0 1-2 0v-4h-4a1 1 0 0 1 0-2h4v-4a1 1 0 0 1 2 0v4h4a1 1 0 0 1 0 2" }) });
};
const ForwardRef$1a = forwardRef(SvgPlusCircle);
const ForwardRef$1b = ForwardRef$1a;
const SvgPresentationChart = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 5H17V3a1 1 0 0 0-2 0v2H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h4.92l-2.701 3.375a1 1 0 0 0 1.562 1.25L12.48 24h7.04l3.699 4.625a1 1 0 1 0 1.562-1.25L22.08 24H27a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M13 18a1 1 0 0 1-2 0v-3a1 1 0 0 1 2 0zm4 0a1 1 0 0 1-2 0v-5a1 1 0 0 1 2 0zm4 0a1 1 0 0 1-2 0v-7a1 1 0 0 1 2 0z" }) });
};
const ForwardRef$18 = forwardRef(SvgPresentationChart);
const ForwardRef$19 = ForwardRef$18;
const SvgPriceTag = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M30.414 17 18 4.586A1.98 1.98 0 0 0 16.586 4H5a1 1 0 0 0-1 1v11.586A1.98 1.98 0 0 0 4.586 18L17 30.414a2 2 0 0 0 2.829 0l10.585-10.585a2 2 0 0 0 0-2.829M10.5 12a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3" }) });
};
const ForwardRef$16 = forwardRef(SvgPriceTag);
const ForwardRef$17 = ForwardRef$16;
const SvgPuzzlePiece = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M20.723 28H26a2 2 0 0 0 2-2v-4.706a1 1 0 0 0-1.383-.919 2.9 2.9 0 0 1-1.117.221c-1.654 0-3-1.387-3-3.091s1.346-3.091 3-3.091c.383 0 .763.075 1.117.221A1 1 0 0 0 28 13.706V9a2 2 0 0 0-2-2h-4.527a4.5 4.5 0 1 0-8.945 0H8a2 2 0 0 0-2 2v4.028a4.5 4.5 0 1 0 0 8.945V26a2 2 0 0 0 2 2h5.278" }) });
};
const ForwardRef$14 = forwardRef(SvgPuzzlePiece);
const ForwardRef$15 = ForwardRef$14;
const SvgQuestion = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M18 22.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0M29.5 16A13.5 13.5 0 1 1 16 2.5 13.515 13.515 0 0 1 29.5 16m-3 0A10.5 10.5 0 1 0 16 26.5 10.51 10.51 0 0 0 26.5 16M16 8c-3.033 0-5.5 2.242-5.5 5v.5a1.5 1.5 0 1 0 3 0V13c0-1.102 1.125-2 2.5-2s2.5.898 2.5 2-1.125 2-2.5 2a1.5 1.5 0 0 0-1.5 1.5v1a1.5 1.5 0 0 0 2.966.32C19.79 17.235 21.5 15.296 21.5 13c0-2.758-2.468-5-5.5-5" }) });
};
const ForwardRef$12$1 = forwardRef(SvgQuestion);
const ForwardRef$13$1 = ForwardRef$12$1;
const SvgQuotes = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M14.5 9v11a6.006 6.006 0 0 1-6 6 1 1 0 0 1 0-2 4 4 0 0 0 4-4v-1H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h7.5a2 2 0 0 1 2 2M27 7h-7.5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2H27v1a4 4 0 0 1-4 4 1 1 0 0 0 0 2 6.006 6.006 0 0 0 6-6V9a2 2 0 0 0-2-2" }) });
};
const ForwardRef$10$1 = forwardRef(SvgQuotes);
const ForwardRef$11$1 = ForwardRef$10$1;
const SvgRestaurant = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 5v23a1 1 0 0 1-2 0v-6h-6a1 1 0 0 1-1-1c.046-2.395.349-4.779.902-7.11 1.223-5.061 3.54-8.454 6.704-9.809a1 1 0 0 1 1.394.92m-12.014-.164a.999.999 0 1 0-1.972.33L13.986 11H11V5a1 1 0 0 0-2 0v6H6.014l.972-5.835a1 1 0 1 0-1.972-.329l-1 6A1 1 0 0 0 4 11a6.01 6.01 0 0 0 5 5.915V28a1 1 0 1 0 2 0V16.915A6.01 6.01 0 0 0 16 11q0-.083-.014-.164z" }) });
};
const ForwardRef$_ = forwardRef(SvgRestaurant);
const ForwardRef$$ = ForwardRef$_;
const SvgRocket = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M19 28a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 1 1m8.953-8.521-1.546 6.954a2 2 0 0 1-3.188 1.138l-3.405-2.57h-7.625L8.78 27.57a2 2 0 0 1-3.189-1.138l-1.545-6.954a2.01 2.01 0 0 1 .415-1.714l3.57-4.282c.12-1.574.482-3.12 1.072-4.584 1.612-4.043 4.5-6.579 5.671-7.481a2 2 0 0 1 2.45 0c1.167.902 4.059 3.438 5.671 7.48.59 1.465.952 3.01 1.072 4.585l3.57 4.282a2.01 2.01 0 0 1 .415 1.714m-17.404 4.25q-2.014-3.666-2.445-7.209L6 19.045 7.545 26l.022-.016zM17.5 12.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m8.5 6.545-2.104-2.525q-.428 3.535-2.445 7.211l2.982 2.25.022.017z" }) });
};
const ForwardRef$Y = forwardRef(SvgRocket);
const ForwardRef$Z = ForwardRef$Y;
const SvgScissors = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M19.716 14.141a1 1 0 0 1 .261-1.391l8.458-5.788a1 1 0 0 1 1.125 1.652L21.101 14.4a1 1 0 0 1-1.39-.261zm10.109 10.634a1 1 0 0 1-1.39.261L17 17.211l-5.315 3.636a4.5 4.5 0 1 1-1.125-1.65L15.229 16l-4.673-3.198a4.5 4.5 0 1 1 1.125-1.65l17.875 12.233a1 1 0 0 1 .269 1.39M9 22.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m0-13a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0" }) });
};
const ForwardRef$W$1 = forwardRef(SvgScissors);
const ForwardRef$X$1 = ForwardRef$W$1;
const SvgSearch = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29.061 26.939 23.125 21A11.515 11.515 0 1 0 21 23.125l5.941 5.942a1.503 1.503 0 0 0 2.125-2.125zM5.5 14a8.5 8.5 0 1 1 8.5 8.5A8.51 8.51 0 0 1 5.5 14" }) });
};
const ForwardRef$U$1 = forwardRef(SvgSearch);
const ForwardRef$V$1 = ForwardRef$U$1;
const SvgServer = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26 5H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M26 17H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2m-3.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3" }) });
};
const ForwardRef$S = forwardRef(SvgServer);
const ForwardRef$T = ForwardRef$S;
const SvgShield = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28 7v7.346c0 11.202-9.477 14.918-11.375 15.549a1.94 1.94 0 0 1-1.25 0C13.475 29.264 4 25.548 4 14.346V7a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2" }) });
};
const ForwardRef$Q = forwardRef(SvgShield);
const ForwardRef$R = ForwardRef$Q;
const SvgShirt = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m30.949 7.653-6.47-3.528A1 1 0 0 0 24 4h-4a1 1 0 0 0-1 1 3 3 0 0 1-6 0 1 1 0 0 0-1-1H8a1 1 0 0 0-.48.125L1.051 7.653a1.97 1.97 0 0 0-.824 2.657l2.41 4.601A2.05 2.05 0 0 0 4.458 16H7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V16h2.543a2.05 2.05 0 0 0 1.822-1.089l2.409-4.601a1.97 1.97 0 0 0-.825-2.658M4.459 14a.08.08 0 0 1-.051-.016L2.01 9.408 7 6.685V14zm23.134-.018a.07.07 0 0 1-.052.018H25V6.685l4.99 2.723z" }) });
};
const ForwardRef$O$1 = forwardRef(SvgShirt);
const ForwardRef$P$1 = ForwardRef$O$1;
const SvgShoppingCart = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M12 27a2 2 0 1 1-4 0 2 2 0 0 1 4 0m11-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4m5.805-16.594A1 1 0 0 0 28 8H6.04L5.026 4.45A2.01 2.01 0 0 0 3.103 3H1a1 1 0 0 0 0 2h2.103l4.522 15.824A3.01 3.01 0 0 0 10.509 23h12.014a2.99 2.99 0 0 0 2.867-2.117l3.566-11.59a1 1 0 0 0-.151-.887" }) });
};
const ForwardRef$M$1 = forwardRef(SvgShoppingCart);
const ForwardRef$N$1 = ForwardRef$M$1;
const SvgSignOut = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M14.5 27a1.5 1.5 0 0 1-1.5 1.5H6A2.5 2.5 0 0 1 3.5 26V6A2.5 2.5 0 0 1 6 3.5h7a1.5 1.5 0 0 1 0 3H6.5v19H13a1.5 1.5 0 0 1 1.5 1.5m13.561-12.061-5-5a1.503 1.503 0 0 0-2.125 2.125l2.439 2.436H13a1.5 1.5 0 1 0 0 3h10.375l-2.44 2.439a1.503 1.503 0 0 0 2.125 2.125l5-5a1.5 1.5 0 0 0 .001-2.125" }) });
};
const ForwardRef$K = forwardRef(SvgSignOut);
const ForwardRef$L = ForwardRef$K;
const SvgSlidersHorizontal = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M4 10a1 1 0 0 1 1-1h4.646a3.5 3.5 0 0 1 6.708 0H27a1 1 0 1 1 0 2H16.354a3.5 3.5 0 0 1-6.708 0H5a1 1 0 0 1-1-1m23 11h-2.646a3.5 3.5 0 0 0-6.708 0H5a1 1 0 0 0 0 2h12.646a3.5 3.5 0 0 0 6.708 0H27a1 1 0 1 0 0-2" }) });
};
forwardRef(SvgSlidersHorizontal);
const SvgSparkle = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M26 18a1.97 1.97 0 0 1-1.302 1.867l-6.457 2.375-2.375 6.452a1.99 1.99 0 0 1-3.735 0L9.75 22.25l-6.452-2.375a1.99 1.99 0 0 1 0-3.735l6.456-2.375 2.375-6.451a1.99 1.99 0 0 1 3.735 0l2.375 6.456 6.451 2.375A1.97 1.97 0 0 1 26 18M19 6h2v2a1 1 0 0 0 2 0V6h2a1 1 0 1 0 0-2h-2V2a1 1 0 1 0-2 0v2h-2a1 1 0 1 0 0 2m11 4h-1V9a1 1 0 1 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 0 0 2 0v-1h1a1 1 0 0 0 0-2" }) });
};
forwardRef(SvgSparkle);
const SvgSquaresFour = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M15 7v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2m10-2h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M13 17H7a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2m12 0h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2" }) });
};
const ForwardRef$E = forwardRef(SvgSquaresFour);
const ForwardRef$F = ForwardRef$E;
const SvgStack = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: [
/* @__PURE__ */ jsx("path", { d: "M27.5 21.136 16 27.843 4.5 21.136a1 1 0 0 0-1 1.728l12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 1 0-1.008-1.728" }),
/* @__PURE__ */ jsx("path", { d: "M27.5 15.136 16 21.843 4.5 15.136a1 1 0 0 0-1 1.728l12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 1 0-1.008-1.728" }),
/* @__PURE__ */ jsx("path", { d: "m3.5 10.864 12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 0 0 0-1.728l-12-7a1 1 0 0 0-1.008 0l-12 7a1 1 0 0 0 0 1.728" })
] });
};
const ForwardRef$C$1 = forwardRef(SvgStack);
const ForwardRef$D$1 = ForwardRef$C$1;
const SvgStar = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m29.313 14.298-5.638 4.92 1.689 7.325a2 2 0 0 1-2.98 2.167l-6.389-3.875L9.62 28.71a2 2 0 0 1-2.98-2.168l1.686-7.317-5.638-4.928a2 2 0 0 1 1.138-3.507l7.433-.644 2.901-6.92a1.994 1.994 0 0 1 3.68 0l2.91 6.92 7.43.644a2 2 0 0 1 1.139 3.508z" }) });
};
const ForwardRef$A = forwardRef(SvgStar);
const ForwardRef$B = ForwardRef$A;
const SvgStethoscope = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29 19a4 4 0 1 0-4.991 3.875A1 1 0 0 0 24 23a4 4 0 0 1-4 4h-3a4 4 0 0 1-4-4v-5.065c3.934-.5 7-3.934 7-8.039V5a2 2 0 0 0-2-2h-2a1 1 0 1 0 0 2h2v4.896c0 3.323-2.656 6.061-5.92 6.104A6 6 0 0 1 6 10V5h2a1 1 0 0 0 0-2H6a2 2 0 0 0-2 2v5a8 8 0 0 0 7 7.936V23a6.006 6.006 0 0 0 6 6h3a6.006 6.006 0 0 0 6-6 1 1 0 0 0-.009-.125A4 4 0 0 0 29 19m-4 1a1 1 0 1 1 0-2 1 1 0 0 1 0 2" }) });
};
const ForwardRef$y = forwardRef(SvgStethoscope);
const ForwardRef$z = ForwardRef$y;
const SvgStore = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29 12a1 1 0 0 0-.038-.275L27.17 5.45A2.01 2.01 0 0 0 25.25 4H6.75a2.01 2.01 0 0 0-1.919 1.45L3.04 11.725A1 1 0 0 0 3 12v2a5 5 0 0 0 2 4v8a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2v-8a5 5 0 0 0 2-4zm-18 2a3 3 0 0 1-4.39 2.657 1 1 0 0 0-.228-.132A3 3 0 0 1 5 14v-1h6zm8 0a3 3 0 0 1-6 0v-1h6zm8 0a3 3 0 0 1-1.384 2.525q-.12.051-.225.131A3 3 0 0 1 21 14v-1h6z" }) });
};
const ForwardRef$w = forwardRef(SvgStore);
const ForwardRef$x = ForwardRef$w;
const SvgStrikeThrough = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 16a1.5 1.5 0 0 1-1.5 1.5h-3.767A5.19 5.19 0 0 1 24.5 21c0 1.806-.976 3.54-2.679 4.756C20.25 26.881 18.18 27.5 16 27.5s-4.25-.619-5.821-1.744C8.476 24.54 7.5 22.806 7.5 21a1.5 1.5 0 0 1 3 0c0 1.898 2.519 3.5 5.5 3.5s5.5-1.602 5.5-3.5c0-1.595-1.163-2.523-4.419-3.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5M9.389 12.5a1.5 1.5 0 0 0 1.5-1.5c0-2 2.197-3.5 5.111-3.5 2.17 0 3.921.831 4.685 2.223a1.5 1.5 0 0 0 2.625-1.446C22.016 5.914 19.281 4.5 16 4.5c-4.625 0-8.111 2.794-8.111 6.5a1.5 1.5 0 0 0 1.5 1.5" }) });
};
const ForwardRef$u = forwardRef(SvgStrikeThrough);
const ForwardRef$v = ForwardRef$u;
const SvgSun = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M15 5V2a1 1 0 0 1 2 0v3a1 1 0 0 1-2 0m1 3a8 8 0 1 0 8 8 8.01 8.01 0 0 0-8-8m-8.707.707a1 1 0 1 0 1.414-1.415l-2-2a1 1 0 1 0-1.414 1.415zm0 14.586-2 2a1 1 0 1 0 1.414 1.415l2-2a1 1 0 1 0-1.415-1.415M24 9a1 1 0 0 0 .707-.293l2-2a1 1 0 0 0-1.415-1.414l-2 2A1 1 0 0 0 24 9m.707 14.293a1 1 0 1 0-1.415 1.415l2 2a1 1 0 0 0 1.415-1.415zM6 16a1 1 0 0 0-1-1H2a1 1 0 0 0 0 2h3a1 1 0 0 0 1-1m10 10a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0v-3a1 1 0 0 0-1-1m14-11h-3a1 1 0 0 0 0 2h3a1 1 0 0 0 0-2" }) });
};
const ForwardRef$s = forwardRef(SvgSun);
const ForwardRef$t = ForwardRef$s;
const SvgTelevision = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 8h-8.586l4.293-4.292a1 1 0 0 0-1.415-1.415L16 7.586l-5.292-5.293a1 1 0 1 0-1.415 1.415L13.586 8H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2m0 17h-7V10h7zm-2-10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0 6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" }) });
};
const ForwardRef$q$1 = forwardRef(SvgTelevision);
const ForwardRef$r$1 = ForwardRef$q$1;
const SvgThumbDown = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m29.978 19.625-1.5-12A3 3 0 0 0 25.5 5H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h5.383l4.722 9.448A1 1 0 0 0 15 30a5 5 0 0 0 5-5v-2h7a3 3 0 0 0 2.977-3.375M9 18H4V7h5z" }) });
};
const ForwardRef$o = forwardRef(SvgThumbDown);
const ForwardRef$p = ForwardRef$o;
const SvgThumbUp = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M29.25 10.015A3 3 0 0 0 27 9h-7V7a5 5 0 0 0-5-5 1 1 0 0 0-.895.553L9.383 12H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h21.5a3 3 0 0 0 2.977-2.625l1.5-12a3 3 0 0 0-.727-2.36M4 14h5v11H4z" }) });
};
const ForwardRef$m$1 = forwardRef(SvgThumbUp);
const ForwardRef$n$1 = ForwardRef$m$1;
const SvgTrain = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M23 3H9a4 4 0 0 0-4 4v16a4 4 0 0 0 4 4h1l-1.8 2.4a1 1 0 0 0 1.6 1.2l2.7-3.6h7l2.7 3.6a1 1 0 0 0 1.6-1.2L22 27h1a4 4 0 0 0 4-4V7a4 4 0 0 0-4-4M10.5 23a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m4.5-8H7v-5h8zm6.5 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m3.5-8h-8v-5h8z" }) });
};
const ForwardRef$k$1 = forwardRef(SvgTrain);
const ForwardRef$l$1 = ForwardRef$k$1;
const SvgTrash = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M27 6h-5V5a3 3 0 0 0-3-3h-6a3 3 0 0 0-3 3v1H5a1 1 0 0 0 0 2h1v18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h1a1 1 0 1 0 0-2M14 21a1 1 0 0 1-2 0v-8a1 1 0 0 1 2 0zm6 0a1 1 0 0 1-2 0v-8a1 1 0 0 1 2 0zm0-15h-8V5a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1z" }) });
};
const ForwardRef$i$1 = forwardRef(SvgTrash);
const ForwardRef$j$1 = ForwardRef$i$1;
const SvgTyphoon = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m23.54 2.267-3.711 3.377c1.7.52 3.298 1.397 4.653 2.631 4.684 4.266 4.684 11.184 0 15.45q-5.184 4.72-16.021 6.008l3.71-3.377a12.2 12.2 0 0 1-4.653-2.63c-4.684-4.267-4.712-11.16 0-15.45q5.184-4.721 16.021-6.01m-7.54 8.4c-3.314 0-6 2.388-6 5.333s2.686 5.333 6 5.333 6-2.387 6-5.333c0-2.945-2.686-5.333-6-5.333" }) });
};
const ForwardRef$g$1 = forwardRef(SvgTyphoon);
const ForwardRef$h$1 = ForwardRef$g$1;
const SvgUnderline = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M25.5 28a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 1 1 0-3h16a1.5 1.5 0 0 1 1.5 1.5M16 24.5a8.51 8.51 0 0 0 8.5-8.5V7a1.5 1.5 0 1 0-3 0v9a5.5 5.5 0 0 1-11 0V7a1.5 1.5 0 1 0-3 0v9a8.51 8.51 0 0 0 8.5 8.5" }) });
};
const ForwardRef$e = forwardRef(SvgUnderline);
const ForwardRef$f = ForwardRef$e;
const SvgUpload = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.5 19v7a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 26v-7a1.5 1.5 0 0 1 3 0v6.5h19V19a1.5 1.5 0 1 1 3 0m-16.439-7.939L14.5 8.625V19a1.5 1.5 0 1 0 3 0V8.625l2.439 2.44a1.503 1.503 0 0 0 2.125-2.125l-5-5a1.5 1.5 0 0 0-2.125 0l-5 5a1.503 1.503 0 1 0 2.125 2.125z" }) });
};
forwardRef(SvgUpload);
const SvgUser = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M28.866 27.5A1 1 0 0 1 28 28H4a1 1 0 0 1-.865-1.5c1.904-3.291 4.838-5.651 8.261-6.77a9 9 0 1 1 9.208 0c3.424 1.119 6.357 3.479 8.261 6.77a1 1 0 0 1 .001 1" }) });
};
const ForwardRef$a$1 = forwardRef(SvgUser);
const ForwardRef$b$1 = ForwardRef$a$1;
const SvgVolumeMute = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M19.44 3.101a1 1 0 0 0-1.054.11L9.656 10H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h5.656l8.73 6.789A1 1 0 0 0 20 28V4a1 1 0 0 0-.56-.899M28.414 16l2.293-2.292a1.001 1.001 0 0 0-1.415-1.415L27 14.586l-2.293-2.293a1 1 0 1 0-1.415 1.415L25.587 16l-2.293 2.293a1 1 0 0 0 1.415 1.415L27 17.414l2.293 2.294a1 1 0 0 0 1.415-1.415z" }) });
};
const ForwardRef$8 = forwardRef(SvgVolumeMute);
const ForwardRef$9 = ForwardRef$8;
const SvgVolumeUp = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M19.439 3.101a1 1 0 0 0-1.053.11L9.656 10H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h5.656l8.73 6.789A1.001 1.001 0 0 0 20 28V4a1 1 0 0 0-.561-.899M9 20H4v-8h5zm15.75-7.305a5 5 0 0 1 0 6.61 1 1 0 0 1-1.5-1.322 3 3 0 0 0 0-3.966 1 1 0 0 1 1.5-1.322M31 16a10 10 0 0 1-2.546 6.668 1 1 0 0 1-1.49-1.334 8 8 0 0 0 0-10.666.998.998 0 0 1 .407-1.624 1 1 0 0 1 1.083.29A9.98 9.98 0 0 1 31 16" }) });
};
const ForwardRef$6 = forwardRef(SvgVolumeUp);
const ForwardRef$7 = ForwardRef$6;
const SvgWalk = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M15 6a4 4 0 1 1 8 0 4 4 0 0 1-8 0m11 11c-3.58 0-5.226-1.662-6.969-3.421a25 25 0 0 0-1.375-1.323C13.031 8.24 5.63 15.098 5.316 15.391a1 1 0 0 0 1.369 1.458 20.5 20.5 0 0 1 3.815-2.724c1.723-.922 3.174-1.279 4.338-1.072L8.082 28.6a1 1 0 0 0 1.835.798l4.2-9.659L18 22.515V29a1 1 0 1 0 2 0v-7a1 1 0 0 0-.419-.814l-4.65-3.321L16.61 14c.33.305.657.634 1 .98C19.381 16.774 21.586 19 26 19a1 1 0 0 0 0-2" }) });
};
const ForwardRef$4$1 = forwardRef(SvgWalk);
const ForwardRef$5$1 = ForwardRef$4$1;
const SvgWarningCircle = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-1 7a1 1 0 0 1 2 0v7a1 1 0 0 1-2 0zm1 13a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3" }) });
};
const ForwardRef$2$1 = forwardRef(SvgWarningCircle);
const ForwardRef$3$1 = ForwardRef$2$1;
const SvgWheelchair = ({
fill: fillProp = "currentColor",
stroke: strokeProp,
...props
}, ref) => {
const {
colors
} = useTheme();
const fill = fillProp && fillProp in colors ? colors[fillProp] : fillProp;
const stroke = strokeProp && strokeProp in colors ? colors[strokeProp] : strokeProp;
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, fill, stroke, ref, ...props, children: /* @__PURE__ */ jsx("path", { d: "m31.316 24.949-3 1a1 1 0 0 1-1.211-.5l-3.724-7.45H13a1 1 0 0 1-1-1v-3.707A7 7 0 0 0 14 27c3.239 0 6.261-2.256 7.031-5.25a1 1 0 1 1 1.938.5C21.96 26.162 18.19 29 14 29a9 9 0 0 1-2-17.774V8.851a3.5 3.5 0 1 1 2 0V11h7a1 1 0 0 1 0 2h-7v3h10a1 1 0 0 1 .894.552l3.612 7.225 2.178-.726a1 1 0 1 1 .632 1.898" }) });
};
const ForwardRef$c = forwardRef(SvgWheelchair);
const ForwardRef$1$1 = ForwardRef$c;
const PLUGIN_ID$1 = "preview-button";
const PLUGIN_NAME = "Preview Button";
const ACTION_RESOLVE_CONFIG = `${PLUGIN_ID$1}/resolve-config`;
const HOOK_BEFORE_BUILD_URL = `plugin/${PLUGIN_ID$1}/before-build-url`;
const PREVIEW_WINDOW_NAME = "StrapiPreview";
const interpolate = (originalStr, data = {}) => {
let str = originalStr;
Object.entries(data).forEach(([key, value]) => {
str = str.replace(new RegExp(`{${key}}`, "g"), value);
});
str = str.replace(new RegExp(`{(.*)}`, "g"), "").trim();
return str;
};
const trimSlashes = (str) => str.replace(/^\/|\/$/g, "").trim();
const parseUrl = (config, data) => {
if (!config || !data) {
return "";
}
const supportedTypes = ["number", "string"];
const replacements = Object.entries(data).reduce((acc, [key, val]) => {
if (!supportedTypes.includes(typeof val)) {
return acc;
}
return {
...acc,
[key]: val
};
}, {});
const params = Object.entries(config?.query ?? {}).reduce((acc, [key, val]) => {
return {
...acc,
[key]: encodeURIComponent(interpolate(val, replacements))
};
}, {});
const url = encodeURI(interpolate(trimSlashes(config.url), replacements));
const query = qs.stringify(params, {
addQueryPrefix: true,
/**
* @NOTE - Disabling the `encoding` option here because we are already
* handling it in `replacements` and for some reason, tests are failing
* because qs mistakenly double-encodes params, but only during tests.
*/
encode: false
});
return `${url}${query}`;
};
const defaultRequiredConfig = {
copy: true,
openTarget: PREVIEW_WINDOW_NAME,
url: ""
};
const getPublishStateConfig = (config, data) => ({
...defaultRequiredConfig,
...config,
url: parseUrl(config, data)
});
const getTrad = (id) => `${PLUGIN_ID$1}.${id}`;
const prefixPluginTranslations = (trad) => {
return Object.keys(trad).reduce((acc, current) => {
acc[`${PLUGIN_ID$1}.${current}`] = trad[current];
return acc;
}, {});
};
const ButtonStyled = styled(Button)`
width: 100%;
`;
const CopyLinkButton = ({ isDraft: isDraft2, url }) => {
const { formatMessage } = useIntl();
const { toggleNotification } = useNotification$1();
const handleOnCopy = useCallback(() => {
toggleNotification({
type: "success",
message: formatMessage({
id: "notification.success.link-copied",
defaultMessage: "Link copied to the clipboard"
})
});
}, [formatMessage, toggleNotification]);
return /* @__PURE__ */ jsx(CopyToClipboard, { text: url, onCopy: handleOnCopy, children: /* @__PURE__ */ jsx(ButtonStyled, { size: "S", startIcon: /* @__PURE__ */ jsx(ForwardRef$2l, {}), variant: "secondary", children: formatMessage(
isDraft2 ? {
id: getTrad("form.button.copy-link.draft"),
defaultMessage: "Copy preview link"
} : {
id: getTrad("form.button.copy-link"),
defaultMessage: "Copy link"
}
) }) });
};
const CopyLinkButton$1 = memo(CopyLinkButton);
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
function getAugmentedNamespace(n) {
if (n.__esModule) return n;
var f2 = n.default;
if (typeof f2 == "function") {
var a2 = function a3() {
if (this instanceof a3) {
return Reflect.construct(f2, arguments, this.constructor);
}
return f2.apply(this, arguments);
};
a2.prototype = f2.prototype;
} else a2 = {};
Object.defineProperty(a2, "__esModule", { value: true });
Object.keys(n).forEach(function(k) {
var d2 = Object.getOwnPropertyDescriptor(n, k);
Object.defineProperty(a2, k, d2.get ? d2 : {
enumerable: true,
get: function() {
return n[k];
}
});
});
return a2;
}
const SvgBlocksField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#EAF5FF", stroke: "#B8E1FF", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#0C75AF",
d: "M14.75 11.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3.5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2M13.75 15a1 1 0 1 0 0 2 1 1 0 0 0 0-2m4.5 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2m-4.5 4.25a1 1 0 1 0 0 2 1 1 0 0 0 0-2m4.5 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2"
}
)
] });
const ForwardRef$12 = forwardRef(SvgBlocksField);
const ForwardRef$13 = ForwardRef$12;
const SvgBooleanField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#EAFBE7", stroke: "#C6F0C2", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#328048",
d: "M19 11.5h-6a4.5 4.5 0 1 0 0 9h6a4.5 4.5 0 1 0 0-9m0 7a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5"
}
)
] });
const ForwardRef$10 = forwardRef(SvgBooleanField);
const ForwardRef$11 = ForwardRef$10;
const SvgCodeSquare = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("path", { fill: "#D9822F", d: "M0 4a4 4 0 0 1 4-4h24a4 4 0 0 1 4 4v24a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4z" }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
d: "M17.143 18.659v2.912l6.856-3.878v-2.815L17.143 11v2.906l4.16 2.38zm-2.287 0-4.16-2.374 4.16-2.38V11L8 14.877v2.816l6.856 3.878z",
clipRule: "evenodd"
}
)
] });
forwardRef(SvgCodeSquare);
const SvgCollectionType = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#4945FF", stroke: "#4945FF", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
d: "M14.328 14.54v-.083c-.04-.937-.75-1.559-1.787-1.559-1.535 0-2.725 1.57-2.725 3.65 0 1.302.71 2.104 1.846 2.104.961 0 1.787-.545 2.063-1.37h1.752c-.37 1.78-1.922 2.935-3.967 2.935-2.121 0-3.504-1.395-3.504-3.545 0-3.123 1.951-5.344 4.646-5.344 1.94 0 3.41 1.283 3.41 2.96 0 .087 0 .163-.011.251zM20.053 20H18.27l1.489-6.943h-2.532l.311-1.512h6.844l-.31 1.512H21.54z"
}
)
] });
forwardRef(SvgCollectionType);
const SvgComponentField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#F6F6F9", stroke: "#DCDCE4", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#666687",
d: "M20.5 17.5c-.358 0-.71.085-1.029.25l-1.337-1.04q.11-.326.116-.67l.647-.214a2.25 2.25 0 1 0-.637-1.37l-.486.162A2.25 2.25 0 0 0 16 13.75c-.062 0-.117 0-.176.008l-.278-.625A2.25 2.25 0 1 0 14 13.75c.063 0 .117 0 .176-.008l.278.625a2.24 2.24 0 0 0-.537 2.482l-1.33 1.182a2.25 2.25 0 1 0 .996 1.12l1.33-1.182a2.25 2.25 0 0 0 2.3-.075l1.224.954A2.25 2.25 0 1 0 20.5 17.5m0-4a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-7.25-2a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0m-1.75 9.25a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5M15.25 16a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0m5.25 4.5a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5"
}
)
] });
const ForwardRef$W = forwardRef(SvgComponentField);
const ForwardRef$X = ForwardRef$W;
const SvgDateField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#FDF4DC", stroke: "#FAE7B9", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#D9822F",
d: "M21 10h-1.5v-.5a.5.5 0 0 0-1 0v.5h-5v-.5a.5.5 0 0 0-1 0v.5H11a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V11a1 1 0 0 0-1-1m0 3H11v-2h1.5v.5a.5.5 0 0 0 1 0V11h5v.5a.5.5 0 0 0 1 0V11H21z"
}
)
] });
const ForwardRef$U = forwardRef(SvgDateField);
const ForwardRef$V = ForwardRef$U;
const SvgDiscord = (props, ref) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: /* @__PURE__ */ jsx(
"path",
{
fill: "#5865F2",
d: "M27.107 5.911a26.5 26.5 0 0 0-6.602-2.031 18 18 0 0 0-.845 1.72 24.6 24.6 0 0 0-7.327 0 18 18 0 0 0-.846-1.72A26.7 26.7 0 0 0 4.88 5.916C.702 12.098-.43 18.126.136 24.068a26.6 26.6 0 0 0 8.097 4.065 19.6 19.6 0 0 0 1.734-2.796c-.947-.354-1.86-.79-2.73-1.304.228-.166.452-.337.669-.504a19.02 19.02 0 0 0 16.188 0q.33.271.67.504c-.872.515-1.788.952-2.736 1.306a19.4 19.4 0 0 0 1.734 2.794 26.5 26.5 0 0 0 8.102-4.062c.665-6.892-1.135-12.864-4.757-18.16M10.684 20.414c-1.578 0-2.882-1.433-2.882-3.194 0-1.762 1.259-3.207 2.877-3.207 1.619 0 2.912 1.445 2.885 3.207s-1.271 3.194-2.88 3.194m10.632 0c-1.581 0-2.88-1.433-2.88-3.194 0-1.762 1.259-3.207 2.88-3.207s2.904 1.445 2.877 3.207-1.269 3.194-2.877 3.194"
}
) });
forwardRef(SvgDiscord);
const SvgDiscourse = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx(
"path",
{
fill: "#231F20",
d: "M15.659.302C7.158.302 0 7.194 0 15.698v15.943l15.656-.015c8.501 0 15.396-7.158 15.396-15.66 0-8.5-6.901-15.664-15.393-15.664"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#FFF9AE",
d: "M15.81 6.261a9.546 9.546 0 0 0-8.39 14.09l-1.726 5.554 6.2-1.4A9.541 9.541 0 1 0 15.82 6.26z"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#00AEEF",
d: "M23.381 9.999a9.54 9.54 0 0 1-11.487 14.49l-6.2 1.419 6.312-.746A9.54 9.54 0 0 0 23.381 10"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#00A94F",
d: "M21.624 8.239a9.54 9.54 0 0 1-9.91 15.61l-6.02 2.059 6.2-1.404a9.54 9.54 0 0 0 9.73-16.265"
}
),
/* @__PURE__ */ jsx("path", { fill: "#F15D22", d: "M7.991 20.562A9.542 9.542 0 0 1 23.387 9.994 9.543 9.543 0 0 0 7.42 20.35l-1.726 5.555z" }),
/* @__PURE__ */ jsx("path", { fill: "#E31B23", d: "M7.42 20.35A9.543 9.543 0 0 1 21.624 8.238 9.543 9.543 0 0 0 6.832 20.202l-1.135 5.706z" })
] });
forwardRef(SvgDiscourse);
const SvgDynamicZoneField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#F6F6F9", stroke: "#DCDCE4", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#666687",
d: "M23.75 16a3.75 3.75 0 0 1-6.402 2.652l-.03-.033-3.742-4.225a2.25 2.25 0 1 0 0 3.212l.193-.218a.75.75 0 1 1 1.125.994l-.21.237-.03.033a3.75 3.75 0 1 1 0-5.304l.03.033 3.742 4.225a2.25 2.25 0 1 0 0-3.212l-.193.218a.751.751 0 1 1-1.125-.995l.21-.236.03-.033A3.75 3.75 0 0 1 23.75 16"
}
)
] });
const ForwardRef$O = forwardRef(SvgDynamicZoneField);
const ForwardRef$P = ForwardRef$O;
const SvgEmailField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#FCECEA", stroke: "#F5C0B8", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#D02B20",
d: "M16 9.25a6.75 6.75 0 0 0 0 13.5c1.392 0 2.856-.42 3.915-1.125a.75.75 0 1 0-.83-1.25c-.813.54-1.994.875-3.085.875A5.25 5.25 0 1 1 21.25 16c0 .58-.104 1.067-.293 1.372-.165.265-.375.378-.707.378s-.542-.113-.707-.378c-.187-.305-.293-.791-.293-1.372v-2.5a.75.75 0 0 0-1.468-.216 3.25 3.25 0 1 0 .554 4.973c.433.637 1.09.993 1.914.993 1.542 0 2.5-1.245 2.5-3.25A6.76 6.76 0 0 0 16 9.25m0 8.5a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5"
}
)
] });
const ForwardRef$M = forwardRef(SvgEmailField);
const ForwardRef$N = ForwardRef$M;
const SvgEmptyData = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", viewBox: "0 0 217 121", ref, ...props, children: [
/* @__PURE__ */ jsxs("g", { clipPath: "url(#EmptyData_svg__a)", children: [
/* @__PURE__ */ jsx(
"path",
{
stroke: "#EEEEFA",
strokeDasharray: "3.93 4.91",
strokeLinecap: "round",
strokeWidth: 0.982,
d: "M1.158 99.652h215.018M1.158 80.015h215.018M1.158 59.397h215.018M1.158 38.779h215.018M1.158 20.124h215.018"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#D9D8FF",
fillOpacity: 0.8,
fillRule: "evenodd",
d: "M182.63 25.086c4.112 0 7.446 3.279 7.446 7.323s-3.334 7.324-7.446 7.324h-42.545c4.112 0 7.445 3.279 7.445 7.323s-3.333 7.324-7.445 7.324h23.4c4.112 0 7.445 3.278 7.445 7.323 0 4.044-3.333 7.323-7.445 7.323h-10.821c-5.185 0-9.388 3.28-9.388 7.324q0 2.847 3.162 5.314c1.968 1.536 4.676 1.736 6.861 2.943 2.27 1.255 3.804 3.646 3.804 6.39 0 4.044-3.333 7.323-7.445 7.323H61.376c-4.112 0-7.446-3.279-7.446-7.323s3.334-7.324 7.446-7.324H19.894c-4.112 0-7.445-3.279-7.445-7.323s3.333-7.324 7.445-7.324H62.44c4.112 0 7.445-3.278 7.445-7.323s-3.334-7.324-7.446-7.324H35.85c-4.112 0-7.446-3.278-7.446-7.323 0-4.044 3.334-7.323 7.446-7.323h42.545c-4.112 0-7.445-3.28-7.445-7.324s3.333-7.323 7.445-7.323zm0 29.294c4.112 0 7.446 3.278 7.446 7.323 0 4.044-3.334 7.323-7.446 7.323s-7.445-3.278-7.445-7.323 3.333-7.324 7.445-7.324",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"rect",
{
width: 27,
height: 79.036,
x: 109.403,
y: 33.133,
fill: "#fff",
stroke: "#7B79FF",
strokeWidth: 2.455,
rx: 4.173
}
),
/* @__PURE__ */ jsx("rect", { width: 27, height: 102.6, x: 74.058, y: 9.57, fill: "#fff", stroke: "#7B79FF", strokeWidth: 2.455, rx: 4.173 }),
/* @__PURE__ */ jsx(
"rect",
{
width: 27,
height: 58.418,
x: 39.203,
y: 53.26,
fill: "#fff",
stroke: "#7B79FF",
strokeWidth: 2.455,
rx: 4.173
}
),
/* @__PURE__ */ jsx(
"rect",
{
width: 27,
height: 55.473,
x: 144.748,
y: 56.697,
fill: "#fff",
stroke: "#7B79FF",
strokeWidth: 2.455,
rx: 4.173
}
),
/* @__PURE__ */ jsx("rect", { width: 21.6, height: 53.018, x: 41.903, y: 55.961, fill: "#EEEEFA", rx: 1.964 }),
/* @__PURE__ */ jsx("rect", { width: 21.6, height: 73.636, x: 112.103, y: 35.833, fill: "#EEEEFA", rx: 1.964 })
] }),
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "EmptyData_svg__a", children: /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M.667.797h216v120h-216z" }) }) })
] });
forwardRef(SvgEmptyData);
const SvgEmptyDocuments = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", viewBox: "0 0 217 121", ref, ...props, children: [
/* @__PURE__ */ jsxs("g", { clipPath: "url(#EmptyDocuments_svg__a)", opacity: 0.84, children: [
/* @__PURE__ */ jsx(
"path",
{
fill: "#D9D8FF",
fillOpacity: 0.8,
fillRule: "evenodd",
d: "M189.917 20.442a7.583 7.583 0 0 1 0 15.167h-43.334a7.584 7.584 0 1 1 0 15.167h23.834a7.583 7.583 0 0 1 0 15.166h-11.022c-5.281 0-9.562 3.396-9.562 7.584q0 2.934 3.19 5.479c2.017 1.608 4.824 1.818 7.065 3.097a7.584 7.584 0 0 1-3.755 14.174H66.417a7.583 7.583 0 1 1 0-15.167h-42.25a7.583 7.583 0 0 1 0-15.167H67.5a7.583 7.583 0 0 0 0-15.166H40.417a7.583 7.583 0 0 1 0-15.167H83.75a7.583 7.583 0 0 1 0-15.167zm0 30.334a7.583 7.583 0 0 1 0 15.166 7.584 7.584 0 0 1 0-15.166",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
d: "m133.228 20.443 10.077 73.496.905 7.373a4.33 4.33 0 0 1-3.773 4.829l-63.44 7.79a4.334 4.334 0 0 1-4.83-3.773l-9.766-79.547a2.167 2.167 0 0 1 1.886-2.414l.023-.003 5.263-.59zm-59.4 6.683 4.97-.557z",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
stroke: "#7B79FF",
strokeWidth: 2.5,
d: "m73.829 27.126 4.97-.557m54.429-6.126 10.077 73.496.905 7.373a4.33 4.33 0 0 1-3.773 4.829l-63.44 7.79a4.334 4.334 0 0 1-4.83-3.773l-9.766-79.547a2.167 2.167 0 0 1 1.886-2.414l.023-.003 5.263-.59z"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#F0F0FF",
fillRule: "evenodd",
d: "m130.485 25.068 9.121 66.607.821 6.683c.264 2.152-1.246 4.109-3.373 4.37l-56.812 6.976c-2.128.261-4.066-1.272-4.33-3.425l-8.83-71.908a2.166 2.166 0 0 1 1.887-2.414l7.028-.863",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
stroke: "#7B79FF",
strokeWidth: 2.5,
d: "M135.998 6.63H86.645a2.97 2.97 0 0 0-2.107.872 2.97 2.97 0 0 0-.873 2.107v82.333c0 .823.334 1.568.873 2.107a2.97 2.97 0 0 0 2.106.872h63.917a2.97 2.97 0 0 0 2.107-.872 2.97 2.97 0 0 0 .872-2.107V24.164a2.98 2.98 0 0 0-.873-2.108L138.104 7.502a2.98 2.98 0 0 0-2.106-.872Z",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
stroke: "#7B79FF",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2.5,
d: "M136.478 7.879v12.563a3.25 3.25 0 0 0 3.25 3.25h8.595M95.311 78.942h28.167m-28.167-55.25h28.167zm0 13h46.583zm0 14.084h46.583zm0 14.083h46.583z"
}
)
] }),
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "EmptyDocuments_svg__a", children: /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M.667.797h216v120h-216z" }) }) })
] });
const ForwardRef$I = forwardRef(SvgEmptyDocuments);
const ForwardRef$J = ForwardRef$I;
const SvgEmptyPermissions = (props, ref) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", viewBox: "0 0 193 121", ref, ...props, children: /* @__PURE__ */ jsxs("g", { opacity: 0.88, children: [
/* @__PURE__ */ jsx(
"path",
{
fill: "#DBDBFA",
fillRule: "evenodd",
d: "M160.947 53.823a4 4 0 0 0-.15-.281c-3.5-5.96-7.289-11.263-11.52-15.858h18.096c4.445 0 8.048 3.613 8.048 8.07 0 4.456-3.603 8.069-8.048 8.069zm-8.493 16.139c-11.562 11.57-31.953 19.597-55.21 19.597-31.435 0-54.384-16.705-55.701-35.736H29.409c-4.445 0-8.048 3.613-8.048 8.07 0 4.456 3.603 8.069 8.048 8.069h11.697c5.604 0 10.148 3.612 10.148 8.069q0 3.786-4.98 6.963c-.942.601-2.034.876-3.123 1.15-.33.083-.658.166-.983.257a8.07 8.07 0 0 0-5.86 7.768c0 4.457 3.602 8.07 8.047 8.07h95.425c4.445 0 8.048-3.613 8.048-8.07 0-4.456-3.603-8.069-8.048-8.069h44.839c4.444 0 8.048-3.613 8.048-8.07 0-4.456-3.604-8.068-8.048-8.068zM68.723 21.546H8.715c-4.445 0-8.048 3.613-8.048 8.07 0 4.456 3.603 8.068 8.048 8.068h37.314c4.606-6.843 12.5-12.477 22.694-16.138M.667 61.892c0-4.456 3.603-8.069 8.048-8.069 4.444 0 8.047 3.613 8.047 8.07 0 4.456-3.603 8.069-8.047 8.069S.667 66.349.667 61.892",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
stroke: "#7B79FF",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2.5,
d: "m158.091 49.212 1.446 2.131"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
d: "M154.862 59.69c-45.683-57.683-95.639-25.812-117.374.01-1.404 1.668-1.426 4.117-.15 5.882 47.31 65.454 96.71 29.044 117.704-.133 1.24-1.722 1.138-4.094-.18-5.758"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#7B79FF",
fillRule: "evenodd",
d: "M113.536 28.091c-9.141-2.486-18.085-2.558-26.571-.94-21.301 4.058-39.458 18.707-50.43 31.742-1.794 2.132-1.798 5.217-.206 7.42C48.246 82.798 60.36 92.962 72.218 98.41q1.186.544 2.367 1.027l1.206-2.209a57 57 0 0 1-2.53-1.09c-11.366-5.222-23.168-15.052-34.905-31.291-.961-1.33-.92-3.143.092-4.345 10.764-12.787 28.453-26.985 48.985-30.897 7.905-1.506 16.271-1.495 24.869.745zm-28.277 71.966c7.097 1.397 13.98 1.155 20.536-.279 20.46-4.474 37.826-20.593 48.237-35.062.899-1.25.84-3.007-.146-4.252-10.728-13.547-21.653-22.062-32.351-26.854l1.201-2.2c11.026 4.98 22.21 13.738 33.11 27.502 1.649 2.083 1.795 5.069.215 7.265-10.584 14.708-28.416 31.382-49.732 36.044-7.115 1.556-14.607 1.77-22.323.131z",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
stroke: "#7B79FF",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2.5,
d: "M127.159 22.08c13.23 6.32 21.864 14.378 27.624 21.78M34.068 48.642C53.002 23.337 89.197 8.3 117.953 18.635"
}
),
/* @__PURE__ */ jsx("ellipse", { cx: 94.98, cy: 66.505, fill: "#F0F0FF", rx: 18.395, ry: 18.444 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#7B79FF",
fillRule: "evenodd",
d: "M104.76 44.362a24 24 0 0 0-9.776-2.067c-13.334 0-24.144 10.838-24.144 24.208 0 8.428 4.296 15.85 10.813 20.186l1.203-2.204c-5.741-3.903-9.516-10.498-9.516-17.982 0-11.995 9.696-21.708 21.644-21.708 3.045 0 5.944.631 8.574 1.77zM91.95 87.999q1.488.211 3.034.212c11.947 0 21.643-9.713 21.643-21.708a21.66 21.66 0 0 0-5.222-14.142l1.272-2.33a24.16 24.16 0 0 1 6.45 16.472c0 13.37-10.809 24.207-24.143 24.207-1.47 0-2.908-.131-4.305-.383z",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
stroke: "#7B79FF",
strokeWidth: 2.5,
d: "M116.729 54.977c0 4.406-3.562 7.972-7.948 7.972s-7.948-3.566-7.948-7.972 3.562-7.972 7.948-7.972 7.948 3.566 7.948 7.972Z"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
d: "M110.472 33.635c1.275-2.324 4.078-3.019 6.296-1.56 2.264 1.49 3.053 4.654 1.751 7.027l-31.287 57.05c-1.275 2.324-4.079 3.018-6.296 1.559-2.265-1.49-3.053-4.653-1.751-7.027z"
}
),
/* @__PURE__ */ jsx(
"rect",
{
width: 3.668,
height: 134.376,
fill: "#7B79FF",
rx: 1.834,
transform: "matrix(.82817 .56048 -.47918 .87772 127.181 .797)"
}
)
] }) });
const ForwardRef$G = forwardRef(SvgEmptyPermissions);
const ForwardRef$H = ForwardRef$G;
const SvgEmptyPictures = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", viewBox: "0 0 217 121", ref, ...props, children: [
/* @__PURE__ */ jsx("g", { clipPath: "url(#EmptyPictures_svg__a)", children: /* @__PURE__ */ jsxs("g", { clipPath: "url(#EmptyPictures_svg__b)", opacity: 0.88, children: [
/* @__PURE__ */ jsx(
"path",
{
fill: "#D9D8FF",
fillOpacity: 0.8,
fillRule: "evenodd",
d: "M119.667 28.797a7 7 0 1 1 0 14h64a7 7 0 1 1 0 14h22a7 7 0 1 1 0 14h-19a7 7 0 1 0 0 14h6a7 7 0 1 1 0 14h-52a7 7 0 0 1-1.5-.161 7 7 0 0 1-1.5.16h-91a7 7 0 0 1 0-14h-39a7 7 0 1 1 0-14h40a7 7 0 0 0 0-14h-25a7 7 0 1 1 0-14h40a7 7 0 1 1 0-14zm90 56a7 7 0 1 1 0 14 7 7 0 0 1 0-14",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
d: "m74.497 103.07-8.622 1.422a4 4 0 0 1-4.518-3.404L50.224 21.866a4 4 0 0 1 3.404-4.518l78.231-10.994a4 4 0 0 1 4.518 3.404c.474 3.377 2.408 16.468 2.571 17.63",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#F0F0FF",
fillRule: "evenodd",
d: "m72.472 99.51-3.696.525a3.62 3.62 0 0 1-4.096-3.085l-9.996-71.925a3.646 3.646 0 0 1 3.097-4.107L128.82 10.82a3.62 3.62 0 0 1 4.096 3.085l.859 6.18 9.206 66.599c.306 2.212-1.22 4.257-3.408 4.566l-.07.01z",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
stroke: "#7B79FF",
strokeLinecap: "round",
strokeWidth: 2.5,
d: "m69.945 103.92-4.07.572a4 4 0 0 1-4.518-3.405L50.223 21.866a4 4 0 0 1 3.405-4.518l78.231-10.994a4 4 0 0 1 4.518 3.404l.956 6.808M138.167 21.177l.5 3.12"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
stroke: "#7B79FF",
strokeWidth: 2.5,
d: "m165.078 31.096-78.567-8.258a2.74 2.74 0 0 0-2.018.598 2.74 2.74 0 0 0-1.005 1.85l-8.362 79.561a2.748 2.748 0 0 0 2.447 3.023l78.568 8.258a2.74 2.74 0 0 0 2.018-.598 2.74 2.74 0 0 0 1.004-1.85l8.362-79.562a2.74 2.74 0 0 0-.597-2.018 2.74 2.74 0 0 0-1.85-1.004Z",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
d: "m93.657 31.382 62.655 6.585a3 3 0 0 1 2.67 3.297l-5.54 52.71a3 3 0 0 1-3.298 2.67L87.49 90.059a3 3 0 0 1-2.67-3.297l5.54-52.71a3 3 0 0 1 3.297-2.67",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#F0F0FF",
fillRule: "evenodd",
d: "m93.407 74.676 9.798-6.609a4 4 0 0 1 5.167.595l7.174 7.722a1 1 0 0 0 1.362.097l15.34-12.43a4 4 0 0 1 5.877.936l9.981 15.438 1.433 2.392-.686 8.124a1 1 0 0 1-1.107.91l-56.963-6.329a1 1 0 0 1-.885-1.085l.755-8.199z",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
stroke: "#7B79FF",
strokeWidth: 2.5,
d: "m156.181 39.21-62.655-6.585c-.48-.05-.936.099-1.284.38a1.75 1.75 0 0 0-.64 1.178l-5.54 52.71c-.05.48.1.936.381 1.284s.697.588 1.177.639l62.655 6.585c.481.05.936-.099 1.284-.38s.589-.697.639-1.177l5.54-52.71a1.74 1.74 0 0 0-.38-1.284 1.74 1.74 0 0 0-1.177-.64Z",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#F0F0FF",
stroke: "#7B79FF",
strokeWidth: 2.5,
d: "M105.071 56.714a6 6 0 1 0 1.254-11.936 6 6 0 0 0-1.254 11.936Z"
}
),
/* @__PURE__ */ jsx(
"path",
{
stroke: "#7B79FF",
strokeLinecap: "round",
strokeWidth: 2.5,
d: "m91.396 76.222 11.809-8.155a4 4 0 0 1 5.167.594l7.174 7.723a1 1 0 0 0 1.362.096l15.34-12.43a4 4 0 0 1 5.877.936l11.064 17.556"
}
)
] }) }),
/* @__PURE__ */ jsxs("defs", { children: [
/* @__PURE__ */ jsx("clipPath", { id: "EmptyPictures_svg__a", children: /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M.667.797h216v120h-216z" }) }),
/* @__PURE__ */ jsx("clipPath", { id: "EmptyPictures_svg__b", children: /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M.667.797h216v120h-216z" }) })
] })
] });
forwardRef(SvgEmptyPictures);
const SvgEnumerationField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#F6ECFC", stroke: "#E0C1F4", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#9736E8",
d: "M12.75 12a.75.75 0 0 1 .75-.75h8a.75.75 0 1 1 0 1.5h-8a.75.75 0 0 1-.75-.75m8.75 3.25h-8a.75.75 0 1 0 0 1.5h8a.75.75 0 1 0 0-1.5m0 4h-8a.75.75 0 1 0 0 1.5h8a.75.75 0 1 0 0-1.5M10.75 15a1 1 0 1 0 0 2 1 1 0 0 0 0-2m0-4a1 1 0 1 0 0 2 1 1 0 0 0 0-2m0 8a1 1 0 1 0 0 2 1 1 0 0 0 0-2"
}
)
] });
const ForwardRef$C = forwardRef(SvgEnumerationField);
const ForwardRef$D = ForwardRef$C;
const SvgFacebook = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx(
"path",
{
fill: "#1977F3",
d: "M32 16c0-8.836-7.164-16-16-16S0 7.164 0 16c0 7.985 5.85 14.605 13.5 15.807v-11.18H9.437V16H13.5v-3.526c0-4.01 2.39-6.226 6.044-6.226 1.75 0 3.582.313 3.582.313V10.5h-2.018c-1.987 0-2.608 1.233-2.608 2.5V16h4.437l-.709 4.626H18.5v11.18C26.15 30.607 32 23.989 32 16"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#FEFEFE",
d: "M22.228 20.626 22.937 16H18.5v-3.002c0-1.264.619-2.5 2.608-2.5h2.018V6.562s-1.832-.313-3.582-.313c-3.654 0-6.044 2.214-6.044 6.226V16H9.437v4.626H13.5v11.18Q14.724 32 16 32c.85 0 1.685-.068 2.5-.194v-11.18z"
}
)
] });
forwardRef(SvgFacebook);
const SvgFeatherSquare = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("path", { fill: "#9736E8", d: "M0 4a4 4 0 0 1 4-4h24a4 4 0 0 1 4 4v24a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4z" }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
d: "M18.037 11.774a28.6 28.6 0 0 0-2.948 2.706c-1.995 2.109-3.55 4.093-4.761 6.06-.289.469-.574.945-.855 1.418a9 9 0 0 0-.463 1.536c-.074.37.275.68.577.395.312-.299.587-.64.851-.985.467-.608.906-1.237 1.342-1.867 3.37.242 7.27-2.048 8.933-4.857a.2.2 0 0 0 .017-.167.18.18 0 0 0-.114-.118c-.809-.27-1.798-.44-2.207-.462-.017 0-.034-.014-.037-.035a.04.04 0 0 1 .024-.043c1.113-.58 1.924-.647 2.877-.505.07.01.134-.046.16-.114.095-.217.356-.87.537-1.404a.2.2 0 0 0-.087-.239c-.71-.384-1.656-.643-2.035-.682-.017 0-.03-.018-.034-.036a.04.04 0 0 1 .024-.043c1.1-.483 1.485-.497 2.364-.302.087.018.17-.05.19-.142.433-1.714.574-3.197.608-3.68a.2.2 0 0 0-.057-.157.18.18 0 0 0-.148-.05c-2.444.356-4.403.865-6.093 1.55-.057.022-.11.072-.11.136.144.551-.242 1.209-.845 1.703a.04.04 0 0 1-.044.018.05.05 0 0 1-.027-.043c.004-.046.158-.665.067-1.116-.013-.064-.033-.125-.084-.16a.17.17 0 0 0-.17-.014c-7.924 3.811-5.922 10.098-5.922 10.098q.015.004.03.007c.895-1.86 1.904-3.232 3.49-5.035 1.178-1.337 2.331-2.425 3.525-3.325.75-.565 2.448-1.738 3.51-2.144a.3.3 0 0 1 .105-.021c.097 0 .177.064.2.16a.26.26 0 0 1-.046.228z"
}
)
] });
forwardRef(SvgFeatherSquare);
const SvgGitHub = (props, ref) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: /* @__PURE__ */ jsx(
"path",
{
fill: "#24292F",
fillRule: "evenodd",
d: "M15.952 0C7.132 0 0 7.184 0 16.07c0 7.105 4.57 13.118 10.908 15.247.792.16 1.083-.346 1.083-.772 0-.372-.027-1.65-.027-2.98-4.437.958-5.361-1.916-5.361-1.916-.713-1.862-1.77-2.34-1.77-2.34-1.452-.985.106-.985.106-.985 1.61.106 2.456 1.65 2.456 1.65 1.426 2.447 3.724 1.755 4.648 1.33.132-1.038.555-1.757 1.004-2.156-3.54-.372-7.263-1.756-7.263-7.929 0-1.756.634-3.193 1.637-4.31-.158-.399-.713-2.049.16-4.257 0 0 1.346-.426 4.383 1.65 1.3-.352 2.641-.531 3.988-.533 1.347 0 2.72.187 3.988.532 3.038-2.075 4.385-1.65 4.385-1.65.871 2.21.316 3.859.158 4.258 1.03 1.117 1.637 2.554 1.637 4.31 0 6.173-3.723 7.53-7.289 7.93.581.505 1.083 1.463 1.083 2.98 0 2.154-.026 3.884-.026 4.416 0 .426.29.932 1.082.772 6.34-2.13 10.908-8.142 10.908-15.246C31.904 7.184 24.748 0 15.952 0",
clipRule: "evenodd"
}
) });
forwardRef(SvgGitHub);
const SvgGlassesSquare = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("path", { fill: "#AC73E6", d: "M0 4a4 4 0 0 1 4-4h24a4 4 0 0 1 4 4v24a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4z" }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
d: "M15.027 13.839c-3.19-.836-6.305-1.064-10.18-.608-1.215.152-1.063 1.975.076 2.203.304.836.456 2.355.912 3.267.987 2.279 5.622 1.975 7.369.835 1.14-.683 1.443-2.279 1.9-3.494.227-.684 1.595-.684 1.822 0 .38 1.215.76 2.81 1.9 3.494 1.747 1.14 6.381 1.444 7.369-.835.456-.912.607-2.431.911-3.267 1.14-.228 1.216-2.051.076-2.203-3.874-.456-6.989-.228-10.18.608-.455.075-1.519.075-1.975 0",
clipRule: "evenodd"
}
)
] });
forwardRef(SvgGlassesSquare);
const SvgInformationSquare = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("path", { fill: "#4945FF", d: "M0 4a4 4 0 0 1 4-4h24a4 4 0 0 1 4 4v24a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4z" }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
d: "M15.733 8c.343 0 .678.108.963.31s.507.49.639.826c.13.337.165.707.098 1.064a1.9 1.9 0 0 1-.474.942 1.7 1.7 0 0 1-.887.504 1.64 1.64 0 0 1-1.002-.105 1.76 1.76 0 0 1-.778-.678A1.9 1.9 0 0 1 14 9.841a1.9 1.9 0 0 1 .508-1.302c.325-.345.766-.539 1.225-.539M20 24h-8v-2.265h2.933v-6.23H12.8v-2.266h4.267v8.496H20z"
}
)
] });
forwardRef(SvgInformationSquare);
const SvgJsonField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#EAF5FF", stroke: "#B8E1FF", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#0C75AF",
d: "M11.425 15.468a2.2 2.2 0 0 1-.36.532q.22.24.36.532c.325.67.325 1.457.325 2.218 0 1.621.115 2 1.25 2a.75.75 0 1 1 0 1.5c-1.196 0-2.012-.431-2.425-1.282-.325-.67-.325-1.457-.325-2.218 0-1.621-.115-2-1.25-2a.75.75 0 1 1 0-1.5c1.135 0 1.25-.379 1.25-2 0-.76 0-1.547.325-2.218.413-.85 1.229-1.282 2.425-1.282a.75.75 0 1 1 0 1.5c-1.135 0-1.25.379-1.25 2 0 .76 0 1.547-.325 2.218M23 15.25c-1.135 0-1.25-.379-1.25-2 0-.76 0-1.547-.325-2.218-.413-.85-1.229-1.282-2.425-1.282a.75.75 0 1 0 0 1.5c1.135 0 1.25.379 1.25 2 0 .76 0 1.547.325 2.218q.142.292.363.532a2.2 2.2 0 0 0-.36.532c-.328.67-.328 1.457-.328 2.218 0 1.621-.115 2-1.25 2a.75.75 0 1 0 0 1.5c1.196 0 2.012-.431 2.425-1.282.325-.67.325-1.457.325-2.218 0-1.621.115-2 1.25-2a.75.75 0 1 0 0-1.5"
}
)
] });
const ForwardRef$q = forwardRef(SvgJsonField);
const ForwardRef$r = ForwardRef$q;
const SvgMarkdownField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#EAF5FF", stroke: "#B8E1FF", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#0C75AF",
d: "M9.75 12a.75.75 0 0 1 .75-.75h11a.75.75 0 1 1 0 1.5h-11a.75.75 0 0 1-.75-.75m.75 3.25h8a.75.75 0 1 0 0-1.5h-8a.75.75 0 1 0 0 1.5m11 1h-11a.75.75 0 1 0 0 1.5h11a.75.75 0 1 0 0-1.5m-3 2.5h-8a.75.75 0 1 0 0 1.5h8a.75.75 0 1 0 0-1.5"
}
)
] });
forwardRef(SvgMarkdownField);
const SvgMediaField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#F6ECFC", stroke: "#E0C1F4", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#9736E8",
d: "M21.5 10.5h-11a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-9a1 1 0 0 0-1-1m-3.75 3a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-7.25 7v-1.75l3.25-3.25 5 5zm11 0h-1.336l-2.25-2.25 1.25-1.25 2.336 2.336z"
}
)
] });
const ForwardRef$m = forwardRef(SvgMediaField);
const ForwardRef$n = ForwardRef$m;
const SvgMedium = (props, ref) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: /* @__PURE__ */ jsx(
"path",
{
fill: "#32324D",
d: "M18.05 16.007c0 5.019-4.04 9.087-9.025 9.087-4.984 0-9.025-4.07-9.025-9.087C0 10.99 4.04 6.92 9.025 6.92s9.025 4.069 9.025 9.087M27.95 16.007c0 4.724-2.02 8.555-4.512 8.555s-4.513-3.831-4.513-8.555 2.02-8.555 4.513-8.555 4.512 3.83 4.512 8.555M32 16.007c0 4.231-.71 7.664-1.587 7.664s-1.587-3.432-1.587-7.664.71-7.664 1.587-7.664c.876 0 1.587 3.432 1.587 7.664"
}
) });
const ForwardRef$k = forwardRef(SvgMedium);
const ForwardRef$l = ForwardRef$k;
const SvgNumberField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#FCECEA", stroke: "#F5C0B8", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#D02B20",
d: "M8.68 20v-6.22h-.096l-1.902 1.322V13.64l2.004-1.392h1.616V20zm3.733 0v-1.09l2.498-2.466c1.09-1.058 1.385-1.45 1.385-1.992v-.017c0-.66-.45-1.122-1.192-1.122-.757 0-1.278.505-1.278 1.24v.028h-1.499l-.005-.022c0-1.488 1.16-2.508 2.857-2.508 1.595 0 2.713.913 2.713 2.25v.016c0 .881-.457 1.612-1.87 2.917l-1.434 1.337v.124h3.416V20zm9.974.172c-1.75 0-2.906-.94-3.013-2.326l-.005-.07h1.552l.005.06c.07.601.623 1.03 1.461 1.03.827 0 1.37-.461 1.37-1.116v-.011c0-.741-.553-1.15-1.493-1.15h-.887v-1.154h.865c.817 0 1.343-.43 1.343-1.059v-.01c0-.645-.446-1.042-1.209-1.042-.762 0-1.273.413-1.337 1.058l-.005.048H19.54l.005-.064c.113-1.386 1.203-2.288 2.83-2.288 1.665 0 2.74.838 2.74 2.073v.01c0 .967-.71 1.596-1.617 1.784v.032c1.155.107 1.907.773 1.907 1.826v.011c0 1.407-1.209 2.358-3.019 2.358"
}
)
] });
const ForwardRef$i = forwardRef(SvgNumberField);
const ForwardRef$j = ForwardRef$i;
const SvgPasswordField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#FDF4DC", stroke: "#FAE7B9", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#D9822F",
d: "M21 13h-2v-1.5a3 3 0 0 0-6 0V13h-2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-7a1 1 0 0 0-1-1m-5 5.25a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5M18 13h-4v-1.5a2 2 0 0 1 4 0z"
}
)
] });
const ForwardRef$g = forwardRef(SvgPasswordField);
const ForwardRef$h = ForwardRef$g;
const SvgPlaySquare = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("path", { fill: "#66B7F1", d: "M0 4a4 4 0 0 1 4-4h24a4 4 0 0 1 4 4v24a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4z" }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
d: "M12 10.921a.5.5 0 0 1 .773-.419l8.582 5.579a.5.5 0 0 1 0 .838l-8.582 5.579a.5.5 0 0 1-.773-.42z",
clipRule: "evenodd"
}
)
] });
forwardRef(SvgPlaySquare);
const SvgReddit = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx(
"path",
{
fill: "#FF4500",
d: "M16 0C7.164 0 0 7.164 0 16a15.95 15.95 0 0 0 4.686 11.314L1.64 30.36c-.605.605-.177 1.639.678 1.639H16c8.836 0 16-7.164 16-16S24.836 0 16 0"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
d: "M19.255 7.545a2.668 2.668 0 0 0 5.261-.614 2.666 2.666 0 0 0-5.277-.54 4.307 4.307 0 0 0-3.84 4.277v.013c-2.345.099-4.487.767-6.187 1.82a3.736 3.736 0 1 0-3.869 6.34c.124 4.338 4.85 7.826 10.664 7.826s10.547-3.492 10.664-7.833a3.737 3.737 0 0 0-1.602-7.111c-.857 0-1.645.288-2.275.773-1.715-1.061-3.88-1.729-6.25-1.817v-.01a3.16 3.16 0 0 1 2.71-3.121zM9.062 17.829c.063-1.355.963-2.395 2.01-2.395 1.045 0 1.845 1.098 1.783 2.454-.063 1.354-.844 1.847-1.891 1.847S9 19.184 9.062 17.829m11.883-2.395c1.047 0 1.947 1.04 2.009 2.395s-.855 1.906-1.902 1.906-1.828-.491-1.89-1.848c-.063-1.355.735-2.453 1.783-2.453m-1.245 5.53c.196.02.321.224.245.406a4.268 4.268 0 0 1-7.875 0 .296.296 0 0 1 .245-.406c1.15-.116 2.394-.18 3.692-.18 1.3 0 2.542.064 3.693.18"
}
)
] });
forwardRef(SvgReddit);
const SvgRelationField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#F0F0FF", stroke: "#D9D8FF", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#4945FF",
d: "M16.523 19.72a.75.75 0 0 1 0 1.063l-.371.371a3.751 3.751 0 1 1-5.305-5.305l1.507-1.507a3.75 3.75 0 0 1 5.146-.155.753.753 0 0 1-1 1.126 2.25 2.25 0 0 0-3.086.091l-1.506 1.505a2.25 2.25 0 0 0 3.183 3.183l.37-.371a.747.747 0 0 1 1.062 0m4.63-8.874a3.755 3.755 0 0 0-5.305 0l-.371.37a.751.751 0 1 0 1.062 1.063l.372-.37a2.25 2.25 0 1 1 3.182 3.182l-1.507 1.507a2.25 2.25 0 0 1-3.086.09.755.755 0 0 0-1.211.315.75.75 0 0 0 .211.81 3.75 3.75 0 0 0 5.144-.152l1.507-1.507a3.756 3.756 0 0 0 .002-5.307z"
}
)
] });
const ForwardRef$a = forwardRef(SvgRelationField);
const ForwardRef$b = ForwardRef$a;
const SvgSingleType = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#0C75AF", stroke: "#0C75AF", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
d: "M8.523 17.586h1.711c.123.727.844 1.195 1.758 1.195.95 0 1.606-.445 1.606-1.107 0-.492-.352-.797-1.266-1.084l-.879-.276c-1.248-.386-1.963-1.218-1.963-2.308 0-1.547 1.418-2.678 3.328-2.678 1.858 0 3.164 1.078 3.217 2.62h-1.67c-.105-.71-.744-1.184-1.617-1.184-.826 0-1.459.433-1.459 1.03 0 .47.34.815 1.137 1.067l.867.27c1.436.451 2.086 1.154 2.086 2.297 0 1.675-1.418 2.789-3.516 2.789-1.922 0-3.234-.99-3.34-2.631M20.107 20h-1.78l1.487-6.943h-2.53l.31-1.512h6.843l-.31 1.512h-2.531z"
}
)
] });
forwardRef(SvgSingleType);
const SvgStrapi = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx(
"path",
{
fill: "#4945FF",
d: "M0 11.093c0-5.23 0-7.844 1.625-9.468C3.249 0 5.864 0 11.093 0h9.814c5.23 0 7.844 0 9.468 1.625C32 3.249 32 5.864 32 11.093v9.814c0 5.23 0 7.844-1.625 9.468C28.751 32 26.136 32 20.907 32h-9.814c-5.23 0-7.844 0-9.468-1.625C0 28.751 0 26.136 0 20.907z"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#fff",
fillRule: "evenodd",
d: "M22.08 9.707H11.307V15.2H16.8v5.493h5.493V9.92a.213.213 0 0 0-.213-.213",
clipRule: "evenodd"
}
),
/* @__PURE__ */ jsx("path", { fill: "#fff", d: "M16.8 15.2h-.213v.213h.213z" }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#9593FF",
d: "M11.307 15.2h5.28c.117 0 .213.096.213.213v5.28h-5.28a.213.213 0 0 1-.213-.213zM16.8 20.693h5.493l-5.31 5.312a.107.107 0 0 1-.183-.076zM11.307 15.2H6.07a.107.107 0 0 1-.076-.182l5.312-5.311z"
}
)
] });
forwardRef(SvgStrapi);
const SvgTextField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#EAFBE7", stroke: "#C6F0C2", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#328048",
d: "M13.679 11.18a.75.75 0 0 0-1.358 0l-4 8.5a.75.75 0 0 0 1.357.64l.974-2.07h4.695l.974 2.07a.75.75 0 1 0 1.358-.64zm-2.32 5.57 1.64-3.489 1.643 3.489zm9.14-3c-.865 0-1.547.241-2.027.717a.749.749 0 1 0 1.056 1.063c.188-.187.516-.283.972-.283.584 0 1.074.323 1.21.757a3 3 0 0 0-1.21-.254c-1.516 0-2.75 1.121-2.75 2.5s1.234 2.5 2.75 2.5c.479.001.95-.114 1.375-.336A.75.75 0 0 0 23.25 20v-3.75c0-1.379-1.234-2.5-2.75-2.5m0 5.5c-.687 0-1.25-.449-1.25-1s.563-1 1.25-1 1.25.449 1.25 1-.562 1-1.25 1"
}
)
] });
const ForwardRef$4 = forwardRef(SvgTextField);
const ForwardRef$5 = ForwardRef$4;
const SvgUidField = (props, ref) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: [
/* @__PURE__ */ jsx("rect", { width: 31, height: 23, x: 0.5, y: 4.5, fill: "#F0F0FF", stroke: "#D9D8FF", rx: 2.5 }),
/* @__PURE__ */ jsx(
"path",
{
fill: "#4945FF",
d: "M18 9a5.005 5.005 0 0 0-4.756 6.549l-3.598 3.597a.5.5 0 0 0-.146.354V22a.5.5 0 0 0 .5.5h2.5a.5.5 0 0 0 .5-.5v-1h1a.5.5 0 0 0 .5-.5v-1h1a.5.5 0 0 0 .354-.146l.597-.598A5 5 0 1 0 18 9m1.25 4.75a1 1 0 1 1 0-2 1 1 0 0 1 0 2"
}
)
] });
const ForwardRef$2 = forwardRef(SvgUidField);
const ForwardRef$3 = ForwardRef$2;
const SvgX = (props, ref) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: 16, height: 16, ref, ...props, children: /* @__PURE__ */ jsxs("g", { fillRule: "evenodd", clipRule: "evenodd", children: [
/* @__PURE__ */ jsx(
"path",
{
fill: "#FAFAFA",
d: "M6.566 6.533c.064.092 1.557 2.264 3.317 4.828l3.617 5.268c.23.334.418.614.418.622s-.086.114-.19.234-.4.462-.654.76l-3.258 3.787c-1.153 1.34-1.32 1.534-2.197 2.556-.47.546-.919 1.068-1 1.16s-.146.177-.146.189c0 .014.295.021.83.021h.83l.911-1.062 1.1-1.279a888 888 0 0 0 2.243-2.61c.043-.048.377-.437.744-.864s.676-.787.689-.8l.431-.502a9 9 0 0 1 .424-.478c.009 0 1.164 1.672 2.567 3.717l2.608 3.797.055.08h2.846c2.34.001 2.843-.004 2.834-.027-.01-.025-1.373-2.013-4.87-7.103-2.517-3.665-2.852-4.157-2.843-4.182.01-.024.353-.425 2.607-3.049l1.779-2.07c.062-.07.388-.45.724-.84l1.96-2.283c.027-.035-.02-.038-.814-.038h-.842l-.375.437a1174 1174 0 0 1-2.23 2.594c-.084.096-.506.586-.938 1.09a129 129 0 0 1-1.004 1.167c-.186.22-.374.44-1.239 1.442-.38.44-.399.459-.43.418-.02-.023-1.132-1.64-2.473-3.594L12.16 6.366H6.45zm2.228 1.165 1.186 1.7c1.196 1.71 5.895 8.436 8.917 12.763a421 421 0 0 0 1.783 2.54c.02.022.301.026 1.314.022l1.287-.005-3.37-4.823-5.963-8.534-2.593-3.712-1.3-.005-1.3-.006z"
}
),
/* @__PURE__ */ jsx(
"path",
{
fill: "#040404",
d: "M0 16v16l16.005-.005 16.006-.006.005-15.994L32.022 0H0zm.01.01c0 8.8.003 12.4.006 8s.003-11.6 0-16-.005-.8-.005 8m6.556-9.477c.064.092 1.557 2.264 3.317 4.828l3.617 5.268c.23.334.418.614.418.622s-.086.114-.19.234-.399.462-.654.76l-2.014 2.34-1.244 1.447c-1.153 1.34-1.32 1.534-2.197 2.556-.469.546-.918 1.068-1 1.16-.08.092-.146.177-.146.189 0 .014.295.021.83.021h.83l.911-1.062c.502-.585.996-1.16 1.1-1.279a888 888 0 0 0 2.243-2.61c.043-.048.377-.437.744-.864l.689-.8.431-.502a9 9 0 0 1 .424-.478c.009 0 1.164 1.672 2.567 3.717l2.608 3.797.056.08h2.845c2.34.001 2.843-.004 2.834-.027-.01-.025-1.373-2.013-4.87-7.103-2.517-3.665-2.852-4.157-2.842-4.182.009-.024.352-.425 2.606-3.049l1.78-2.07.723-.84 1.96-2.283c.027-.035-.02-.038-.814-.038h-.842l-.375.437a1129 1129 0 0 1-2.23 2.594c-.084.096-.506.586-.938 1.09a129 129 0 0 1-1.004 1.167c-.186.22-.374.44-1.239 1.442-.38.44-.399.459-.43.418-.02-.023-1.132-1.64-2.473-3.594L12.16 6.366H6.45zm2.228 1.165 1.186 1.7 8.918 12.763a416 416 0 0 0 1.782 2.54c.02.022.301.026 1.314.022l1.287-.005-3.37-4.823-5.963-8.534-2.593-3.712-1.3-.005-1.3-.006z"
}
)
] }) });
const ForwardRef = forwardRef(SvgX);
const ForwardRef$1 = ForwardRef;
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
return typeof o2;
} : function(o2) {
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
}, _typeof(o);
}
function formatProdErrorMessage(code) {
return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or use the non-minified dev environment for full errors. ";
}
var randomString = function randomString2() {
return Math.random().toString(36).substring(7).split("").join(".");
};
var ActionTypes = {
INIT: "@@redux/INIT" + randomString(),
REPLACE: "@@redux/REPLACE" + randomString(),
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
}
};
function isPlainObject$4(obj) {
if (typeof obj !== "object" || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
function miniKindOf(val) {
if (val === void 0) return "undefined";
if (val === null) return "null";
var type = typeof val;
switch (type) {
case "boolean":
case "string":
case "number":
case "symbol":
case "function": {
return type;
}
}
if (Array.isArray(val)) return "array";
if (isDate$2(val)) return "date";
if (isError(val)) return "error";
var constructorName = ctorName(val);
switch (constructorName) {
case "Symbol":
case "Promise":
case "WeakMap":
case "WeakSet":
case "Map":
case "Set":
return constructorName;
}
return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
}
function ctorName(val) {
return typeof val.constructor === "function" ? val.constructor.name : null;
}
function isError(val) {
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
}
function isDate$2(val) {
if (val instanceof Date) return true;
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
}
function kindOf$1(val) {
var typeOfVal = typeof val;
if (process.env.NODE_ENV !== "production") {
typeOfVal = miniKindOf(val);
}
return typeOfVal;
}
function warning(message) {
if (typeof console !== "undefined" && typeof console.error === "function") {
console.error(message);
}
try {
throw new Error(message);
} catch (e) {
}
}
function getUnexpectedStateShapeWarningMessage(inputState, reducers2, action, unexpectedKeyCache) {
var reducerKeys = Object.keys(reducers2);
var argumentName = action && action.type === ActionTypes.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
if (reducerKeys.length === 0) {
return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
}
if (!isPlainObject$4(inputState)) {
return "The " + argumentName + ' has unexpected type of "' + kindOf$1(inputState) + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
}
var unexpectedKeys = Object.keys(inputState).filter(function(key) {
return !reducers2.hasOwnProperty(key) && !unexpectedKeyCache[key];
});
unexpectedKeys.forEach(function(key) {
unexpectedKeyCache[key] = true;
});
if (action && action.type === ActionTypes.REPLACE) return;
if (unexpectedKeys.length > 0) {
return "Unexpected " + (unexpectedKeys.length > 1 ? "keys" : "key") + " " + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
}
}
function assertReducerShape(reducers2) {
Object.keys(reducers2).forEach(function(key) {
var reducer2 = reducers2[key];
var initialState2 = reducer2(void 0, {
type: ActionTypes.INIT
});
if (typeof initialState2 === "undefined") {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : 'The slice reducer for key "' + key + `" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
}
if (typeof reducer2(void 0, {
type: ActionTypes.PROBE_UNKNOWN_ACTION()
}) === "undefined") {
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : 'The slice reducer for key "' + key + '" returned undefined when probed with a random type. ' + ("Don't try to handle '" + ActionTypes.INIT + `' or other actions in "redux/*" `) + "namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.");
}
});
}
function combineReducers(reducers2) {
var reducerKeys = Object.keys(reducers2);
var finalReducers = {};
for (var i = 0; i < reducerKeys.length; i++) {
var key = reducerKeys[i];
if (process.env.NODE_ENV !== "production") {
if (typeof reducers2[key] === "undefined") {
warning('No reducer provided for key "' + key + '"');
}
}
if (typeof reducers2[key] === "function") {
finalReducers[key] = reducers2[key];
}
}
var finalReducerKeys = Object.keys(finalReducers);
var unexpectedKeyCache;
if (process.env.NODE_ENV !== "production") {
unexpectedKeyCache = {};
}
var shapeAssertionError;
try {
assertReducerShape(finalReducers);
} catch (e) {
shapeAssertionError = e;
}
return function combination(state, action) {
if (state === void 0) {
state = {};
}
if (shapeAssertionError) {
throw shapeAssertionError;
}
if (process.env.NODE_ENV !== "production") {
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
if (warningMessage) {
warning(warningMessage);
}
}
var hasChanged = false;
var nextState = {};
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
var _key = finalReducerKeys[_i];
var reducer2 = finalReducers[_key];
var previousStateForKey = state[_key];
var nextStateForKey = reducer2(previousStateForKey, action);
if (typeof nextStateForKey === "undefined") {
var actionType = action && action.type;
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : "When called with an action of type " + (actionType ? '"' + String(actionType) + '"' : "(unknown type)") + ', the slice reducer for key "' + _key + '" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.');
}
nextState[_key] = nextStateForKey;
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
}
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
return hasChanged ? nextState : state;
};
}
var NOT_FOUND = "NOT_FOUND";
function createSingletonCache(equals) {
var entry;
return {
get: function get2(key) {
if (entry && equals(entry.key, key)) {
return entry.value;
}
return NOT_FOUND;
},
put: function put(key, value) {
entry = {
key,
value
};
},
getEntries: function getEntries() {
return entry ? [entry] : [];
},
clear: function clear() {
entry = void 0;
}
};
}
function createLruCache(maxSize, equals) {
var entries = [];
function get2(key) {
var cacheIndex = entries.findIndex(function(entry2) {
return equals(key, entry2.key);
});
if (cacheIndex > -1) {
var entry = entries[cacheIndex];
if (cacheIndex > 0) {
entries.splice(cacheIndex, 1);
entries.unshift(entry);
}
return entry.value;
}
return NOT_FOUND;
}
function put(key, value) {
if (get2(key) === NOT_FOUND) {
entries.unshift({
key,
value
});
if (entries.length > maxSize) {
entries.pop();
}
}
}
function getEntries() {
return entries;
}
function clear() {
entries = [];
}
return {
get: get2,
put,
getEntries,
clear
};
}
var defaultEqualityCheck = function defaultEqualityCheck2(a2, b) {
return a2 === b;
};
function createCacheKeyComparator(equalityCheck) {
return function areArgumentsShallowlyEqual(prev, next) {
if (prev === null || next === null || prev.length !== next.length) {
return false;
}
var length = prev.length;
for (var i = 0; i < length; i++) {
if (!equalityCheck(prev[i], next[i])) {
return false;
}
}
return true;
};
}
function defaultMemoize(func, equalityCheckOrOptions) {
var providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : {
equalityCheck: equalityCheckOrOptions
};
var _providedOptions$equa = providedOptions.equalityCheck, equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa, _providedOptions$maxS = providedOptions.maxSize, maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS, resultEqualityCheck = providedOptions.resultEqualityCheck;
var comparator = createCacheKeyComparator(equalityCheck);
var cache2 = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);
function memoized() {
var value = cache2.get(arguments);
if (value === NOT_FOUND) {
value = func.apply(null, arguments);
if (resultEqualityCheck) {
var entries = cache2.getEntries();
var matchingEntry = entries.find(function(entry) {
return resultEqualityCheck(entry.value, value);
});
if (matchingEntry) {
value = matchingEntry.value;
}
}
cache2.put(arguments, value);
}
return value;
}
memoized.clearCache = function() {
return cache2.clear();
};
return memoized;
}
function getDependencies(funcs) {
var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
if (!dependencies.every(function(dep) {
return typeof dep === "function";
})) {
var dependencyTypes = dependencies.map(function(dep) {
return typeof dep === "function" ? "function " + (dep.name || "unnamed") + "()" : typeof dep;
}).join(", ");
throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
}
return dependencies;
}
function createSelectorCreator(memoize) {
for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
memoizeOptionsFromArgs[_key - 1] = arguments[_key];
}
var createSelector2 = function createSelector3() {
for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
funcs[_key2] = arguments[_key2];
}
var _recomputations = 0;
var _lastResult;
var directlyPassedOptions = {
memoizeOptions: void 0
};
var resultFunc = funcs.pop();
if (typeof resultFunc === "object") {
directlyPassedOptions = resultFunc;
resultFunc = funcs.pop();
}
if (typeof resultFunc !== "function") {
throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
}
var _directlyPassedOption = directlyPassedOptions, _directlyPassedOption2 = _directlyPassedOption.memoizeOptions, memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2;
var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
var dependencies = getDependencies(funcs);
var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
_recomputations++;
return resultFunc.apply(null, arguments);
}].concat(finalMemoizeOptions));
var selector = memoize(function dependenciesChecker() {
var params = [];
var length = dependencies.length;
for (var i = 0; i < length; i++) {
params.push(dependencies[i].apply(null, arguments));
}
_lastResult = memoizedResultFunc.apply(null, params);
return _lastResult;
});
Object.assign(selector, {
resultFunc,
memoizedResultFunc,
dependencies,
lastResult: function lastResult() {
return _lastResult;
},
recomputations: function recomputations() {
return _recomputations;
},
resetRecomputations: function resetRecomputations() {
return _recomputations = 0;
}
});
return selector;
};
return createSelector2;
}
var createSelector = /* @__PURE__ */ createSelectorCreator(defaultMemoize);
var __extends = /* @__PURE__ */ function() {
var extendStatics = function(d2, b) {
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
d3.__proto__ = b2;
} || function(d3, b2) {
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d3[p] = b2[p];
};
return extendStatics(d2, b);
};
return function(d2, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d2, b);
function __() {
this.constructor = d2;
}
d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __generator$1 = function(thisArg, body) {
var _ = { label: 0, sent: function() {
if (t[0] & 1) throw t[1];
return t[1];
}, trys: [], ops: [] }, f2, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
return this;
}), g;
function verb(n) {
return function(v2) {
return step([n, v2]);
};
}
function step(op) {
if (f2) throw new TypeError("Generator is already executing.");
while (_) try {
if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f2 = t = 0;
}
if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArray$2 = function(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
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 = function(obj, key, value) {
return key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
};
var __spreadValues$2 = function(a2, b) {
for (var prop in b || (b = {}))
if (__hasOwnProp$2.call(b, prop))
__defNormalProp$2(a2, prop, b[prop]);
if (__getOwnPropSymbols$2)
for (var _i = 0, _c = __getOwnPropSymbols$2(b); _i < _c.length; _i++) {
var prop = _c[_i];
if (__propIsEnum$2.call(b, prop))
__defNormalProp$2(a2, prop, b[prop]);
}
return a2;
};
var __spreadProps$2 = function(a2, b) {
return __defProps$2(a2, __getOwnPropDescs$2(b));
};
var __async$1 = function(__this, __arguments, generator) {
return new Promise(function(resolve, reject) {
var fulfilled = function(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = function(value) {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = function(x) {
return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
};
step((generator = generator.apply(__this, __arguments)).next());
});
};
function isPlainObject$3(value) {
if (typeof value !== "object" || value === null)
return false;
var proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
var baseProto = proto;
while (Object.getPrototypeOf(baseProto) !== null) {
baseProto = Object.getPrototypeOf(baseProto);
}
return proto === baseProto;
}
var hasMatchFunction = function(v2) {
return v2 && typeof v2.match === "function";
};
function createAction(type, prepareAction) {
function actionCreator() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (prepareAction) {
var prepared = prepareAction.apply(void 0, args);
if (!prepared) {
throw new Error("prepareAction did not return an object");
}
return __spreadValues$2(__spreadValues$2({
type,
payload: prepared.payload
}, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
}
return { type, payload: args[0] };
}
actionCreator.toString = function() {
return "" + type;
};
actionCreator.type = type;
actionCreator.match = function(action) {
return action.type === type;
};
return actionCreator;
}
(function(_super) {
__extends(MiddlewareArray, _super);
function MiddlewareArray() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
Object.setPrototypeOf(_this, MiddlewareArray.prototype);
return _this;
}
Object.defineProperty(MiddlewareArray, Symbol.species, {
get: function() {
return MiddlewareArray;
},
enumerable: false,
configurable: true
});
MiddlewareArray.prototype.concat = function() {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
return _super.prototype.concat.apply(this, arr);
};
MiddlewareArray.prototype.prepend = function() {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
if (arr.length === 1 && Array.isArray(arr[0])) {
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray$2([void 0], arr[0].concat(this))))();
}
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray$2([void 0], arr.concat(this))))();
};
return MiddlewareArray;
})(Array);
(function(_super) {
__extends(EnhancerArray, _super);
function EnhancerArray() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _this = _super.apply(this, args) || this;
Object.setPrototypeOf(_this, EnhancerArray.prototype);
return _this;
}
Object.defineProperty(EnhancerArray, Symbol.species, {
get: function() {
return EnhancerArray;
},
enumerable: false,
configurable: true
});
EnhancerArray.prototype.concat = function() {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
return _super.prototype.concat.apply(this, arr);
};
EnhancerArray.prototype.prepend = function() {
var arr = [];
for (var _i = 0; _i < arguments.length; _i++) {
arr[_i] = arguments[_i];
}
if (arr.length === 1 && Array.isArray(arr[0])) {
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray$2([void 0], arr[0].concat(this))))();
}
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray$2([void 0], arr.concat(this))))();
};
return EnhancerArray;
})(Array);
function freezeDraftable(val) {
return isDraftable(val) ? createNextState2(val, function() {
}) : val;
}
process.env.NODE_ENV === "production";
process.env.NODE_ENV === "production";
function executeReducerBuilderCallback(builderCallback) {
var actionsMap = {};
var actionMatchers = [];
var defaultCaseReducer;
var builder = {
addCase: function(typeOrActionCreator, reducer2) {
if (process.env.NODE_ENV !== "production") {
if (actionMatchers.length > 0) {
throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
}
if (defaultCaseReducer) {
throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
}
}
var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
if (!type) {
throw new Error("`builder.addCase` cannot be called with an empty action type");
}
if (type in actionsMap) {
throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");
}
actionsMap[type] = reducer2;
return builder;
},
addMatcher: function(matcher, reducer2) {
if (process.env.NODE_ENV !== "production") {
if (defaultCaseReducer) {
throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
}
}
actionMatchers.push({ matcher, reducer: reducer2 });
return builder;
},
addDefaultCase: function(reducer2) {
if (process.env.NODE_ENV !== "production") {
if (defaultCaseReducer) {
throw new Error("`builder.addDefaultCase` can only be called once");
}
}
defaultCaseReducer = reducer2;
return builder;
}
};
builderCallback(builder);
return [actionsMap, actionMatchers, defaultCaseReducer];
}
function isStateFunction(x) {
return typeof x === "function";
}
var hasWarnedAboutObjectNotation = false;
function createReducer(initialState2, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
if (actionMatchers === void 0) {
actionMatchers = [];
}
if (process.env.NODE_ENV !== "production") {
if (typeof mapOrBuilderCallback === "object") {
if (!hasWarnedAboutObjectNotation) {
hasWarnedAboutObjectNotation = true;
console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
}
}
}
var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
var getInitialState;
if (isStateFunction(initialState2)) {
getInitialState = function() {
return freezeDraftable(initialState2());
};
} else {
var frozenInitialState_1 = freezeDraftable(initialState2);
getInitialState = function() {
return frozenInitialState_1;
};
}
function reducer2(state, action) {
if (state === void 0) {
state = getInitialState();
}
var caseReducers = __spreadArray$2([
actionsMap[action.type]
], finalActionMatchers.filter(function(_c2) {
var matcher = _c2.matcher;
return matcher(action);
}).map(function(_c2) {
var reducer22 = _c2.reducer;
return reducer22;
}));
if (caseReducers.filter(function(cr) {
return !!cr;
}).length === 0) {
caseReducers = [finalDefaultCaseReducer];
}
return caseReducers.reduce(function(previousState, caseReducer) {
if (caseReducer) {
if (isDraft(previousState)) {
var draft = previousState;
var result = caseReducer(draft, action);
if (result === void 0) {
return previousState;
}
return result;
} else if (!isDraftable(previousState)) {
var result = caseReducer(previousState, action);
if (result === void 0) {
if (previousState === null) {
return previousState;
}
throw Error("A case reducer on a non-draftable value must not return undefined");
}
return result;
} else {
return createNextState2(previousState, function(draft2) {
return caseReducer(draft2, action);
});
}
}
return previousState;
}, state);
}
reducer2.getInitialState = getInitialState;
return reducer2;
}
var hasWarnedAboutObjectNotation2 = false;
function getType2(slice, actionKey) {
return slice + "/" + actionKey;
}
function createSlice(options) {
var name = options.name;
if (!name) {
throw new Error("`name` is a required option for createSlice");
}
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
if (options.initialState === void 0) {
console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
}
}
var initialState2 = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
var reducers2 = options.reducers || {};
var reducerNames = Object.keys(reducers2);
var sliceCaseReducersByName = {};
var sliceCaseReducersByType = {};
var actionCreators = {};
reducerNames.forEach(function(reducerName) {
var maybeReducerWithPrepare = reducers2[reducerName];
var type = getType2(name, reducerName);
var caseReducer;
var prepareCallback;
if ("reducer" in maybeReducerWithPrepare) {
caseReducer = maybeReducerWithPrepare.reducer;
prepareCallback = maybeReducerWithPrepare.prepare;
} else {
caseReducer = maybeReducerWithPrepare;
}
sliceCaseReducersByName[reducerName] = caseReducer;
sliceCaseReducersByType[type] = caseReducer;
actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
});
function buildReducer() {
if (process.env.NODE_ENV !== "production") {
if (typeof options.extraReducers === "object") {
if (!hasWarnedAboutObjectNotation2) {
hasWarnedAboutObjectNotation2 = true;
console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
}
}
}
var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;
var finalCaseReducers = __spreadValues$2(__spreadValues$2({}, extraReducers), sliceCaseReducersByType);
return createReducer(initialState2, function(builder) {
for (var key in finalCaseReducers) {
builder.addCase(key, finalCaseReducers[key]);
}
for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
var m = actionMatchers_1[_i];
builder.addMatcher(m.matcher, m.reducer);
}
if (defaultCaseReducer) {
builder.addDefaultCase(defaultCaseReducer);
}
});
}
var _reducer;
return {
name,
reducer: function(state, action) {
if (!_reducer)
_reducer = buildReducer();
return _reducer(state, action);
},
actions: actionCreators,
caseReducers: sliceCaseReducersByName,
getInitialState: function() {
if (!_reducer)
_reducer = buildReducer();
return _reducer.getInitialState();
}
};
}
var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
var nanoid = function(size) {
if (size === void 0) {
size = 21;
}
var id = "";
var i = size;
while (i--) {
id += urlAlphabet[Math.random() * 64 | 0];
}
return id;
};
var commonProperties = [
"name",
"message",
"stack",
"code"
];
var RejectWithValue = (
/** @class */
/* @__PURE__ */ function() {
function RejectWithValue2(payload, meta) {
this.payload = payload;
this.meta = meta;
}
return RejectWithValue2;
}()
);
var FulfillWithMeta = (
/** @class */
/* @__PURE__ */ function() {
function FulfillWithMeta2(payload, meta) {
this.payload = payload;
this.meta = meta;
}
return FulfillWithMeta2;
}()
);
var miniSerializeError = function(value) {
if (typeof value === "object" && value !== null) {
var simpleError = {};
for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
var property = commonProperties_1[_i];
if (typeof value[property] === "string") {
simpleError[property] = value[property];
}
}
return simpleError;
}
return { message: String(value) };
};
var createAsyncThunk = function() {
function createAsyncThunk2(typePrefix, payloadCreator, options) {
var fulfilled = createAction(typePrefix + "/fulfilled", function(payload, requestId, arg, meta) {
return {
payload,
meta: __spreadProps$2(__spreadValues$2({}, meta || {}), {
arg,
requestId,
requestStatus: "fulfilled"
})
};
});
var pending = createAction(typePrefix + "/pending", function(requestId, arg, meta) {
return {
payload: void 0,
meta: __spreadProps$2(__spreadValues$2({}, meta || {}), {
arg,
requestId,
requestStatus: "pending"
})
};
});
var rejected = createAction(typePrefix + "/rejected", function(error, requestId, arg, payload, meta) {
return {
payload,
error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
meta: __spreadProps$2(__spreadValues$2({}, meta || {}), {
arg,
requestId,
rejectedWithValue: !!payload,
requestStatus: "rejected",
aborted: (error == null ? void 0 : error.name) === "AbortError",
condition: (error == null ? void 0 : error.name) === "ConditionError"
})
};
});
var displayedWarning = false;
var AC = typeof AbortController !== "undefined" ? AbortController : (
/** @class */
function() {
function class_1() {
this.signal = {
aborted: false,
addEventListener: function() {
},
dispatchEvent: function() {
return false;
},
onabort: function() {
},
removeEventListener: function() {
},
reason: void 0,
throwIfAborted: function() {
}
};
}
class_1.prototype.abort = function() {
if (process.env.NODE_ENV !== "production") {
if (!displayedWarning) {
displayedWarning = true;
console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.");
}
}
};
return class_1;
}()
);
function actionCreator(arg) {
return function(dispatch, getState, extra) {
var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
var abortController = new AC();
var abortReason;
function abort(reason) {
abortReason = reason;
abortController.abort();
}
var promise2 = function() {
return __async$1(this, null, function() {
var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
return __generator$1(this, function(_c) {
switch (_c.label) {
case 0:
_c.trys.push([0, 4, , 5]);
conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState, extra });
if (!isThenable$1(conditionResult)) return [3, 2];
return [4, conditionResult];
case 1:
conditionResult = _c.sent();
_c.label = 2;
case 2:
if (conditionResult === false || abortController.signal.aborted) {
throw {
name: "ConditionError",
message: "Aborted due to condition callback returning false."
};
}
abortedPromise = new Promise(function(_, reject) {
return abortController.signal.addEventListener("abort", function() {
return reject({
name: "AbortError",
message: abortReason || "Aborted"
});
});
});
dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId, arg }, { getState, extra })));
return [4, Promise.race([
abortedPromise,
Promise.resolve(payloadCreator(arg, {
dispatch,
getState,
extra,
requestId,
signal: abortController.signal,
abort,
rejectWithValue: function(value, meta) {
return new RejectWithValue(value, meta);
},
fulfillWithValue: function(value, meta) {
return new FulfillWithMeta(value, meta);
}
})).then(function(result) {
if (result instanceof RejectWithValue) {
throw result;
}
if (result instanceof FulfillWithMeta) {
return fulfilled(result.payload, requestId, arg, result.meta);
}
return fulfilled(result, requestId, arg);
})
])];
case 3:
finalAction = _c.sent();
return [3, 5];
case 4:
err_1 = _c.sent();
finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
return [3, 5];
case 5:
skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
if (!skipDispatch) {
dispatch(finalAction);
}
return [2, finalAction];
}
});
});
}();
return Object.assign(promise2, {
abort,
requestId,
arg,
unwrap: function() {
return promise2.then(unwrapResult);
}
});
};
}
return Object.assign(actionCreator, {
pending,
rejected,
fulfilled,
typePrefix
});
}
createAsyncThunk2.withTypes = function() {
return createAsyncThunk2;
};
return createAsyncThunk2;
}();
function unwrapResult(action) {
if (action.meta && action.meta.rejectedWithValue) {
throw action.payload;
}
if (action.error) {
throw action.error;
}
return action.payload;
}
function isThenable$1(value) {
return value !== null && typeof value === "object" && typeof value.then === "function";
}
var matches = function(matcher, action) {
if (hasMatchFunction(matcher)) {
return matcher.match(action);
} else {
return matcher(action);
}
};
function isAnyOf() {
var matchers = [];
for (var _i = 0; _i < arguments.length; _i++) {
matchers[_i] = arguments[_i];
}
return function(action) {
return matchers.some(function(matcher) {
return matches(matcher, action);
});
};
}
function isAllOf() {
var matchers = [];
for (var _i = 0; _i < arguments.length; _i++) {
matchers[_i] = arguments[_i];
}
return function(action) {
return matchers.every(function(matcher) {
return matches(matcher, action);
});
};
}
function hasExpectedRequestMetadata(action, validStatus) {
if (!action || !action.meta)
return false;
var hasValidRequestId = typeof action.meta.requestId === "string";
var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
return hasValidRequestId && hasValidRequestStatus;
}
function isAsyncThunkArray(a2) {
return typeof a2[0] === "function" && "pending" in a2[0] && "fulfilled" in a2[0] && "rejected" in a2[0];
}
function isPending() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
if (asyncThunks.length === 0) {
return function(action) {
return hasExpectedRequestMetadata(action, ["pending"]);
};
}
if (!isAsyncThunkArray(asyncThunks)) {
return isPending()(asyncThunks[0]);
}
return function(action) {
var matchers = asyncThunks.map(function(asyncThunk) {
return asyncThunk.pending;
});
var combinedMatcher = isAnyOf.apply(void 0, matchers);
return combinedMatcher(action);
};
}
function isRejected() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
if (asyncThunks.length === 0) {
return function(action) {
return hasExpectedRequestMetadata(action, ["rejected"]);
};
}
if (!isAsyncThunkArray(asyncThunks)) {
return isRejected()(asyncThunks[0]);
}
return function(action) {
var matchers = asyncThunks.map(function(asyncThunk) {
return asyncThunk.rejected;
});
var combinedMatcher = isAnyOf.apply(void 0, matchers);
return combinedMatcher(action);
};
}
function isRejectedWithValue() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
var hasFlag = function(action) {
return action && action.meta && action.meta.rejectedWithValue;
};
if (asyncThunks.length === 0) {
return function(action) {
var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
return combinedMatcher(action);
};
}
if (!isAsyncThunkArray(asyncThunks)) {
return isRejectedWithValue()(asyncThunks[0]);
}
return function(action) {
var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
return combinedMatcher(action);
};
}
function isFulfilled() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
if (asyncThunks.length === 0) {
return function(action) {
return hasExpectedRequestMetadata(action, ["fulfilled"]);
};
}
if (!isAsyncThunkArray(asyncThunks)) {
return isFulfilled()(asyncThunks[0]);
}
return function(action) {
var matchers = asyncThunks.map(function(asyncThunk) {
return asyncThunk.fulfilled;
});
var combinedMatcher = isAnyOf.apply(void 0, matchers);
return combinedMatcher(action);
};
}
function isAsyncThunkAction() {
var asyncThunks = [];
for (var _i = 0; _i < arguments.length; _i++) {
asyncThunks[_i] = arguments[_i];
}
if (asyncThunks.length === 0) {
return function(action) {
return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]);
};
}
if (!isAsyncThunkArray(asyncThunks)) {
return isAsyncThunkAction()(asyncThunks[0]);
}
return function(action) {
var matchers = [];
for (var _i2 = 0, asyncThunks_1 = asyncThunks; _i2 < asyncThunks_1.length; _i2++) {
var asyncThunk = asyncThunks_1[_i2];
matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
}
var combinedMatcher = isAnyOf.apply(void 0, matchers);
return combinedMatcher(action);
};
}
var alm = "listenerMiddleware";
createAction(alm + "/add");
createAction(alm + "/removeAll");
createAction(alm + "/remove");
var SHOULD_AUTOBATCH = "RTK_autoBatch";
var prepareAutoBatched = function() {
return function(payload) {
var _c;
return {
payload,
meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)
};
};
};
var promise$1;
typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : globalThis) : function(cb) {
return (promise$1 || (promise$1 = Promise.resolve())).then(cb).catch(function(err) {
return setTimeout(function() {
throw err;
}, 0);
});
};
enableES5();
var __generator = function(thisArg, body) {
var _ = { label: 0, sent: function() {
if (t[0] & 1) throw t[1];
return t[1];
}, trys: [], ops: [] }, f2, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
return this;
}), g;
function verb(n) {
return function(v2) {
return step([n, v2]);
};
}
function step(op) {
if (f2) throw new TypeError("Generator is already executing.");
while (_) try {
if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f2 = t = 0;
}
if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArray$1 = function(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
var __defProp$1 = Object.defineProperty;
var __defProps$1 = Object.defineProperties;
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
var __defNormalProp$1 = function(obj, key, value) {
return key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
};
var __spreadValues$1 = function(a2, b) {
for (var prop in b || (b = {}))
if (__hasOwnProp$1.call(b, prop))
__defNormalProp$1(a2, prop, b[prop]);
if (__getOwnPropSymbols$1)
for (var _j = 0, _k = __getOwnPropSymbols$1(b); _j < _k.length; _j++) {
var prop = _k[_j];
if (__propIsEnum$1.call(b, prop))
__defNormalProp$1(a2, prop, b[prop]);
}
return a2;
};
var __spreadProps$1 = function(a2, b) {
return __defProps$1(a2, __getOwnPropDescs$1(b));
};
var __async = function(__this, __arguments, generator) {
return new Promise(function(resolve, reject) {
var fulfilled = function(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = function(value) {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = function(x) {
return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
};
step((generator = generator.apply(__this, __arguments)).next());
});
};
var QueryStatus;
(function(QueryStatus2) {
QueryStatus2["uninitialized"] = "uninitialized";
QueryStatus2["pending"] = "pending";
QueryStatus2["fulfilled"] = "fulfilled";
QueryStatus2["rejected"] = "rejected";
})(QueryStatus || (QueryStatus = {}));
function getRequestStatusFlags(status) {
return {
status,
isUninitialized: status === QueryStatus.uninitialized,
isLoading: status === QueryStatus.pending,
isSuccess: status === QueryStatus.fulfilled,
isError: status === QueryStatus.rejected
};
}
var flatten = function(arr) {
return [].concat.apply([], arr);
};
function isOnline() {
return typeof navigator === "undefined" ? true : navigator.onLine === void 0 ? true : navigator.onLine;
}
function isDocumentVisible() {
if (typeof document === "undefined") {
return true;
}
return document.visibilityState !== "hidden";
}
var isPlainObject$2 = isPlainObject$3;
function copyWithStructuralSharing(oldObj, newObj) {
if (oldObj === newObj || !(isPlainObject$2(oldObj) && isPlainObject$2(newObj) || Array.isArray(oldObj) && Array.isArray(newObj))) {
return newObj;
}
var newKeys = Object.keys(newObj);
var oldKeys = Object.keys(oldObj);
var isSameObject = newKeys.length === oldKeys.length;
var mergeObj = Array.isArray(newObj) ? [] : {};
for (var _j = 0, newKeys_1 = newKeys; _j < newKeys_1.length; _j++) {
var key = newKeys_1[_j];
mergeObj[key] = copyWithStructuralSharing(oldObj[key], newObj[key]);
if (isSameObject)
isSameObject = oldObj[key] === mergeObj[key];
}
return isSameObject ? oldObj : mergeObj;
}
var HandledError = (
/** @class */
/* @__PURE__ */ function() {
function HandledError2(value, meta) {
if (meta === void 0) {
meta = void 0;
}
this.value = value;
this.meta = meta;
}
return HandledError2;
}()
);
var onFocus = /* @__PURE__ */ createAction("__rtkq/focused");
var onFocusLost = /* @__PURE__ */ createAction("__rtkq/unfocused");
var onOnline = /* @__PURE__ */ createAction("__rtkq/online");
var onOffline = /* @__PURE__ */ createAction("__rtkq/offline");
var DefinitionType$1;
(function(DefinitionType2) {
DefinitionType2["query"] = "query";
DefinitionType2["mutation"] = "mutation";
})(DefinitionType$1 || (DefinitionType$1 = {}));
function isQueryDefinition$1(e) {
return e.type === DefinitionType$1.query;
}
function isMutationDefinition$1(e) {
return e.type === DefinitionType$1.mutation;
}
function calculateProvidedBy(description, result, error, queryArg, meta, assertTagTypes) {
if (isFunction$1(description)) {
return description(result, error, queryArg, meta).map(expandTagDescription).map(assertTagTypes);
}
if (Array.isArray(description)) {
return description.map(expandTagDescription).map(assertTagTypes);
}
return [];
}
function isFunction$1(t) {
return typeof t === "function";
}
function expandTagDescription(description) {
return typeof description === "string" ? { type: description } : description;
}
function isNotNullish(v2) {
return v2 != null;
}
var forceQueryFnSymbol = Symbol("forceQueryFn");
var isUpsertQuery = function(arg) {
return typeof arg[forceQueryFnSymbol] === "function";
};
function buildInitiate(_j) {
var serializeQueryArgs = _j.serializeQueryArgs, queryThunk = _j.queryThunk, mutationThunk = _j.mutationThunk, api = _j.api, context = _j.context;
var runningQueries = /* @__PURE__ */ new Map();
var runningMutations = /* @__PURE__ */ new Map();
var _k = api.internalActions, unsubscribeQueryResult = _k.unsubscribeQueryResult, removeMutationResult = _k.removeMutationResult, updateSubscriptionOptions = _k.updateSubscriptionOptions;
return {
buildInitiateQuery,
buildInitiateMutation,
getRunningQueryThunk,
getRunningMutationThunk,
getRunningQueriesThunk,
getRunningMutationsThunk,
getRunningOperationPromises,
removalWarning
};
function removalWarning() {
throw new Error("This method had to be removed due to a conceptual bug in RTK.\n Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.\n See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.");
}
function getRunningOperationPromises() {
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
removalWarning();
} else {
var extract = function(v2) {
return Array.from(v2.values()).flatMap(function(queriesForStore) {
return queriesForStore ? Object.values(queriesForStore) : [];
});
};
return __spreadArray$1(__spreadArray$1([], extract(runningQueries)), extract(runningMutations)).filter(isNotNullish);
}
}
function getRunningQueryThunk(endpointName, queryArgs) {
return function(dispatch) {
var _a;
var endpointDefinition = context.endpointDefinitions[endpointName];
var queryCacheKey = serializeQueryArgs({
queryArgs,
endpointDefinition,
endpointName
});
return (_a = runningQueries.get(dispatch)) == null ? void 0 : _a[queryCacheKey];
};
}
function getRunningMutationThunk(_endpointName, fixedCacheKeyOrRequestId) {
return function(dispatch) {
var _a;
return (_a = runningMutations.get(dispatch)) == null ? void 0 : _a[fixedCacheKeyOrRequestId];
};
}
function getRunningQueriesThunk() {
return function(dispatch) {
return Object.values(runningQueries.get(dispatch) || {}).filter(isNotNullish);
};
}
function getRunningMutationsThunk() {
return function(dispatch) {
return Object.values(runningMutations.get(dispatch) || {}).filter(isNotNullish);
};
}
function middlewareWarning(dispatch) {
if (process.env.NODE_ENV !== "production") {
if (middlewareWarning.triggered)
return;
var registered = dispatch(api.internalActions.internal_probeSubscription({
queryCacheKey: "DOES_NOT_EXIST",
requestId: "DUMMY_REQUEST_ID"
}));
middlewareWarning.triggered = true;
if (typeof registered !== "boolean") {
throw new Error('Warning: Middleware for RTK-Query API at reducerPath "' + api.reducerPath + '" has not been added to the store.\nYou must add the middleware for RTK-Query to function correctly!');
}
}
}
function buildInitiateQuery(endpointName, endpointDefinition) {
var queryAction = function(arg, _j2) {
var _k2 = _j2 === void 0 ? {} : _j2, _l = _k2.subscribe, subscribe = _l === void 0 ? true : _l, forceRefetch = _k2.forceRefetch, subscriptionOptions = _k2.subscriptionOptions, _m = forceQueryFnSymbol, forceQueryFn = _k2[_m];
return function(dispatch, getState) {
var _j3;
var _a;
var queryCacheKey = serializeQueryArgs({
queryArgs: arg,
endpointDefinition,
endpointName
});
var thunk = queryThunk((_j3 = {
type: "query",
subscribe,
forceRefetch,
subscriptionOptions,
endpointName,
originalArgs: arg,
queryCacheKey
}, _j3[forceQueryFnSymbol] = forceQueryFn, _j3));
var selector = api.endpoints[endpointName].select(arg);
var thunkResult = dispatch(thunk);
var stateAfter = selector(getState());
middlewareWarning(dispatch);
var requestId = thunkResult.requestId, abort = thunkResult.abort;
var skippedSynchronously = stateAfter.requestId !== requestId;
var runningQuery = (_a = runningQueries.get(dispatch)) == null ? void 0 : _a[queryCacheKey];
var selectFromState = function() {
return selector(getState());
};
var statePromise = Object.assign(forceQueryFn ? thunkResult.then(selectFromState) : skippedSynchronously && !runningQuery ? Promise.resolve(stateAfter) : Promise.all([runningQuery, thunkResult]).then(selectFromState), {
arg,
requestId,
subscriptionOptions,
queryCacheKey,
abort,
unwrap: function() {
return __async(this, null, function() {
var result;
return __generator(this, function(_j4) {
switch (_j4.label) {
case 0:
return [4, statePromise];
case 1:
result = _j4.sent();
if (result.isError) {
throw result.error;
}
return [2, result.data];
}
});
});
},
refetch: function() {
return dispatch(queryAction(arg, { subscribe: false, forceRefetch: true }));
},
unsubscribe: function() {
if (subscribe)
dispatch(unsubscribeQueryResult({
queryCacheKey,
requestId
}));
},
updateSubscriptionOptions: function(options) {
statePromise.subscriptionOptions = options;
dispatch(updateSubscriptionOptions({
endpointName,
requestId,
queryCacheKey,
options
}));
}
});
if (!runningQuery && !skippedSynchronously && !forceQueryFn) {
var running_1 = runningQueries.get(dispatch) || {};
running_1[queryCacheKey] = statePromise;
runningQueries.set(dispatch, running_1);
statePromise.then(function() {
delete running_1[queryCacheKey];
if (!Object.keys(running_1).length) {
runningQueries.delete(dispatch);
}
});
}
return statePromise;
};
};
return queryAction;
}
function buildInitiateMutation(endpointName) {
return function(arg, _j2) {
var _k2 = _j2 === void 0 ? {} : _j2, _l = _k2.track, track = _l === void 0 ? true : _l, fixedCacheKey = _k2.fixedCacheKey;
return function(dispatch, getState) {
var thunk = mutationThunk({
type: "mutation",
endpointName,
originalArgs: arg,
track,
fixedCacheKey
});
var thunkResult = dispatch(thunk);
middlewareWarning(dispatch);
var requestId = thunkResult.requestId, abort = thunkResult.abort, unwrap = thunkResult.unwrap;
var returnValuePromise = thunkResult.unwrap().then(function(data) {
return { data };
}).catch(function(error) {
return { error };
});
var reset = function() {
dispatch(removeMutationResult({ requestId, fixedCacheKey }));
};
var ret = Object.assign(returnValuePromise, {
arg: thunkResult.arg,
requestId,
abort,
unwrap,
unsubscribe: reset,
reset
});
var running = runningMutations.get(dispatch) || {};
runningMutations.set(dispatch, running);
running[requestId] = ret;
ret.then(function() {
delete running[requestId];
if (!Object.keys(running).length) {
runningMutations.delete(dispatch);
}
});
if (fixedCacheKey) {
running[fixedCacheKey] = ret;
ret.then(function() {
if (running[fixedCacheKey] === ret) {
delete running[fixedCacheKey];
if (!Object.keys(running).length) {
runningMutations.delete(dispatch);
}
}
});
}
return ret;
};
};
}
}
function defaultTransformResponse(baseQueryReturnValue) {
return baseQueryReturnValue;
}
function buildThunks(_j) {
var _this = this;
var reducerPath = _j.reducerPath, baseQuery = _j.baseQuery, endpointDefinitions = _j.context.endpointDefinitions, serializeQueryArgs = _j.serializeQueryArgs, api = _j.api, assertTagType = _j.assertTagType;
var patchQueryData = function(endpointName, args, patches, updateProvided) {
return function(dispatch, getState) {
var endpointDefinition = endpointDefinitions[endpointName];
var queryCacheKey = serializeQueryArgs({
queryArgs: args,
endpointDefinition,
endpointName
});
dispatch(api.internalActions.queryResultPatched({ queryCacheKey, patches }));
if (!updateProvided) {
return;
}
var newValue = api.endpoints[endpointName].select(args)(getState());
var providedTags = calculateProvidedBy(endpointDefinition.providesTags, newValue.data, void 0, args, {}, assertTagType);
dispatch(api.internalActions.updateProvidedBy({ queryCacheKey, providedTags }));
};
};
var updateQueryData = function(endpointName, args, updateRecipe, updateProvided) {
if (updateProvided === void 0) {
updateProvided = true;
}
return function(dispatch, getState) {
var _j2, _k;
var endpointDefinition = api.endpoints[endpointName];
var currentState = endpointDefinition.select(args)(getState());
var ret = {
patches: [],
inversePatches: [],
undo: function() {
return dispatch(api.util.patchQueryData(endpointName, args, ret.inversePatches, updateProvided));
}
};
if (currentState.status === QueryStatus.uninitialized) {
return ret;
}
var newValue;
if ("data" in currentState) {
if (isDraftable(currentState.data)) {
var _l = produceWithPatches(currentState.data, updateRecipe), value = _l[0], patches = _l[1], inversePatches = _l[2];
(_j2 = ret.patches).push.apply(_j2, patches);
(_k = ret.inversePatches).push.apply(_k, inversePatches);
newValue = value;
} else {
newValue = updateRecipe(currentState.data);
ret.patches.push({ op: "replace", path: [], value: newValue });
ret.inversePatches.push({
op: "replace",
path: [],
value: currentState.data
});
}
}
dispatch(api.util.patchQueryData(endpointName, args, ret.patches, updateProvided));
return ret;
};
};
var upsertQueryData = function(endpointName, args, value) {
return function(dispatch) {
var _j2;
return dispatch(api.endpoints[endpointName].initiate(args, (_j2 = {
subscribe: false,
forceRefetch: true
}, _j2[forceQueryFnSymbol] = function() {
return {
data: value
};
}, _j2)));
};
};
var executeEndpoint = function(_0, _1) {
return __async(_this, [_0, _1], function(arg, _j2) {
var endpointDefinition, transformResponse2, result, baseQueryApi_1, forceQueryFn, what, err, _k, _l, key, _m, error_1, catchedError, transformErrorResponse, _o, e_4;
var _p, _q;
var signal = _j2.signal, abort = _j2.abort, rejectWithValue = _j2.rejectWithValue, fulfillWithValue = _j2.fulfillWithValue, dispatch = _j2.dispatch, getState = _j2.getState, extra = _j2.extra;
return __generator(this, function(_r) {
switch (_r.label) {
case 0:
endpointDefinition = endpointDefinitions[arg.endpointName];
_r.label = 1;
case 1:
_r.trys.push([1, 8, , 13]);
transformResponse2 = defaultTransformResponse;
result = void 0;
baseQueryApi_1 = {
signal,
abort,
dispatch,
getState,
extra,
endpoint: arg.endpointName,
type: arg.type,
forced: arg.type === "query" ? isForcedQuery(arg, getState()) : void 0
};
forceQueryFn = arg.type === "query" ? arg[forceQueryFnSymbol] : void 0;
if (!forceQueryFn) return [3, 2];
result = forceQueryFn();
return [3, 6];
case 2:
if (!endpointDefinition.query) return [3, 4];
return [4, baseQuery(endpointDefinition.query(arg.originalArgs), baseQueryApi_1, endpointDefinition.extraOptions)];
case 3:
result = _r.sent();
if (endpointDefinition.transformResponse) {
transformResponse2 = endpointDefinition.transformResponse;
}
return [3, 6];
case 4:
return [4, endpointDefinition.queryFn(arg.originalArgs, baseQueryApi_1, endpointDefinition.extraOptions, function(arg2) {
return baseQuery(arg2, baseQueryApi_1, endpointDefinition.extraOptions);
})];
case 5:
result = _r.sent();
_r.label = 6;
case 6:
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
what = endpointDefinition.query ? "`baseQuery`" : "`queryFn`";
err = void 0;
if (!result) {
err = what + " did not return anything.";
} else if (typeof result !== "object") {
err = what + " did not return an object.";
} else if (result.error && result.data) {
err = what + " returned an object containing both `error` and `result`.";
} else if (result.error === void 0 && result.data === void 0) {
err = what + " returned an object containing neither a valid `error` and `result`. At least one of them should not be `undefined`";
} else {
for (_k = 0, _l = Object.keys(result); _k < _l.length; _k++) {
key = _l[_k];
if (key !== "error" && key !== "data" && key !== "meta") {
err = "The object returned by " + what + " has the unknown property " + key + ".";
break;
}
}
}
if (err) {
console.error("Error encountered handling the endpoint " + arg.endpointName + ".\n " + err + "\n It needs to return an object with either the shape `{ data: <value> }` or `{ error: <value> }` that may contain an optional `meta` property.\n Object returned was:", result);
}
}
if (result.error)
throw new HandledError(result.error, result.meta);
_m = fulfillWithValue;
return [4, transformResponse2(result.data, result.meta, arg.originalArgs)];
case 7:
return [2, _m.apply(void 0, [_r.sent(), (_p = {
fulfilledTimeStamp: Date.now(),
baseQueryMeta: result.meta
}, _p[SHOULD_AUTOBATCH] = true, _p)])];
case 8:
error_1 = _r.sent();
catchedError = error_1;
if (!(catchedError instanceof HandledError)) return [3, 12];
transformErrorResponse = defaultTransformResponse;
if (endpointDefinition.query && endpointDefinition.transformErrorResponse) {
transformErrorResponse = endpointDefinition.transformErrorResponse;
}
_r.label = 9;
case 9:
_r.trys.push([9, 11, , 12]);
_o = rejectWithValue;
return [4, transformErrorResponse(catchedError.value, catchedError.meta, arg.originalArgs)];
case 10:
return [2, _o.apply(void 0, [_r.sent(), (_q = { baseQueryMeta: catchedError.meta }, _q[SHOULD_AUTOBATCH] = true, _q)])];
case 11:
e_4 = _r.sent();
catchedError = e_4;
return [3, 12];
case 12:
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
console.error('An unhandled error occurred processing a request for the endpoint "' + arg.endpointName + '".\nIn the case of an unhandled error, no tags will be "provided" or "invalidated".', catchedError);
} else {
console.error(catchedError);
}
throw catchedError;
case 13:
return [
2
/*return*/
];
}
});
});
};
function isForcedQuery(arg, state) {
var _a, _b, _c, _d;
var requestState = (_b = (_a = state[reducerPath]) == null ? void 0 : _a.queries) == null ? void 0 : _b[arg.queryCacheKey];
var baseFetchOnMountOrArgChange = (_c = state[reducerPath]) == null ? void 0 : _c.config.refetchOnMountOrArgChange;
var fulfilledVal = requestState == null ? void 0 : requestState.fulfilledTimeStamp;
var refetchVal = (_d = arg.forceRefetch) != null ? _d : arg.subscribe && baseFetchOnMountOrArgChange;
if (refetchVal) {
return refetchVal === true || (Number(/* @__PURE__ */ new Date()) - Number(fulfilledVal)) / 1e3 >= refetchVal;
}
return false;
}
var queryThunk = createAsyncThunk(reducerPath + "/executeQuery", executeEndpoint, {
getPendingMeta: function() {
var _j2;
return _j2 = { startedTimeStamp: Date.now() }, _j2[SHOULD_AUTOBATCH] = true, _j2;
},
condition: function(queryThunkArgs, _j2) {
var getState = _j2.getState;
var _a, _b, _c;
var state = getState();
var requestState = (_b = (_a = state[reducerPath]) == null ? void 0 : _a.queries) == null ? void 0 : _b[queryThunkArgs.queryCacheKey];
var fulfilledVal = requestState == null ? void 0 : requestState.fulfilledTimeStamp;
var currentArg = queryThunkArgs.originalArgs;
var previousArg = requestState == null ? void 0 : requestState.originalArgs;
var endpointDefinition = endpointDefinitions[queryThunkArgs.endpointName];
if (isUpsertQuery(queryThunkArgs)) {
return true;
}
if ((requestState == null ? void 0 : requestState.status) === "pending") {
return false;
}
if (isForcedQuery(queryThunkArgs, state)) {
return true;
}
if (isQueryDefinition$1(endpointDefinition) && ((_c = endpointDefinition == null ? void 0 : endpointDefinition.forceRefetch) == null ? void 0 : _c.call(endpointDefinition, {
currentArg,
previousArg,
endpointState: requestState,
state
}))) {
return true;
}
if (fulfilledVal) {
return false;
}
return true;
},
dispatchConditionRejection: true
});
var mutationThunk = createAsyncThunk(reducerPath + "/executeMutation", executeEndpoint, {
getPendingMeta: function() {
var _j2;
return _j2 = { startedTimeStamp: Date.now() }, _j2[SHOULD_AUTOBATCH] = true, _j2;
}
});
var hasTheForce = function(options) {
return "force" in options;
};
var hasMaxAge = function(options) {
return "ifOlderThan" in options;
};
var prefetch = function(endpointName, arg, options) {
return function(dispatch, getState) {
var force = hasTheForce(options) && options.force;
var maxAge = hasMaxAge(options) && options.ifOlderThan;
var queryAction = function(force2) {
if (force2 === void 0) {
force2 = true;
}
return api.endpoints[endpointName].initiate(arg, { forceRefetch: force2 });
};
var latestStateValue = api.endpoints[endpointName].select(arg)(getState());
if (force) {
dispatch(queryAction());
} else if (maxAge) {
var lastFulfilledTs = latestStateValue == null ? void 0 : latestStateValue.fulfilledTimeStamp;
if (!lastFulfilledTs) {
dispatch(queryAction());
return;
}
var shouldRetrigger = (Number(/* @__PURE__ */ new Date()) - Number(new Date(lastFulfilledTs))) / 1e3 >= maxAge;
if (shouldRetrigger) {
dispatch(queryAction());
}
} else {
dispatch(queryAction(false));
}
};
};
function matchesEndpoint(endpointName) {
return function(action) {
var _a, _b;
return ((_b = (_a = action == null ? void 0 : action.meta) == null ? void 0 : _a.arg) == null ? void 0 : _b.endpointName) === endpointName;
};
}
function buildMatchThunkActions(thunk, endpointName) {
return {
matchPending: isAllOf(isPending(thunk), matchesEndpoint(endpointName)),
matchFulfilled: isAllOf(isFulfilled(thunk), matchesEndpoint(endpointName)),
matchRejected: isAllOf(isRejected(thunk), matchesEndpoint(endpointName))
};
}
return {
queryThunk,
mutationThunk,
prefetch,
updateQueryData,
upsertQueryData,
patchQueryData,
buildMatchThunkActions
};
}
function calculateProvidedByThunk(action, type, endpointDefinitions, assertTagType) {
return calculateProvidedBy(endpointDefinitions[action.meta.arg.endpointName][type], isFulfilled(action) ? action.payload : void 0, isRejectedWithValue(action) ? action.payload : void 0, action.meta.arg.originalArgs, "baseQueryMeta" in action.meta ? action.meta.baseQueryMeta : void 0, assertTagType);
}
function updateQuerySubstateIfExists(state, queryCacheKey, update) {
var substate = state[queryCacheKey];
if (substate) {
update(substate);
}
}
function getMutationCacheKey(id) {
var _a;
return (_a = "arg" in id ? id.arg.fixedCacheKey : id.fixedCacheKey) != null ? _a : id.requestId;
}
function updateMutationSubstateIfExists(state, id, update) {
var substate = state[getMutationCacheKey(id)];
if (substate) {
update(substate);
}
}
var initialState$2 = {};
function buildSlice(_j) {
var reducerPath = _j.reducerPath, queryThunk = _j.queryThunk, mutationThunk = _j.mutationThunk, _k = _j.context, definitions = _k.endpointDefinitions, apiUid = _k.apiUid, extractRehydrationInfo = _k.extractRehydrationInfo, hasRehydrationInfo = _k.hasRehydrationInfo, assertTagType = _j.assertTagType, config = _j.config;
var resetApiState = createAction(reducerPath + "/resetApiState");
var querySlice = createSlice({
name: reducerPath + "/queries",
initialState: initialState$2,
reducers: {
removeQueryResult: {
reducer: function(draft, _j2) {
var queryCacheKey = _j2.payload.queryCacheKey;
delete draft[queryCacheKey];
},
prepare: prepareAutoBatched()
},
queryResultPatched: {
reducer: function(draft, _j2) {
var _k2 = _j2.payload, queryCacheKey = _k2.queryCacheKey, patches = _k2.patches;
updateQuerySubstateIfExists(draft, queryCacheKey, function(substate) {
substate.data = applyPatches(substate.data, patches.concat());
});
},
prepare: prepareAutoBatched()
}
},
extraReducers: function(builder) {
builder.addCase(queryThunk.pending, function(draft, _j2) {
var meta = _j2.meta, arg = _j2.meta.arg;
var _a, _b;
var upserting = isUpsertQuery(arg);
if (arg.subscribe || upserting) {
(_b = draft[_a = arg.queryCacheKey]) != null ? _b : draft[_a] = {
status: QueryStatus.uninitialized,
endpointName: arg.endpointName
};
}
updateQuerySubstateIfExists(draft, arg.queryCacheKey, function(substate) {
substate.status = QueryStatus.pending;
substate.requestId = upserting && substate.requestId ? substate.requestId : meta.requestId;
if (arg.originalArgs !== void 0) {
substate.originalArgs = arg.originalArgs;
}
substate.startedTimeStamp = meta.startedTimeStamp;
});
}).addCase(queryThunk.fulfilled, function(draft, _j2) {
var meta = _j2.meta, payload = _j2.payload;
updateQuerySubstateIfExists(draft, meta.arg.queryCacheKey, function(substate) {
var _a;
if (substate.requestId !== meta.requestId && !isUpsertQuery(meta.arg))
return;
var merge2 = definitions[meta.arg.endpointName].merge;
substate.status = QueryStatus.fulfilled;
if (merge2) {
if (substate.data !== void 0) {
var fulfilledTimeStamp_1 = meta.fulfilledTimeStamp, arg_1 = meta.arg, baseQueryMeta_1 = meta.baseQueryMeta, requestId_1 = meta.requestId;
var newData = createNextState2(substate.data, function(draftSubstateData) {
return merge2(draftSubstateData, payload, {
arg: arg_1.originalArgs,
baseQueryMeta: baseQueryMeta_1,
fulfilledTimeStamp: fulfilledTimeStamp_1,
requestId: requestId_1
});
});
substate.data = newData;
} else {
substate.data = payload;
}
} else {
substate.data = ((_a = definitions[meta.arg.endpointName].structuralSharing) != null ? _a : true) ? copyWithStructuralSharing(isDraft(substate.data) ? original(substate.data) : substate.data, payload) : payload;
}
delete substate.error;
substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;
});
}).addCase(queryThunk.rejected, function(draft, _j2) {
var _k2 = _j2.meta, condition = _k2.condition, arg = _k2.arg, requestId = _k2.requestId, error = _j2.error, payload = _j2.payload;
updateQuerySubstateIfExists(draft, arg.queryCacheKey, function(substate) {
if (condition) ;
else {
if (substate.requestId !== requestId)
return;
substate.status = QueryStatus.rejected;
substate.error = payload != null ? payload : error;
}
});
}).addMatcher(hasRehydrationInfo, function(draft, action) {
var queries = extractRehydrationInfo(action).queries;
for (var _j2 = 0, _k2 = Object.entries(queries); _j2 < _k2.length; _j2++) {
var _l = _k2[_j2], key = _l[0], entry = _l[1];
if ((entry == null ? void 0 : entry.status) === QueryStatus.fulfilled || (entry == null ? void 0 : entry.status) === QueryStatus.rejected) {
draft[key] = entry;
}
}
});
}
});
var mutationSlice = createSlice({
name: reducerPath + "/mutations",
initialState: initialState$2,
reducers: {
removeMutationResult: {
reducer: function(draft, _j2) {
var payload = _j2.payload;
var cacheKey = getMutationCacheKey(payload);
if (cacheKey in draft) {
delete draft[cacheKey];
}
},
prepare: prepareAutoBatched()
}
},
extraReducers: function(builder) {
builder.addCase(mutationThunk.pending, function(draft, _j2) {
var meta = _j2.meta, _k2 = _j2.meta, requestId = _k2.requestId, arg = _k2.arg, startedTimeStamp = _k2.startedTimeStamp;
if (!arg.track)
return;
draft[getMutationCacheKey(meta)] = {
requestId,
status: QueryStatus.pending,
endpointName: arg.endpointName,
startedTimeStamp
};
}).addCase(mutationThunk.fulfilled, function(draft, _j2) {
var payload = _j2.payload, meta = _j2.meta;
if (!meta.arg.track)
return;
updateMutationSubstateIfExists(draft, meta, function(substate) {
if (substate.requestId !== meta.requestId)
return;
substate.status = QueryStatus.fulfilled;
substate.data = payload;
substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;
});
}).addCase(mutationThunk.rejected, function(draft, _j2) {
var payload = _j2.payload, error = _j2.error, meta = _j2.meta;
if (!meta.arg.track)
return;
updateMutationSubstateIfExists(draft, meta, function(substate) {
if (substate.requestId !== meta.requestId)
return;
substate.status = QueryStatus.rejected;
substate.error = payload != null ? payload : error;
});
}).addMatcher(hasRehydrationInfo, function(draft, action) {
var mutations = extractRehydrationInfo(action).mutations;
for (var _j2 = 0, _k2 = Object.entries(mutations); _j2 < _k2.length; _j2++) {
var _l = _k2[_j2], key = _l[0], entry = _l[1];
if (((entry == null ? void 0 : entry.status) === QueryStatus.fulfilled || (entry == null ? void 0 : entry.status) === QueryStatus.rejected) && key !== (entry == null ? void 0 : entry.requestId)) {
draft[key] = entry;
}
}
});
}
});
var invalidationSlice = createSlice({
name: reducerPath + "/invalidation",
initialState: initialState$2,
reducers: {
updateProvidedBy: {
reducer: function(draft, action) {
var _a, _b, _c, _d;
var _j2 = action.payload, queryCacheKey = _j2.queryCacheKey, providedTags = _j2.providedTags;
for (var _k2 = 0, _l = Object.values(draft); _k2 < _l.length; _k2++) {
var tagTypeSubscriptions = _l[_k2];
for (var _m = 0, _o = Object.values(tagTypeSubscriptions); _m < _o.length; _m++) {
var idSubscriptions = _o[_m];
var foundAt = idSubscriptions.indexOf(queryCacheKey);
if (foundAt !== -1) {
idSubscriptions.splice(foundAt, 1);
}
}
}
for (var _p = 0, providedTags_1 = providedTags; _p < providedTags_1.length; _p++) {
var _q = providedTags_1[_p], type = _q.type, id = _q.id;
var subscribedQueries = (_d = (_b = (_a = draft[type]) != null ? _a : draft[type] = {})[_c = id || "__internal_without_id"]) != null ? _d : _b[_c] = [];
var alreadySubscribed = subscribedQueries.includes(queryCacheKey);
if (!alreadySubscribed) {
subscribedQueries.push(queryCacheKey);
}
}
},
prepare: prepareAutoBatched()
}
},
extraReducers: function(builder) {
builder.addCase(querySlice.actions.removeQueryResult, function(draft, _j2) {
var queryCacheKey = _j2.payload.queryCacheKey;
for (var _k2 = 0, _l = Object.values(draft); _k2 < _l.length; _k2++) {
var tagTypeSubscriptions = _l[_k2];
for (var _m = 0, _o = Object.values(tagTypeSubscriptions); _m < _o.length; _m++) {
var idSubscriptions = _o[_m];
var foundAt = idSubscriptions.indexOf(queryCacheKey);
if (foundAt !== -1) {
idSubscriptions.splice(foundAt, 1);
}
}
}
}).addMatcher(hasRehydrationInfo, function(draft, action) {
var _a, _b, _c, _d;
var provided = extractRehydrationInfo(action).provided;
for (var _j2 = 0, _k2 = Object.entries(provided); _j2 < _k2.length; _j2++) {
var _l = _k2[_j2], type = _l[0], incomingTags = _l[1];
for (var _m = 0, _o = Object.entries(incomingTags); _m < _o.length; _m++) {
var _p = _o[_m], id = _p[0], cacheKeys = _p[1];
var subscribedQueries = (_d = (_b = (_a = draft[type]) != null ? _a : draft[type] = {})[_c = id || "__internal_without_id"]) != null ? _d : _b[_c] = [];
for (var _q = 0, cacheKeys_1 = cacheKeys; _q < cacheKeys_1.length; _q++) {
var queryCacheKey = cacheKeys_1[_q];
var alreadySubscribed = subscribedQueries.includes(queryCacheKey);
if (!alreadySubscribed) {
subscribedQueries.push(queryCacheKey);
}
}
}
}
}).addMatcher(isAnyOf(isFulfilled(queryThunk), isRejectedWithValue(queryThunk)), function(draft, action) {
var providedTags = calculateProvidedByThunk(action, "providesTags", definitions, assertTagType);
var queryCacheKey = action.meta.arg.queryCacheKey;
invalidationSlice.caseReducers.updateProvidedBy(draft, invalidationSlice.actions.updateProvidedBy({
queryCacheKey,
providedTags
}));
});
}
});
var subscriptionSlice = createSlice({
name: reducerPath + "/subscriptions",
initialState: initialState$2,
reducers: {
updateSubscriptionOptions: function(d2, a2) {
},
unsubscribeQueryResult: function(d2, a2) {
},
internal_probeSubscription: function(d2, a2) {
}
}
});
var internalSubscriptionsSlice = createSlice({
name: reducerPath + "/internalSubscriptions",
initialState: initialState$2,
reducers: {
subscriptionsUpdated: {
reducer: function(state, action) {
return applyPatches(state, action.payload);
},
prepare: prepareAutoBatched()
}
}
});
var configSlice = createSlice({
name: reducerPath + "/config",
initialState: __spreadValues$1({
online: isOnline(),
focused: isDocumentVisible(),
middlewareRegistered: false
}, config),
reducers: {
middlewareRegistered: function(state, _j2) {
var payload = _j2.payload;
state.middlewareRegistered = state.middlewareRegistered === "conflict" || apiUid !== payload ? "conflict" : true;
}
},
extraReducers: function(builder) {
builder.addCase(onOnline, function(state) {
state.online = true;
}).addCase(onOffline, function(state) {
state.online = false;
}).addCase(onFocus, function(state) {
state.focused = true;
}).addCase(onFocusLost, function(state) {
state.focused = false;
}).addMatcher(hasRehydrationInfo, function(draft) {
return __spreadValues$1({}, draft);
});
}
});
var combinedReducer = combineReducers({
queries: querySlice.reducer,
mutations: mutationSlice.reducer,
provided: invalidationSlice.reducer,
subscriptions: internalSubscriptionsSlice.reducer,
config: configSlice.reducer
});
var reducer2 = function(state, action) {
return combinedReducer(resetApiState.match(action) ? void 0 : state, action);
};
var actions2 = __spreadProps$1(__spreadValues$1(__spreadValues$1(__spreadValues$1(__spreadValues$1(__spreadValues$1(__spreadValues$1({}, configSlice.actions), querySlice.actions), subscriptionSlice.actions), internalSubscriptionsSlice.actions), mutationSlice.actions), invalidationSlice.actions), {
unsubscribeMutationResult: mutationSlice.actions.removeMutationResult,
resetApiState
});
return { reducer: reducer2, actions: actions2 };
}
var skipToken = /* @__PURE__ */ Symbol.for("RTKQ/skipToken");
var initialSubState = {
status: QueryStatus.uninitialized
};
var defaultQuerySubState = /* @__PURE__ */ createNextState2(initialSubState, function() {
});
var defaultMutationSubState = /* @__PURE__ */ createNextState2(initialSubState, function() {
});
function buildSelectors(_j) {
var serializeQueryArgs = _j.serializeQueryArgs, reducerPath = _j.reducerPath;
var selectSkippedQuery = function(state) {
return defaultQuerySubState;
};
var selectSkippedMutation = function(state) {
return defaultMutationSubState;
};
return { buildQuerySelector, buildMutationSelector, selectInvalidatedBy };
function withRequestFlags(substate) {
return __spreadValues$1(__spreadValues$1({}, substate), getRequestStatusFlags(substate.status));
}
function selectInternalState(rootState) {
var state = rootState[reducerPath];
if (process.env.NODE_ENV !== "production") {
if (!state) {
if (selectInternalState.triggered)
return state;
selectInternalState.triggered = true;
console.error("Error: No data found at `state." + reducerPath + "`. Did you forget to add the reducer to the store?");
}
}
return state;
}
function buildQuerySelector(endpointName, endpointDefinition) {
return function(queryArgs) {
var serializedArgs = serializeQueryArgs({
queryArgs,
endpointDefinition,
endpointName
});
var selectQuerySubstate = function(state) {
var _a, _b, _c;
return (_c = (_b = (_a = selectInternalState(state)) == null ? void 0 : _a.queries) == null ? void 0 : _b[serializedArgs]) != null ? _c : defaultQuerySubState;
};
var finalSelectQuerySubState = queryArgs === skipToken ? selectSkippedQuery : selectQuerySubstate;
return createSelector(finalSelectQuerySubState, withRequestFlags);
};
}
function buildMutationSelector() {
return function(id) {
var _a;
var mutationId;
if (typeof id === "object") {
mutationId = (_a = getMutationCacheKey(id)) != null ? _a : skipToken;
} else {
mutationId = id;
}
var selectMutationSubstate = function(state) {
var _a2, _b, _c;
return (_c = (_b = (_a2 = selectInternalState(state)) == null ? void 0 : _a2.mutations) == null ? void 0 : _b[mutationId]) != null ? _c : defaultMutationSubState;
};
var finalSelectMutationSubstate = mutationId === skipToken ? selectSkippedMutation : selectMutationSubstate;
return createSelector(finalSelectMutationSubstate, withRequestFlags);
};
}
function selectInvalidatedBy(state, tags) {
var _a;
var apiState = state[reducerPath];
var toInvalidate = /* @__PURE__ */ new Set();
for (var _j2 = 0, _k = tags.map(expandTagDescription); _j2 < _k.length; _j2++) {
var tag = _k[_j2];
var provided = apiState.provided[tag.type];
if (!provided) {
continue;
}
var invalidateSubscriptions = (_a = tag.id !== void 0 ? provided[tag.id] : flatten(Object.values(provided))) != null ? _a : [];
for (var _l = 0, invalidateSubscriptions_1 = invalidateSubscriptions; _l < invalidateSubscriptions_1.length; _l++) {
var invalidate = invalidateSubscriptions_1[_l];
toInvalidate.add(invalidate);
}
}
return flatten(Array.from(toInvalidate.values()).map(function(queryCacheKey) {
var querySubState = apiState.queries[queryCacheKey];
return querySubState ? [
{
queryCacheKey,
endpointName: querySubState.endpointName,
originalArgs: querySubState.originalArgs
}
] : [];
}));
}
}
var cache$1 = WeakMap ? /* @__PURE__ */ new WeakMap() : void 0;
var defaultSerializeQueryArgs$1 = function(_j) {
var endpointName = _j.endpointName, queryArgs = _j.queryArgs;
var serialized = "";
var cached = cache$1 == null ? void 0 : cache$1.get(queryArgs);
if (typeof cached === "string") {
serialized = cached;
} else {
var stringified = JSON.stringify(queryArgs, function(key, value) {
return isPlainObject$3(value) ? Object.keys(value).sort().reduce(function(acc, key2) {
acc[key2] = value[key2];
return acc;
}, {}) : value;
});
if (isPlainObject$3(queryArgs)) {
cache$1 == null ? void 0 : cache$1.set(queryArgs, stringified);
}
serialized = stringified;
}
return endpointName + "(" + serialized + ")";
};
function buildCreateApi() {
var modules = [];
for (var _j = 0; _j < arguments.length; _j++) {
modules[_j] = arguments[_j];
}
return function baseCreateApi(options) {
var extractRehydrationInfo = defaultMemoize(function(action) {
var _a, _b;
return (_b = options.extractRehydrationInfo) == null ? void 0 : _b.call(options, action, {
reducerPath: (_a = options.reducerPath) != null ? _a : "api"
});
});
var optionsWithDefaults = __spreadProps$1(__spreadValues$1({
reducerPath: "api",
keepUnusedDataFor: 60,
refetchOnMountOrArgChange: false,
refetchOnFocus: false,
refetchOnReconnect: false
}, options), {
extractRehydrationInfo,
serializeQueryArgs: function(queryArgsApi) {
var finalSerializeQueryArgs = defaultSerializeQueryArgs$1;
if ("serializeQueryArgs" in queryArgsApi.endpointDefinition) {
var endpointSQA_1 = queryArgsApi.endpointDefinition.serializeQueryArgs;
finalSerializeQueryArgs = function(queryArgsApi2) {
var initialResult = endpointSQA_1(queryArgsApi2);
if (typeof initialResult === "string") {
return initialResult;
} else {
return defaultSerializeQueryArgs$1(__spreadProps$1(__spreadValues$1({}, queryArgsApi2), {
queryArgs: initialResult
}));
}
};
} else if (options.serializeQueryArgs) {
finalSerializeQueryArgs = options.serializeQueryArgs;
}
return finalSerializeQueryArgs(queryArgsApi);
},
tagTypes: __spreadArray$1([], options.tagTypes || [])
});
var context = {
endpointDefinitions: {},
batch: function(fn) {
fn();
},
apiUid: nanoid(),
extractRehydrationInfo,
hasRehydrationInfo: defaultMemoize(function(action) {
return extractRehydrationInfo(action) != null;
})
};
var api = {
injectEndpoints,
enhanceEndpoints: function(_j2) {
var addTagTypes = _j2.addTagTypes, endpoints = _j2.endpoints;
if (addTagTypes) {
for (var _k = 0, addTagTypes_1 = addTagTypes; _k < addTagTypes_1.length; _k++) {
var eT = addTagTypes_1[_k];
if (!optionsWithDefaults.tagTypes.includes(eT)) {
optionsWithDefaults.tagTypes.push(eT);
}
}
}
if (endpoints) {
for (var _l = 0, _m = Object.entries(endpoints); _l < _m.length; _l++) {
var _o = _m[_l], endpointName = _o[0], partialDefinition = _o[1];
if (typeof partialDefinition === "function") {
partialDefinition(context.endpointDefinitions[endpointName]);
} else {
Object.assign(context.endpointDefinitions[endpointName] || {}, partialDefinition);
}
}
}
return api;
}
};
var initializedModules = modules.map(function(m) {
return m.init(api, optionsWithDefaults, context);
});
function injectEndpoints(inject) {
var evaluatedEndpoints = inject.endpoints({
query: function(x) {
return __spreadProps$1(__spreadValues$1({}, x), { type: DefinitionType$1.query });
},
mutation: function(x) {
return __spreadProps$1(__spreadValues$1({}, x), { type: DefinitionType$1.mutation });
}
});
for (var _j2 = 0, _k = Object.entries(evaluatedEndpoints); _j2 < _k.length; _j2++) {
var _l = _k[_j2], endpointName = _l[0], definition = _l[1];
if (!inject.overrideExisting && endpointName in context.endpointDefinitions) {
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
console.error("called `injectEndpoints` to override already-existing endpointName " + endpointName + " without specifying `overrideExisting: true`");
}
continue;
}
context.endpointDefinitions[endpointName] = definition;
for (var _m = 0, initializedModules_1 = initializedModules; _m < initializedModules_1.length; _m++) {
var m = initializedModules_1[_m];
m.injectEndpoint(endpointName, definition);
}
}
return api;
}
return api.injectEndpoints({ endpoints: options.endpoints });
};
}
function isObjectEmpty(obj) {
for (var k in obj) {
return false;
}
return true;
}
var THIRTY_TWO_BIT_MAX_TIMER_SECONDS = 2147483647 / 1e3 - 1;
var buildCacheCollectionHandler = function(_j) {
var reducerPath = _j.reducerPath, api = _j.api, context = _j.context, internalState = _j.internalState;
var _k = api.internalActions, removeQueryResult = _k.removeQueryResult, unsubscribeQueryResult = _k.unsubscribeQueryResult;
function anySubscriptionsRemainingForKey(queryCacheKey) {
var subscriptions = internalState.currentSubscriptions[queryCacheKey];
return !!subscriptions && !isObjectEmpty(subscriptions);
}
var currentRemovalTimeouts = {};
var handler = function(action, mwApi, internalState2) {
var _a;
if (unsubscribeQueryResult.match(action)) {
var state = mwApi.getState()[reducerPath];
var queryCacheKey = action.payload.queryCacheKey;
handleUnsubscribe(queryCacheKey, (_a = state.queries[queryCacheKey]) == null ? void 0 : _a.endpointName, mwApi, state.config);
}
if (api.util.resetApiState.match(action)) {
for (var _j2 = 0, _k2 = Object.entries(currentRemovalTimeouts); _j2 < _k2.length; _j2++) {
var _l = _k2[_j2], key = _l[0], timeout = _l[1];
if (timeout)
clearTimeout(timeout);
delete currentRemovalTimeouts[key];
}
}
if (context.hasRehydrationInfo(action)) {
var state = mwApi.getState()[reducerPath];
var queries = context.extractRehydrationInfo(action).queries;
for (var _m = 0, _o = Object.entries(queries); _m < _o.length; _m++) {
var _p = _o[_m], queryCacheKey = _p[0], queryState = _p[1];
handleUnsubscribe(queryCacheKey, queryState == null ? void 0 : queryState.endpointName, mwApi, state.config);
}
}
};
function handleUnsubscribe(queryCacheKey, endpointName, api2, config) {
var _a;
var endpointDefinition = context.endpointDefinitions[endpointName];
var keepUnusedDataFor = (_a = endpointDefinition == null ? void 0 : endpointDefinition.keepUnusedDataFor) != null ? _a : config.keepUnusedDataFor;
if (keepUnusedDataFor === Infinity) {
return;
}
var finalKeepUnusedDataFor = Math.max(0, Math.min(keepUnusedDataFor, THIRTY_TWO_BIT_MAX_TIMER_SECONDS));
if (!anySubscriptionsRemainingForKey(queryCacheKey)) {
var currentTimeout = currentRemovalTimeouts[queryCacheKey];
if (currentTimeout) {
clearTimeout(currentTimeout);
}
currentRemovalTimeouts[queryCacheKey] = setTimeout(function() {
if (!anySubscriptionsRemainingForKey(queryCacheKey)) {
api2.dispatch(removeQueryResult({ queryCacheKey }));
}
delete currentRemovalTimeouts[queryCacheKey];
}, finalKeepUnusedDataFor * 1e3);
}
}
return handler;
};
var buildInvalidationByTagsHandler = function(_j) {
var reducerPath = _j.reducerPath, context = _j.context, endpointDefinitions = _j.context.endpointDefinitions, mutationThunk = _j.mutationThunk, api = _j.api, assertTagType = _j.assertTagType, refetchQuery = _j.refetchQuery;
var removeQueryResult = api.internalActions.removeQueryResult;
var isThunkActionWithTags = isAnyOf(isFulfilled(mutationThunk), isRejectedWithValue(mutationThunk));
var handler = function(action, mwApi) {
if (isThunkActionWithTags(action)) {
invalidateTags(calculateProvidedByThunk(action, "invalidatesTags", endpointDefinitions, assertTagType), mwApi);
}
if (api.util.invalidateTags.match(action)) {
invalidateTags(calculateProvidedBy(action.payload, void 0, void 0, void 0, void 0, assertTagType), mwApi);
}
};
function invalidateTags(tags, mwApi) {
var rootState = mwApi.getState();
var state = rootState[reducerPath];
var toInvalidate = api.util.selectInvalidatedBy(rootState, tags);
context.batch(function() {
var _a;
var valuesArray = Array.from(toInvalidate.values());
for (var _j2 = 0, valuesArray_1 = valuesArray; _j2 < valuesArray_1.length; _j2++) {
var queryCacheKey = valuesArray_1[_j2].queryCacheKey;
var querySubState = state.queries[queryCacheKey];
var subscriptionSubState = (_a = state.subscriptions[queryCacheKey]) != null ? _a : {};
if (querySubState) {
if (Object.keys(subscriptionSubState).length === 0) {
mwApi.dispatch(removeQueryResult({
queryCacheKey
}));
} else if (querySubState.status !== QueryStatus.uninitialized) {
mwApi.dispatch(refetchQuery(querySubState, queryCacheKey));
}
}
}
});
}
return handler;
};
var buildPollingHandler = function(_j) {
var reducerPath = _j.reducerPath, queryThunk = _j.queryThunk, api = _j.api, refetchQuery = _j.refetchQuery, internalState = _j.internalState;
var currentPolls = {};
var handler = function(action, mwApi) {
if (api.internalActions.updateSubscriptionOptions.match(action) || api.internalActions.unsubscribeQueryResult.match(action)) {
updatePollingInterval(action.payload, mwApi);
}
if (queryThunk.pending.match(action) || queryThunk.rejected.match(action) && action.meta.condition) {
updatePollingInterval(action.meta.arg, mwApi);
}
if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action) && !action.meta.condition) {
startNextPoll(action.meta.arg, mwApi);
}
if (api.util.resetApiState.match(action)) {
clearPolls();
}
};
function startNextPoll(_j2, api2) {
var queryCacheKey = _j2.queryCacheKey;
var state = api2.getState()[reducerPath];
var querySubState = state.queries[queryCacheKey];
var subscriptions = internalState.currentSubscriptions[queryCacheKey];
if (!querySubState || querySubState.status === QueryStatus.uninitialized)
return;
var lowestPollingInterval = findLowestPollingInterval(subscriptions);
if (!Number.isFinite(lowestPollingInterval))
return;
var currentPoll = currentPolls[queryCacheKey];
if (currentPoll == null ? void 0 : currentPoll.timeout) {
clearTimeout(currentPoll.timeout);
currentPoll.timeout = void 0;
}
var nextPollTimestamp = Date.now() + lowestPollingInterval;
var currentInterval = currentPolls[queryCacheKey] = {
nextPollTimestamp,
pollingInterval: lowestPollingInterval,
timeout: setTimeout(function() {
currentInterval.timeout = void 0;
api2.dispatch(refetchQuery(querySubState, queryCacheKey));
}, lowestPollingInterval)
};
}
function updatePollingInterval(_j2, api2) {
var queryCacheKey = _j2.queryCacheKey;
var state = api2.getState()[reducerPath];
var querySubState = state.queries[queryCacheKey];
var subscriptions = internalState.currentSubscriptions[queryCacheKey];
if (!querySubState || querySubState.status === QueryStatus.uninitialized) {
return;
}
var lowestPollingInterval = findLowestPollingInterval(subscriptions);
if (!Number.isFinite(lowestPollingInterval)) {
cleanupPollForKey(queryCacheKey);
return;
}
var currentPoll = currentPolls[queryCacheKey];
var nextPollTimestamp = Date.now() + lowestPollingInterval;
if (!currentPoll || nextPollTimestamp < currentPoll.nextPollTimestamp) {
startNextPoll({ queryCacheKey }, api2);
}
}
function cleanupPollForKey(key) {
var existingPoll = currentPolls[key];
if (existingPoll == null ? void 0 : existingPoll.timeout) {
clearTimeout(existingPoll.timeout);
}
delete currentPolls[key];
}
function clearPolls() {
for (var _j2 = 0, _k = Object.keys(currentPolls); _j2 < _k.length; _j2++) {
var key = _k[_j2];
cleanupPollForKey(key);
}
}
function findLowestPollingInterval(subscribers) {
if (subscribers === void 0) {
subscribers = {};
}
var lowestPollingInterval = Number.POSITIVE_INFINITY;
for (var key in subscribers) {
if (!!subscribers[key].pollingInterval) {
lowestPollingInterval = Math.min(subscribers[key].pollingInterval, lowestPollingInterval);
}
}
return lowestPollingInterval;
}
return handler;
};
var buildWindowEventHandler = function(_j) {
var reducerPath = _j.reducerPath, context = _j.context, api = _j.api, refetchQuery = _j.refetchQuery, internalState = _j.internalState;
var removeQueryResult = api.internalActions.removeQueryResult;
var handler = function(action, mwApi) {
if (onFocus.match(action)) {
refetchValidQueries(mwApi, "refetchOnFocus");
}
if (onOnline.match(action)) {
refetchValidQueries(mwApi, "refetchOnReconnect");
}
};
function refetchValidQueries(api2, type) {
var state = api2.getState()[reducerPath];
var queries = state.queries;
var subscriptions = internalState.currentSubscriptions;
context.batch(function() {
for (var _j2 = 0, _k = Object.keys(subscriptions); _j2 < _k.length; _j2++) {
var queryCacheKey = _k[_j2];
var querySubState = queries[queryCacheKey];
var subscriptionSubState = subscriptions[queryCacheKey];
if (!subscriptionSubState || !querySubState)
continue;
var shouldRefetch = Object.values(subscriptionSubState).some(function(sub) {
return sub[type] === true;
}) || Object.values(subscriptionSubState).every(function(sub) {
return sub[type] === void 0;
}) && state.config[type];
if (shouldRefetch) {
if (Object.keys(subscriptionSubState).length === 0) {
api2.dispatch(removeQueryResult({
queryCacheKey
}));
} else if (querySubState.status !== QueryStatus.uninitialized) {
api2.dispatch(refetchQuery(querySubState, queryCacheKey));
}
}
}
});
}
return handler;
};
var neverResolvedError = new Error("Promise never resolved before cacheEntryRemoved.");
var buildCacheLifecycleHandler = function(_j) {
var api = _j.api, reducerPath = _j.reducerPath, context = _j.context, queryThunk = _j.queryThunk, mutationThunk = _j.mutationThunk;
_j.internalState;
var isQueryThunk = isAsyncThunkAction(queryThunk);
var isMutationThunk = isAsyncThunkAction(mutationThunk);
var isFulfilledThunk = isFulfilled(queryThunk, mutationThunk);
var lifecycleMap = {};
var handler = function(action, mwApi, stateBefore) {
var cacheKey = getCacheKey(action);
if (queryThunk.pending.match(action)) {
var oldState = stateBefore[reducerPath].queries[cacheKey];
var state = mwApi.getState()[reducerPath].queries[cacheKey];
if (!oldState && state) {
handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);
}
} else if (mutationThunk.pending.match(action)) {
var state = mwApi.getState()[reducerPath].mutations[cacheKey];
if (state) {
handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);
}
} else if (isFulfilledThunk(action)) {
var lifecycle = lifecycleMap[cacheKey];
if (lifecycle == null ? void 0 : lifecycle.valueResolved) {
lifecycle.valueResolved({
data: action.payload,
meta: action.meta.baseQueryMeta
});
delete lifecycle.valueResolved;
}
} else if (api.internalActions.removeQueryResult.match(action) || api.internalActions.removeMutationResult.match(action)) {
var lifecycle = lifecycleMap[cacheKey];
if (lifecycle) {
delete lifecycleMap[cacheKey];
lifecycle.cacheEntryRemoved();
}
} else if (api.util.resetApiState.match(action)) {
for (var _j2 = 0, _k = Object.entries(lifecycleMap); _j2 < _k.length; _j2++) {
var _l = _k[_j2], cacheKey2 = _l[0], lifecycle = _l[1];
delete lifecycleMap[cacheKey2];
lifecycle.cacheEntryRemoved();
}
}
};
function getCacheKey(action) {
if (isQueryThunk(action))
return action.meta.arg.queryCacheKey;
if (isMutationThunk(action))
return action.meta.requestId;
if (api.internalActions.removeQueryResult.match(action))
return action.payload.queryCacheKey;
if (api.internalActions.removeMutationResult.match(action))
return getMutationCacheKey(action.payload);
return "";
}
function handleNewKey(endpointName, originalArgs, queryCacheKey, mwApi, requestId) {
var endpointDefinition = context.endpointDefinitions[endpointName];
var onCacheEntryAdded = endpointDefinition == null ? void 0 : endpointDefinition.onCacheEntryAdded;
if (!onCacheEntryAdded)
return;
var lifecycle = {};
var cacheEntryRemoved = new Promise(function(resolve) {
lifecycle.cacheEntryRemoved = resolve;
});
var cacheDataLoaded = Promise.race([
new Promise(function(resolve) {
lifecycle.valueResolved = resolve;
}),
cacheEntryRemoved.then(function() {
throw neverResolvedError;
})
]);
cacheDataLoaded.catch(function() {
});
lifecycleMap[queryCacheKey] = lifecycle;
var selector = api.endpoints[endpointName].select(endpointDefinition.type === DefinitionType$1.query ? originalArgs : queryCacheKey);
var extra = mwApi.dispatch(function(_, __, extra2) {
return extra2;
});
var lifecycleApi = __spreadProps$1(__spreadValues$1({}, mwApi), {
getCacheEntry: function() {
return selector(mwApi.getState());
},
requestId,
extra,
updateCachedData: endpointDefinition.type === DefinitionType$1.query ? function(updateRecipe) {
return mwApi.dispatch(api.util.updateQueryData(endpointName, originalArgs, updateRecipe));
} : void 0,
cacheDataLoaded,
cacheEntryRemoved
});
var runningHandler = onCacheEntryAdded(originalArgs, lifecycleApi);
Promise.resolve(runningHandler).catch(function(e) {
if (e === neverResolvedError)
return;
throw e;
});
}
return handler;
};
var buildQueryLifecycleHandler = function(_j) {
var api = _j.api, context = _j.context, queryThunk = _j.queryThunk, mutationThunk = _j.mutationThunk;
var isPendingThunk = isPending(queryThunk, mutationThunk);
var isRejectedThunk = isRejected(queryThunk, mutationThunk);
var isFullfilledThunk = isFulfilled(queryThunk, mutationThunk);
var lifecycleMap = {};
var handler = function(action, mwApi) {
var _a, _b, _c;
if (isPendingThunk(action)) {
var _j2 = action.meta, requestId = _j2.requestId, _k = _j2.arg, endpointName_1 = _k.endpointName, originalArgs_1 = _k.originalArgs;
var endpointDefinition = context.endpointDefinitions[endpointName_1];
var onQueryStarted = endpointDefinition == null ? void 0 : endpointDefinition.onQueryStarted;
if (onQueryStarted) {
var lifecycle_1 = {};
var queryFulfilled = new Promise(function(resolve, reject) {
lifecycle_1.resolve = resolve;
lifecycle_1.reject = reject;
});
queryFulfilled.catch(function() {
});
lifecycleMap[requestId] = lifecycle_1;
var selector_1 = api.endpoints[endpointName_1].select(endpointDefinition.type === DefinitionType$1.query ? originalArgs_1 : requestId);
var extra = mwApi.dispatch(function(_, __, extra2) {
return extra2;
});
var lifecycleApi = __spreadProps$1(__spreadValues$1({}, mwApi), {
getCacheEntry: function() {
return selector_1(mwApi.getState());
},
requestId,
extra,
updateCachedData: endpointDefinition.type === DefinitionType$1.query ? function(updateRecipe) {
return mwApi.dispatch(api.util.updateQueryData(endpointName_1, originalArgs_1, updateRecipe));
} : void 0,
queryFulfilled
});
onQueryStarted(originalArgs_1, lifecycleApi);
}
} else if (isFullfilledThunk(action)) {
var _l = action.meta, requestId = _l.requestId, baseQueryMeta = _l.baseQueryMeta;
(_a = lifecycleMap[requestId]) == null ? void 0 : _a.resolve({
data: action.payload,
meta: baseQueryMeta
});
delete lifecycleMap[requestId];
} else if (isRejectedThunk(action)) {
var _m = action.meta, requestId = _m.requestId, rejectedWithValue = _m.rejectedWithValue, baseQueryMeta = _m.baseQueryMeta;
(_c = lifecycleMap[requestId]) == null ? void 0 : _c.reject({
error: (_b = action.payload) != null ? _b : action.error,
isUnhandledError: !rejectedWithValue,
meta: baseQueryMeta
});
delete lifecycleMap[requestId];
}
};
return handler;
};
var buildDevCheckHandler = function(_j) {
var api = _j.api, apiUid = _j.context.apiUid, reducerPath = _j.reducerPath;
return function(action, mwApi) {
var _a, _b;
if (api.util.resetApiState.match(action)) {
mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));
}
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
if (api.internalActions.middlewareRegistered.match(action) && action.payload === apiUid && ((_b = (_a = mwApi.getState()[reducerPath]) == null ? void 0 : _a.config) == null ? void 0 : _b.middlewareRegistered) === "conflict") {
console.warn('There is a mismatch between slice and middleware for the reducerPath "' + reducerPath + '".\nYou can only have one api per reducer path, this will lead to crashes in various situations!' + (reducerPath === "api" ? "\nIf you have multiple apis, you *have* to specify the reducerPath option when using createApi!" : ""));
}
}
};
};
var promise;
var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : globalThis) : function(cb) {
return (promise || (promise = Promise.resolve())).then(cb).catch(function(err) {
return setTimeout(function() {
throw err;
}, 0);
});
};
var buildBatchedActionsHandler = function(_j) {
var api = _j.api, queryThunk = _j.queryThunk, internalState = _j.internalState;
var subscriptionsPrefix = api.reducerPath + "/subscriptions";
var previousSubscriptions = null;
var dispatchQueued = false;
var _k = api.internalActions, updateSubscriptionOptions = _k.updateSubscriptionOptions, unsubscribeQueryResult = _k.unsubscribeQueryResult;
var actuallyMutateSubscriptions = function(mutableState, action) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
if (updateSubscriptionOptions.match(action)) {
var _j2 = action.payload, queryCacheKey = _j2.queryCacheKey, requestId = _j2.requestId, options = _j2.options;
if ((_a = mutableState == null ? void 0 : mutableState[queryCacheKey]) == null ? void 0 : _a[requestId]) {
mutableState[queryCacheKey][requestId] = options;
}
return true;
}
if (unsubscribeQueryResult.match(action)) {
var _k2 = action.payload, queryCacheKey = _k2.queryCacheKey, requestId = _k2.requestId;
if (mutableState[queryCacheKey]) {
delete mutableState[queryCacheKey][requestId];
}
return true;
}
if (api.internalActions.removeQueryResult.match(action)) {
delete mutableState[action.payload.queryCacheKey];
return true;
}
if (queryThunk.pending.match(action)) {
var _l = action.meta, arg = _l.arg, requestId = _l.requestId;
if (arg.subscribe) {
var substate = (_c = mutableState[_b = arg.queryCacheKey]) != null ? _c : mutableState[_b] = {};
substate[requestId] = (_e = (_d = arg.subscriptionOptions) != null ? _d : substate[requestId]) != null ? _e : {};
return true;
}
}
if (queryThunk.rejected.match(action)) {
var _m = action.meta, condition = _m.condition, arg = _m.arg, requestId = _m.requestId;
if (condition && arg.subscribe) {
var substate = (_g = mutableState[_f = arg.queryCacheKey]) != null ? _g : mutableState[_f] = {};
substate[requestId] = (_i = (_h = arg.subscriptionOptions) != null ? _h : substate[requestId]) != null ? _i : {};
return true;
}
}
return false;
};
return function(action, mwApi) {
var _a, _b;
if (!previousSubscriptions) {
previousSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));
}
if (api.util.resetApiState.match(action)) {
previousSubscriptions = internalState.currentSubscriptions = {};
return [true, false];
}
if (api.internalActions.internal_probeSubscription.match(action)) {
var _j2 = action.payload, queryCacheKey = _j2.queryCacheKey, requestId = _j2.requestId;
var hasSubscription = !!((_a = internalState.currentSubscriptions[queryCacheKey]) == null ? void 0 : _a[requestId]);
return [false, hasSubscription];
}
var didMutate = actuallyMutateSubscriptions(internalState.currentSubscriptions, action);
if (didMutate) {
if (!dispatchQueued) {
queueMicrotaskShim(function() {
var newSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));
var _j3 = produceWithPatches(previousSubscriptions, function() {
return newSubscriptions;
}), patches = _j3[1];
mwApi.next(api.internalActions.subscriptionsUpdated(patches));
previousSubscriptions = newSubscriptions;
dispatchQueued = false;
});
dispatchQueued = true;
}
var isSubscriptionSliceAction = !!((_b = action.type) == null ? void 0 : _b.startsWith(subscriptionsPrefix));
var isAdditionalSubscriptionAction = queryThunk.rejected.match(action) && action.meta.condition && !!action.meta.arg.subscribe;
var actionShouldContinue = !isSubscriptionSliceAction && !isAdditionalSubscriptionAction;
return [actionShouldContinue, false];
}
return [true, false];
};
};
function buildMiddleware(input) {
var reducerPath = input.reducerPath, queryThunk = input.queryThunk, api = input.api, context = input.context;
var apiUid = context.apiUid;
var actions2 = {
invalidateTags: createAction(reducerPath + "/invalidateTags")
};
var isThisApiSliceAction = function(action) {
return !!action && typeof action.type === "string" && action.type.startsWith(reducerPath + "/");
};
var handlerBuilders = [
buildDevCheckHandler,
buildCacheCollectionHandler,
buildInvalidationByTagsHandler,
buildPollingHandler,
buildCacheLifecycleHandler,
buildQueryLifecycleHandler
];
var middleware = function(mwApi) {
var initialized2 = false;
var internalState = {
currentSubscriptions: {}
};
var builderArgs = __spreadProps$1(__spreadValues$1({}, input), {
internalState,
refetchQuery
});
var handlers = handlerBuilders.map(function(build) {
return build(builderArgs);
});
var batchedActionsHandler = buildBatchedActionsHandler(builderArgs);
var windowEventsHandler = buildWindowEventHandler(builderArgs);
return function(next) {
return function(action) {
if (!initialized2) {
initialized2 = true;
mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));
}
var mwApiWithNext = __spreadProps$1(__spreadValues$1({}, mwApi), { next });
var stateBefore = mwApi.getState();
var _j = batchedActionsHandler(action, mwApiWithNext, stateBefore), actionShouldContinue = _j[0], hasSubscription = _j[1];
var res;
if (actionShouldContinue) {
res = next(action);
} else {
res = hasSubscription;
}
if (!!mwApi.getState()[reducerPath]) {
windowEventsHandler(action, mwApiWithNext, stateBefore);
if (isThisApiSliceAction(action) || context.hasRehydrationInfo(action)) {
for (var _k = 0, handlers_1 = handlers; _k < handlers_1.length; _k++) {
var handler = handlers_1[_k];
handler(action, mwApiWithNext, stateBefore);
}
}
}
return res;
};
};
};
return { middleware, actions: actions2 };
function refetchQuery(querySubState, queryCacheKey, override) {
if (override === void 0) {
override = {};
}
return queryThunk(__spreadValues$1({
type: "query",
endpointName: querySubState.endpointName,
originalArgs: querySubState.originalArgs,
subscribe: false,
forceRefetch: true,
queryCacheKey
}, override));
}
}
function safeAssign$1(target) {
var args = [];
for (var _j = 1; _j < arguments.length; _j++) {
args[_j - 1] = arguments[_j];
}
Object.assign.apply(Object, __spreadArray$1([target], args));
}
var coreModuleName = /* @__PURE__ */ Symbol();
var coreModule = function() {
return {
name: coreModuleName,
init: function(api, _j, context) {
var baseQuery = _j.baseQuery, tagTypes = _j.tagTypes, reducerPath = _j.reducerPath, serializeQueryArgs = _j.serializeQueryArgs, keepUnusedDataFor = _j.keepUnusedDataFor, refetchOnMountOrArgChange = _j.refetchOnMountOrArgChange, refetchOnFocus = _j.refetchOnFocus, refetchOnReconnect = _j.refetchOnReconnect;
enablePatches();
var assertTagType = function(tag) {
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
if (!tagTypes.includes(tag.type)) {
console.error("Tag type '" + tag.type + "' was used, but not specified in `tagTypes`!");
}
}
return tag;
};
Object.assign(api, {
reducerPath,
endpoints: {},
internalActions: {
onOnline,
onOffline,
onFocus,
onFocusLost
},
util: {}
});
var _k = buildThunks({
baseQuery,
reducerPath,
context,
api,
serializeQueryArgs,
assertTagType
}), queryThunk = _k.queryThunk, mutationThunk = _k.mutationThunk, patchQueryData = _k.patchQueryData, updateQueryData = _k.updateQueryData, upsertQueryData = _k.upsertQueryData, prefetch = _k.prefetch, buildMatchThunkActions = _k.buildMatchThunkActions;
var _l = buildSlice({
context,
queryThunk,
mutationThunk,
reducerPath,
assertTagType,
config: {
refetchOnFocus,
refetchOnReconnect,
refetchOnMountOrArgChange,
keepUnusedDataFor,
reducerPath
}
}), reducer2 = _l.reducer, sliceActions = _l.actions;
safeAssign$1(api.util, {
patchQueryData,
updateQueryData,
upsertQueryData,
prefetch,
resetApiState: sliceActions.resetApiState
});
safeAssign$1(api.internalActions, sliceActions);
var _m = buildMiddleware({
reducerPath,
context,
queryThunk,
mutationThunk,
api,
assertTagType
}), middleware = _m.middleware, middlewareActions = _m.actions;
safeAssign$1(api.util, middlewareActions);
safeAssign$1(api, { reducer: reducer2, middleware });
var _o = buildSelectors({
serializeQueryArgs,
reducerPath
}), buildQuerySelector = _o.buildQuerySelector, buildMutationSelector = _o.buildMutationSelector, selectInvalidatedBy = _o.selectInvalidatedBy;
safeAssign$1(api.util, { selectInvalidatedBy });
var _p = buildInitiate({
queryThunk,
mutationThunk,
api,
serializeQueryArgs,
context
}), buildInitiateQuery = _p.buildInitiateQuery, buildInitiateMutation = _p.buildInitiateMutation, getRunningMutationThunk = _p.getRunningMutationThunk, getRunningMutationsThunk = _p.getRunningMutationsThunk, getRunningQueriesThunk = _p.getRunningQueriesThunk, getRunningQueryThunk = _p.getRunningQueryThunk, getRunningOperationPromises = _p.getRunningOperationPromises, removalWarning = _p.removalWarning;
safeAssign$1(api.util, {
getRunningOperationPromises,
getRunningOperationPromise: removalWarning,
getRunningMutationThunk,
getRunningMutationsThunk,
getRunningQueryThunk,
getRunningQueriesThunk
});
return {
name: coreModuleName,
injectEndpoint: function(endpointName, definition) {
var _a, _b;
var anyApi = api;
(_b = (_a = anyApi.endpoints)[endpointName]) != null ? _b : _a[endpointName] = {};
if (isQueryDefinition$1(definition)) {
safeAssign$1(anyApi.endpoints[endpointName], {
name: endpointName,
select: buildQuerySelector(endpointName, definition),
initiate: buildInitiateQuery(endpointName, definition)
}, buildMatchThunkActions(queryThunk, endpointName));
} else if (isMutationDefinition$1(definition)) {
safeAssign$1(anyApi.endpoints[endpointName], {
name: endpointName,
select: buildMutationSelector(),
initiate: buildInitiateMutation(endpointName)
}, buildMatchThunkActions(mutationThunk, endpointName));
}
}
};
}
};
};
var __spreadArray = function(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
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 = function(obj, key, value) {
return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
};
var __spreadValues = function(a2, b) {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a2, prop, b[prop]);
if (__getOwnPropSymbols)
for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
var prop = _c[_i];
if (__propIsEnum.call(b, prop))
__defNormalProp(a2, prop, b[prop]);
}
return a2;
};
var __spreadProps = function(a2, b) {
return __defProps(a2, __getOwnPropDescs(b));
};
function useStableQueryArgs(queryArgs, serialize, endpointDefinition, endpointName) {
var incoming = useMemo(function() {
return {
queryArgs,
serialized: typeof queryArgs == "object" ? serialize({ queryArgs, endpointDefinition, endpointName }) : queryArgs
};
}, [queryArgs, serialize, endpointDefinition, endpointName]);
var cache2 = useRef(incoming);
useEffect(function() {
if (cache2.current.serialized !== incoming.serialized) {
cache2.current = incoming;
}
}, [incoming]);
return cache2.current.serialized === incoming.serialized ? cache2.current.queryArgs : queryArgs;
}
var UNINITIALIZED_VALUE = Symbol();
function useShallowStableValue(value) {
var cache2 = useRef(value);
useEffect(function() {
if (!shallowEqual(cache2.current, value)) {
cache2.current = value;
}
}, [value]);
return shallowEqual(cache2.current, value) ? cache2.current : value;
}
var cache = WeakMap ? /* @__PURE__ */ new WeakMap() : void 0;
var defaultSerializeQueryArgs = function(_c) {
var endpointName = _c.endpointName, queryArgs = _c.queryArgs;
var serialized = "";
var cached = cache == null ? void 0 : cache.get(queryArgs);
if (typeof cached === "string") {
serialized = cached;
} else {
var stringified = JSON.stringify(queryArgs, function(key, value) {
return isPlainObject$3(value) ? Object.keys(value).sort().reduce(function(acc, key2) {
acc[key2] = value[key2];
return acc;
}, {}) : value;
});
if (isPlainObject$3(queryArgs)) {
cache == null ? void 0 : cache.set(queryArgs, stringified);
}
serialized = stringified;
}
return endpointName + "(" + serialized + ")";
};
var useIsomorphicLayoutEffect = typeof window !== "undefined" && !!window.document && !!window.document.createElement ? useLayoutEffect : useEffect;
var defaultMutationStateSelector = function(x) {
return x;
};
var noPendingQueryStateSelector = function(selected) {
if (selected.isUninitialized) {
return __spreadProps(__spreadValues({}, selected), {
isUninitialized: false,
isFetching: true,
isLoading: selected.data !== void 0 ? false : true,
status: QueryStatus.pending
});
}
return selected;
};
function buildHooks(_c) {
var api = _c.api, _d = _c.moduleOptions, batch2 = _d.batch, useDispatch2 = _d.useDispatch, useSelector2 = _d.useSelector, useStore2 = _d.useStore, unstable__sideEffectsInRender = _d.unstable__sideEffectsInRender, serializeQueryArgs = _c.serializeQueryArgs, context = _c.context;
var usePossiblyImmediateEffect = unstable__sideEffectsInRender ? function(cb) {
return cb();
} : useEffect;
return { buildQueryHooks, buildMutationHook, usePrefetch };
function queryStatePreSelector(currentState, lastResult, queryArgs) {
if ((lastResult == null ? void 0 : lastResult.endpointName) && currentState.isUninitialized) {
var endpointName = lastResult.endpointName;
var endpointDefinition = context.endpointDefinitions[endpointName];
if (serializeQueryArgs({
queryArgs: lastResult.originalArgs,
endpointDefinition,
endpointName
}) === serializeQueryArgs({
queryArgs,
endpointDefinition,
endpointName
}))
lastResult = void 0;
}
var data = currentState.isSuccess ? currentState.data : lastResult == null ? void 0 : lastResult.data;
if (data === void 0)
data = currentState.data;
var hasData = data !== void 0;
var isFetching = currentState.isLoading;
var isLoading = !hasData && isFetching;
var isSuccess = currentState.isSuccess || isFetching && hasData;
return __spreadProps(__spreadValues({}, currentState), {
data,
currentData: currentState.data,
isFetching,
isLoading,
isSuccess
});
}
function usePrefetch(endpointName, defaultOptions) {
var dispatch = useDispatch2();
var stableDefaultOptions = useShallowStableValue(defaultOptions);
return useCallback(function(arg, options) {
return dispatch(api.util.prefetch(endpointName, arg, __spreadValues(__spreadValues({}, stableDefaultOptions), options)));
}, [endpointName, dispatch, stableDefaultOptions]);
}
function buildQueryHooks(name) {
var useQuerySubscription = function(arg, _c2) {
var _d2 = _c2 === void 0 ? {} : _c2, refetchOnReconnect = _d2.refetchOnReconnect, refetchOnFocus = _d2.refetchOnFocus, refetchOnMountOrArgChange = _d2.refetchOnMountOrArgChange, _e = _d2.skip, skip = _e === void 0 ? false : _e, _f = _d2.pollingInterval, pollingInterval = _f === void 0 ? 0 : _f;
var initiate = api.endpoints[name].initiate;
var dispatch = useDispatch2();
var stableArg = useStableQueryArgs(skip ? skipToken : arg, defaultSerializeQueryArgs, context.endpointDefinitions[name], name);
var stableSubscriptionOptions = useShallowStableValue({
refetchOnReconnect,
refetchOnFocus,
pollingInterval
});
var lastRenderHadSubscription = useRef(false);
var promiseRef = useRef();
var _g = promiseRef.current || {}, queryCacheKey = _g.queryCacheKey, requestId = _g.requestId;
var currentRenderHasSubscription = false;
if (queryCacheKey && requestId) {
var returnedValue = dispatch(api.internalActions.internal_probeSubscription({
queryCacheKey,
requestId
}));
if (process.env.NODE_ENV !== "production") {
if (typeof returnedValue !== "boolean") {
throw new Error('Warning: Middleware for RTK-Query API at reducerPath "' + api.reducerPath + '" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!');
}
}
currentRenderHasSubscription = !!returnedValue;
}
var subscriptionRemoved = !currentRenderHasSubscription && lastRenderHadSubscription.current;
usePossiblyImmediateEffect(function() {
lastRenderHadSubscription.current = currentRenderHasSubscription;
});
usePossiblyImmediateEffect(function() {
if (subscriptionRemoved) {
promiseRef.current = void 0;
}
}, [subscriptionRemoved]);
usePossiblyImmediateEffect(function() {
var _a;
var lastPromise = promiseRef.current;
if (typeof process !== "undefined" && process.env.NODE_ENV === "removeMeOnCompilation") {
console.log(subscriptionRemoved);
}
if (stableArg === skipToken) {
lastPromise == null ? void 0 : lastPromise.unsubscribe();
promiseRef.current = void 0;
return;
}
var lastSubscriptionOptions = (_a = promiseRef.current) == null ? void 0 : _a.subscriptionOptions;
if (!lastPromise || lastPromise.arg !== stableArg) {
lastPromise == null ? void 0 : lastPromise.unsubscribe();
var promise2 = dispatch(initiate(stableArg, {
subscriptionOptions: stableSubscriptionOptions,
forceRefetch: refetchOnMountOrArgChange
}));
promiseRef.current = promise2;
} else if (stableSubscriptionOptions !== lastSubscriptionOptions) {
lastPromise.updateSubscriptionOptions(stableSubscriptionOptions);
}
}, [
dispatch,
initiate,
refetchOnMountOrArgChange,
stableArg,
stableSubscriptionOptions,
subscriptionRemoved
]);
useEffect(function() {
return function() {
var _a;
(_a = promiseRef.current) == null ? void 0 : _a.unsubscribe();
promiseRef.current = void 0;
};
}, []);
return useMemo(function() {
return {
refetch: function() {
var _a;
if (!promiseRef.current)
throw new Error("Cannot refetch a query that has not been started yet.");
return (_a = promiseRef.current) == null ? void 0 : _a.refetch();
}
};
}, []);
};
var useLazyQuerySubscription = function(_c2) {
var _d2 = _c2 === void 0 ? {} : _c2, refetchOnReconnect = _d2.refetchOnReconnect, refetchOnFocus = _d2.refetchOnFocus, _e = _d2.pollingInterval, pollingInterval = _e === void 0 ? 0 : _e;
var initiate = api.endpoints[name].initiate;
var dispatch = useDispatch2();
var _f = useState(UNINITIALIZED_VALUE), arg = _f[0], setArg = _f[1];
var promiseRef = useRef();
var stableSubscriptionOptions = useShallowStableValue({
refetchOnReconnect,
refetchOnFocus,
pollingInterval
});
usePossiblyImmediateEffect(function() {
var _a, _b;
var lastSubscriptionOptions = (_a = promiseRef.current) == null ? void 0 : _a.subscriptionOptions;
if (stableSubscriptionOptions !== lastSubscriptionOptions) {
(_b = promiseRef.current) == null ? void 0 : _b.updateSubscriptionOptions(stableSubscriptionOptions);
}
}, [stableSubscriptionOptions]);
var subscriptionOptionsRef = useRef(stableSubscriptionOptions);
usePossiblyImmediateEffect(function() {
subscriptionOptionsRef.current = stableSubscriptionOptions;
}, [stableSubscriptionOptions]);
var trigger = useCallback(function(arg2, preferCacheValue) {
if (preferCacheValue === void 0) {
preferCacheValue = false;
}
var promise2;
batch2(function() {
var _a;
(_a = promiseRef.current) == null ? void 0 : _a.unsubscribe();
promiseRef.current = promise2 = dispatch(initiate(arg2, {
subscriptionOptions: subscriptionOptionsRef.current,
forceRefetch: !preferCacheValue
}));
setArg(arg2);
});
return promise2;
}, [dispatch, initiate]);
useEffect(function() {
return function() {
var _a;
(_a = promiseRef == null ? void 0 : promiseRef.current) == null ? void 0 : _a.unsubscribe();
};
}, []);
useEffect(function() {
if (arg !== UNINITIALIZED_VALUE && !promiseRef.current) {
trigger(arg, true);
}
}, [arg, trigger]);
return useMemo(function() {
return [trigger, arg];
}, [trigger, arg]);
};
var useQueryState = function(arg, _c2) {
var _d2 = _c2 === void 0 ? {} : _c2, _e = _d2.skip, skip = _e === void 0 ? false : _e, selectFromResult = _d2.selectFromResult;
var select = api.endpoints[name].select;
var stableArg = useStableQueryArgs(skip ? skipToken : arg, serializeQueryArgs, context.endpointDefinitions[name], name);
var lastValue = useRef();
var selectDefaultResult = useMemo(function() {
return createSelector([
select(stableArg),
function(_, lastResult) {
return lastResult;
},
function(_) {
return stableArg;
}
], queryStatePreSelector);
}, [select, stableArg]);
var querySelector = useMemo(function() {
return selectFromResult ? createSelector([selectDefaultResult], selectFromResult) : selectDefaultResult;
}, [selectDefaultResult, selectFromResult]);
var currentState = useSelector2(function(state) {
return querySelector(state, lastValue.current);
}, shallowEqual);
var store = useStore2();
var newLastValue = selectDefaultResult(store.getState(), lastValue.current);
useIsomorphicLayoutEffect(function() {
lastValue.current = newLastValue;
}, [newLastValue]);
return currentState;
};
return {
useQueryState,
useQuerySubscription,
useLazyQuerySubscription,
useLazyQuery: function(options) {
var _c2 = useLazyQuerySubscription(options), trigger = _c2[0], arg = _c2[1];
var queryStateResults = useQueryState(arg, __spreadProps(__spreadValues({}, options), {
skip: arg === UNINITIALIZED_VALUE
}));
var info = useMemo(function() {
return { lastArg: arg };
}, [arg]);
return useMemo(function() {
return [trigger, queryStateResults, info];
}, [trigger, queryStateResults, info]);
},
useQuery: function(arg, options) {
var querySubscriptionResults = useQuerySubscription(arg, options);
var queryStateResults = useQueryState(arg, __spreadValues({
selectFromResult: arg === skipToken || (options == null ? void 0 : options.skip) ? void 0 : noPendingQueryStateSelector
}, options));
var data = queryStateResults.data, status = queryStateResults.status, isLoading = queryStateResults.isLoading, isSuccess = queryStateResults.isSuccess, isError2 = queryStateResults.isError, error = queryStateResults.error;
useDebugValue({ data, status, isLoading, isSuccess, isError: isError2, error });
return useMemo(function() {
return __spreadValues(__spreadValues({}, queryStateResults), querySubscriptionResults);
}, [queryStateResults, querySubscriptionResults]);
}
};
}
function buildMutationHook(name) {
return function(_c2) {
var _d2 = _c2 === void 0 ? {} : _c2, _e = _d2.selectFromResult, selectFromResult = _e === void 0 ? defaultMutationStateSelector : _e, fixedCacheKey = _d2.fixedCacheKey;
var _f = api.endpoints[name], select = _f.select, initiate = _f.initiate;
var dispatch = useDispatch2();
var _g = useState(), promise2 = _g[0], setPromise = _g[1];
useEffect(function() {
return function() {
if (!(promise2 == null ? void 0 : promise2.arg.fixedCacheKey)) {
promise2 == null ? void 0 : promise2.reset();
}
};
}, [promise2]);
var triggerMutation = useCallback(function(arg) {
var promise22 = dispatch(initiate(arg, { fixedCacheKey }));
setPromise(promise22);
return promise22;
}, [dispatch, initiate, fixedCacheKey]);
var requestId = (promise2 || {}).requestId;
var mutationSelector = useMemo(function() {
return createSelector([select({ fixedCacheKey, requestId: promise2 == null ? void 0 : promise2.requestId })], selectFromResult);
}, [select, promise2, selectFromResult, fixedCacheKey]);
var currentState = useSelector2(mutationSelector, shallowEqual);
var originalArgs = fixedCacheKey == null ? promise2 == null ? void 0 : promise2.arg.originalArgs : void 0;
var reset = useCallback(function() {
batch2(function() {
if (promise2) {
setPromise(void 0);
}
if (fixedCacheKey) {
dispatch(api.internalActions.removeMutationResult({
requestId,
fixedCacheKey
}));
}
});
}, [dispatch, fixedCacheKey, promise2, requestId]);
var endpointName = currentState.endpointName, data = currentState.data, status = currentState.status, isLoading = currentState.isLoading, isSuccess = currentState.isSuccess, isError2 = currentState.isError, error = currentState.error;
useDebugValue({
endpointName,
data,
status,
isLoading,
isSuccess,
isError: isError2,
error
});
var finalState = useMemo(function() {
return __spreadProps(__spreadValues({}, currentState), { originalArgs, reset });
}, [currentState, originalArgs, reset]);
return useMemo(function() {
return [triggerMutation, finalState];
}, [triggerMutation, finalState]);
};
}
}
var DefinitionType;
(function(DefinitionType2) {
DefinitionType2["query"] = "query";
DefinitionType2["mutation"] = "mutation";
})(DefinitionType || (DefinitionType = {}));
function isQueryDefinition(e) {
return e.type === DefinitionType.query;
}
function isMutationDefinition(e) {
return e.type === DefinitionType.mutation;
}
function capitalize(str) {
return str.replace(str[0], str[0].toUpperCase());
}
function safeAssign(target) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
Object.assign.apply(Object, __spreadArray([target], args));
}
var reactHooksModuleName = /* @__PURE__ */ Symbol();
var reactHooksModule = function(_c) {
var _d = {}, _e = _d.batch, batch$1 = _e === void 0 ? batch : _e, _f = _d.useDispatch, useDispatch$1 = _f === void 0 ? useDispatch : _f, _g = _d.useSelector, useSelector$1 = _g === void 0 ? useSelector : _g, _h = _d.useStore, useStore$1 = _h === void 0 ? useStore : _h, _j = _d.unstable__sideEffectsInRender, unstable__sideEffectsInRender = _j === void 0 ? false : _j;
return {
name: reactHooksModuleName,
init: function(api, _c2, context) {
var serializeQueryArgs = _c2.serializeQueryArgs;
var anyApi = api;
var _d2 = buildHooks({
api,
moduleOptions: {
batch: batch$1,
useDispatch: useDispatch$1,
useSelector: useSelector$1,
useStore: useStore$1,
unstable__sideEffectsInRender
},
serializeQueryArgs,
context
}), buildQueryHooks = _d2.buildQueryHooks, buildMutationHook = _d2.buildMutationHook, usePrefetch = _d2.usePrefetch;
safeAssign(anyApi, { usePrefetch });
safeAssign(context, { batch: batch$1 });
return {
injectEndpoint: function(endpointName, definition) {
if (isQueryDefinition(definition)) {
var _c3 = buildQueryHooks(endpointName), useQuery = _c3.useQuery, useLazyQuery = _c3.useLazyQuery, useLazyQuerySubscription = _c3.useLazyQuerySubscription, useQueryState = _c3.useQueryState, useQuerySubscription = _c3.useQuerySubscription;
safeAssign(anyApi.endpoints[endpointName], {
useQuery,
useLazyQuery,
useLazyQuerySubscription,
useQueryState,
useQuerySubscription
});
api["use" + capitalize(endpointName) + "Query"] = useQuery;
api["useLazy" + capitalize(endpointName) + "Query"] = useLazyQuery;
} else if (isMutationDefinition(definition)) {
var useMutation = buildMutationHook(endpointName);
safeAssign(anyApi.endpoints[endpointName], {
useMutation
});
api["use" + capitalize(endpointName) + "Mutation"] = useMutation;
}
}
};
}
};
};
var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule());
const STORAGE_KEYS = {
TOKEN: "jwtToken",
USER: "userInfo"
};
class FetchError extends Error {
name;
message;
response;
code;
status;
constructor(message, response) {
super(message);
this.name = "FetchError";
this.message = message;
this.response = response;
this.code = response?.data?.error?.status;
this.status = response?.data?.error?.status;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, FetchError);
}
}
}
const isFetchError = (error) => {
return error instanceof FetchError;
};
const getToken = () => JSON.parse(
localStorage.getItem(STORAGE_KEYS.TOKEN) ?? sessionStorage.getItem(STORAGE_KEYS.TOKEN) ?? '""'
);
const getFetchClient = (defaultOptions = {}) => {
const backendURL = window.strapi.backendURL;
const defaultHeader = {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: `Bearer ${getToken()}`
};
const isFormDataRequest = (body) => body instanceof FormData;
const addPrependingSlash = (url) => url.charAt(0) !== "/" ? `/${url}` : url;
const hasProtocol = (url) => new RegExp("^(?:[a-z+]+:)?//", "i").test(url);
const normalizeUrl = (url) => hasProtocol(url) ? url : addPrependingSlash(url);
const responseInterceptor = async (response, validateStatus2) => {
try {
const result = await response.json();
if (!response.ok && result.error && !validateStatus2?.(response.status)) {
throw new FetchError(result.error.message, { data: result });
}
if (!response.ok && !validateStatus2?.(response.status)) {
throw new FetchError("Unknown Server Error");
}
return { data: result };
} catch (error) {
if (error instanceof SyntaxError && response.ok) {
return { data: [], status: response.status };
} else {
throw error;
}
}
};
const paramsSerializer = (params) => (url) => {
if (params) {
if (typeof params === "string") {
return `${url}?${params}`;
}
const serializedParams = qs__default.stringify(params, { encode: false });
return `${url}?${serializedParams}`;
}
return url;
};
const addBaseUrl = (url) => {
return `${backendURL}${url}`;
};
const makeCreateRequestUrl = (options) => pipe(normalizeUrl, addBaseUrl, paramsSerializer(options?.params));
const fetchClient = {
get: async (url, options) => {
const headers = new Headers({
...defaultHeader,
...options?.headers
});
const createRequestUrl = makeCreateRequestUrl(options);
const response = await fetch(createRequestUrl(url), {
signal: options?.signal ?? defaultOptions.signal,
method: "GET",
headers
});
return responseInterceptor(response, options?.validateStatus);
},
post: async (url, data, options) => {
const headers = new Headers({
...defaultHeader,
...options?.headers
});
const createRequestUrl = makeCreateRequestUrl(options);
if (isFormDataRequest(data)) {
headers.delete("Content-Type");
}
const response = await fetch(createRequestUrl(url), {
signal: options?.signal ?? defaultOptions.signal,
method: "POST",
headers,
body: isFormDataRequest(data) ? data : JSON.stringify(data)
});
return responseInterceptor(response, options?.validateStatus);
},
put: async (url, data, options) => {
const headers = new Headers({
...defaultHeader,
...options?.headers
});
const createRequestUrl = makeCreateRequestUrl(options);
if (isFormDataRequest(data)) {
headers.delete("Content-Type");
}
const response = await fetch(createRequestUrl(url), {
signal: options?.signal ?? defaultOptions.signal,
method: "PUT",
headers,
body: isFormDataRequest(data) ? data : JSON.stringify(data)
});
return responseInterceptor(response, options?.validateStatus);
},
del: async (url, options) => {
const headers = new Headers({
...defaultHeader,
...options?.headers
});
const createRequestUrl = makeCreateRequestUrl(options);
const response = await fetch(createRequestUrl(url), {
signal: options?.signal ?? defaultOptions.signal,
method: "DELETE",
headers
});
return responseInterceptor(response, options?.validateStatus);
}
};
return fetchClient;
};
const fetchBaseQuery = () => async (query, { signal }) => {
try {
const { get: get2, post, del, put } = getFetchClient();
if (typeof query === "string") {
const result = await get2(query, { signal });
return { data: result.data };
} else {
const { url, method = "GET", data, config } = query;
if (method === "POST") {
const result2 = await post(url, data, {
...config,
signal
});
return { data: result2.data };
}
if (method === "DELETE") {
const result2 = await del(url, {
...config,
signal
});
return { data: result2.data };
}
if (method === "PUT") {
const result2 = await put(url, data, {
...config,
signal
});
return { data: result2.data };
}
const result = await get2(url, {
...config,
signal
});
return { data: result.data };
}
} catch (err) {
if (isFetchError(err)) {
if (typeof err.response?.data === "object" && err.response?.data !== null && "error" in err.response?.data) {
return { data: void 0, error: err.response?.data.error };
} else {
return {
data: void 0,
error: {
name: "UnknownError",
message: err.message,
details: err.response,
status: err.status
}
};
}
}
const error = err;
return {
data: void 0,
error: {
name: error.name,
message: error.message,
stack: error.stack
}
};
}
};
const adminApi = createApi({
reducerPath: "adminApi",
baseQuery: fetchBaseQuery(),
tagTypes: [],
endpoints: () => ({})
});
const prefixFileUrlWithBackendUrl = (fileURL) => {
return !!fileURL && fileURL.startsWith("/") ? `${window.strapi.backendURL}${fileURL}` : fileURL;
};
adminApi.enhanceEndpoints({
addTagTypes: ["ProjectSettings", "LicenseLimits"]
}).injectEndpoints({
endpoints: (builder) => ({
init: builder.query({
query: () => ({
url: "/admin/init",
method: "GET"
}),
transformResponse(res) {
return res.data;
}
}),
information: builder.query({
query: () => ({
url: "/admin/information",
method: "GET"
}),
transformResponse(res) {
return res.data;
}
}),
telemetryProperties: builder.query({
query: () => ({
url: "/admin/telemetry-properties",
method: "GET",
config: {
validateStatus: (status) => status < 500
}
}),
transformResponse(res) {
return res.data;
}
}),
projectSettings: builder.query({
query: () => ({
url: "/admin/project-settings",
method: "GET"
}),
providesTags: ["ProjectSettings"],
transformResponse(data) {
return {
authLogo: data.authLogo ? {
name: data.authLogo.name,
url: prefixFileUrlWithBackendUrl(data.authLogo.url)
} : void 0,
menuLogo: data.menuLogo ? {
name: data.menuLogo.name,
url: prefixFileUrlWithBackendUrl(data.menuLogo.url)
} : void 0
};
}
}),
updateProjectSettings: builder.mutation({
query: (data) => ({
url: "/admin/project-settings",
method: "POST",
data,
config: {
headers: {
"Content-Type": "multipart/form-data"
}
}
}),
invalidatesTags: ["ProjectSettings"]
}),
getPlugins: builder.query({
query: () => ({
url: "/admin/plugins",
method: "GET"
})
}),
getLicenseLimits: builder.query({
query: () => ({
url: "/admin/license-limit-information",
method: "GET"
}),
providesTags: ["LicenseLimits"]
})
}),
overrideExisting: false
});
function bind(fn, thisArg) {
return function wrap() {
return fn.apply(thisArg, arguments);
};
}
const { toString: toString$1 } = Object.prototype;
const { getPrototypeOf } = Object;
const kindOf = /* @__PURE__ */ ((cache2) => (thing) => {
const str = toString$1.call(thing);
return cache2[str] || (cache2[str] = str.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null));
const kindOfTest = (type) => {
type = type.toLowerCase();
return (thing) => kindOf(thing) === type;
};
const typeOfTest = (type) => (thing) => typeof thing === type;
const { isArray } = Array;
const isUndefined = typeOfTest("undefined");
function isBuffer(val) {
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
}
const isArrayBuffer = kindOfTest("ArrayBuffer");
function isArrayBufferView(val) {
let result;
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
result = ArrayBuffer.isView(val);
} else {
result = val && val.buffer && isArrayBuffer(val.buffer);
}
return result;
}
const isString = typeOfTest("string");
const isFunction = typeOfTest("function");
const isNumber = typeOfTest("number");
const isObject$2 = (thing) => thing !== null && typeof thing === "object";
const isBoolean = (thing) => thing === true || thing === false;
const isPlainObject$1 = (val) => {
if (kindOf(val) !== "object") {
return false;
}
const prototype2 = getPrototypeOf(val);
return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
};
const isDate$1 = kindOfTest("Date");
const isFile = kindOfTest("File");
const isBlob = kindOfTest("Blob");
const isFileList = kindOfTest("FileList");
const isStream = (val) => isObject$2(val) && isFunction(val.pipe);
const isFormData = (thing) => {
let kind;
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
};
const isURLSearchParams = kindOfTest("URLSearchParams");
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
const trim$1 = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function forEach$1(obj, fn, { allOwnKeys = false } = {}) {
if (obj === null || typeof obj === "undefined") {
return;
}
let i;
let l;
if (typeof obj !== "object") {
obj = [obj];
}
if (isArray(obj)) {
for (i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj);
}
} else {
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
const len = keys.length;
let key;
for (i = 0; i < len; i++) {
key = keys[i];
fn.call(null, obj[key], key, obj);
}
}
}
function findKey(obj, key) {
key = key.toLowerCase();
const keys = Object.keys(obj);
let i = keys.length;
let _key;
while (i-- > 0) {
_key = keys[i];
if (key === _key.toLowerCase()) {
return _key;
}
}
return null;
}
const _global = (() => {
if (typeof globalThis !== "undefined") return globalThis;
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
})();
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
function merge() {
const { caseless } = isContextDefined(this) && this || {};
const result = {};
const assignValue = (val, key) => {
const targetKey = caseless && findKey(result, key) || key;
if (isPlainObject$1(result[targetKey]) && isPlainObject$1(val)) {
result[targetKey] = merge(result[targetKey], val);
} else if (isPlainObject$1(val)) {
result[targetKey] = merge({}, val);
} else if (isArray(val)) {
result[targetKey] = val.slice();
} else {
result[targetKey] = val;
}
};
for (let i = 0, l = arguments.length; i < l; i++) {
arguments[i] && forEach$1(arguments[i], assignValue);
}
return result;
}
const extend = (a2, b, thisArg, { allOwnKeys } = {}) => {
forEach$1(b, (val, key) => {
if (thisArg && isFunction(val)) {
a2[key] = bind(val, thisArg);
} else {
a2[key] = val;
}
}, { allOwnKeys });
return a2;
};
const stripBOM = (content) => {
if (content.charCodeAt(0) === 65279) {
content = content.slice(1);
}
return content;
};
const inherits = (constructor, superConstructor, props, descriptors2) => {
constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
constructor.prototype.constructor = constructor;
Object.defineProperty(constructor, "super", {
value: superConstructor.prototype
});
props && Object.assign(constructor.prototype, props);
};
const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
let props;
let i;
let prop;
const merged = {};
destObj = destObj || {};
if (sourceObj == null) return destObj;
do {
props = Object.getOwnPropertyNames(sourceObj);
i = props.length;
while (i-- > 0) {
prop = props[i];
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
destObj[prop] = sourceObj[prop];
merged[prop] = true;
}
}
sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
} while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
return destObj;
};
const endsWith = (str, searchString, position) => {
str = String(str);
if (position === void 0 || position > str.length) {
position = str.length;
}
position -= searchString.length;
const lastIndex = str.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
};
const toArray$1 = (thing) => {
if (!thing) return null;
if (isArray(thing)) return thing;
let i = thing.length;
if (!isNumber(i)) return null;
const arr = new Array(i);
while (i-- > 0) {
arr[i] = thing[i];
}
return arr;
};
const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
return (thing) => {
return TypedArray && thing instanceof TypedArray;
};
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
const forEachEntry = (obj, fn) => {
const generator = obj && obj[Symbol.iterator];
const iterator = generator.call(obj);
let result;
while ((result = iterator.next()) && !result.done) {
const pair = result.value;
fn.call(obj, pair[0], pair[1]);
}
};
const matchAll = (regExp, str) => {
let matches2;
const arr = [];
while ((matches2 = regExp.exec(str)) !== null) {
arr.push(matches2);
}
return arr;
};
const isHTMLForm = kindOfTest("HTMLFormElement");
const toCamelCase = (str) => {
return str.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function replacer(m, p1, p2) {
return p1.toUpperCase() + p2;
}
);
};
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
const isRegExp = kindOfTest("RegExp");
const reduceDescriptors = (obj, reducer2) => {
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
const reducedDescriptors = {};
forEach$1(descriptors2, (descriptor, name) => {
let ret;
if ((ret = reducer2(descriptor, name, obj)) !== false) {
reducedDescriptors[name] = ret || descriptor;
}
});
Object.defineProperties(obj, reducedDescriptors);
};
const freezeMethods = (obj) => {
reduceDescriptors(obj, (descriptor, name) => {
if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
return false;
}
const value = obj[name];
if (!isFunction(value)) return;
descriptor.enumerable = false;
if ("writable" in descriptor) {
descriptor.writable = false;
return;
}
if (!descriptor.set) {
descriptor.set = () => {
throw Error("Can not rewrite read-only method '" + name + "'");
};
}
});
};
const toObjectSet = (arrayOrString, delimiter) => {
const obj = {};
const define = (arr) => {
arr.forEach((value) => {
obj[value] = true;
});
};
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
return obj;
};
const noop$1 = () => {
};
const toFiniteNumber = (value, defaultValue) => {
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
};
const ALPHA = "abcdefghijklmnopqrstuvwxyz";
const DIGIT = "0123456789";
const ALPHABET = {
DIGIT,
ALPHA,
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
};
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
let str = "";
const { length } = alphabet;
while (size--) {
str += alphabet[Math.random() * length | 0];
}
return str;
};
function isSpecCompliantForm(thing) {
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
}
const toJSONObject = (obj) => {
const stack = new Array(10);
const visit = (source, i) => {
if (isObject$2(source)) {
if (stack.indexOf(source) >= 0) {
return;
}
if (!("toJSON" in source)) {
stack[i] = source;
const target = isArray(source) ? [] : {};
forEach$1(source, (value, key) => {
const reducedValue = visit(value, i + 1);
!isUndefined(reducedValue) && (target[key] = reducedValue);
});
stack[i] = void 0;
return target;
}
}
return source;
};
return visit(obj, 0);
};
const isAsyncFn = kindOfTest("AsyncFunction");
const isThenable = (thing) => thing && (isObject$2(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
if (setImmediateSupported) {
return setImmediate;
}
return postMessageSupported ? ((token, callbacks) => {
_global.addEventListener("message", ({ source, data }) => {
if (source === _global && data === token) {
callbacks.length && callbacks.shift()();
}
}, false);
return (cb) => {
callbacks.push(cb);
_global.postMessage(token, "*");
};
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
})(
typeof setImmediate === "function",
isFunction(_global.postMessage)
);
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
const utils$1 = {
isArray,
isArrayBuffer,
isBuffer,
isFormData,
isArrayBufferView,
isString,
isNumber,
isBoolean,
isObject: isObject$2,
isPlainObject: isPlainObject$1,
isReadableStream,
isRequest,
isResponse,
isHeaders,
isUndefined,
isDate: isDate$1,
isFile,
isBlob,
isRegExp,
isFunction,
isStream,
isURLSearchParams,
isTypedArray,
isFileList,
forEach: forEach$1,
merge,
extend,
trim: trim$1,
stripBOM,
inherits,
toFlatObject,
kindOf,
kindOfTest,
endsWith,
toArray: toArray$1,
forEachEntry,
matchAll,
isHTMLForm,
hasOwnProperty,
hasOwnProp: hasOwnProperty,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors,
freezeMethods,
toObjectSet,
toCamelCase,
noop: noop$1,
toFiniteNumber,
findKey,
global: _global,
isContextDefined,
ALPHABET,
generateString,
isSpecCompliantForm,
toJSONObject,
isAsyncFn,
isThenable,
setImmediate: _setImmediate,
asap
};
function AxiosError(message, code, config, request, response) {
Error.call(this);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = new Error().stack;
}
this.message = message;
this.name = "AxiosError";
code && (this.code = code);
config && (this.config = config);
request && (this.request = request);
response && (this.response = response);
}
utils$1.inherits(AxiosError, Error, {
toJSON: function toJSON() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: utils$1.toJSONObject(this.config),
code: this.code,
status: this.response && this.response.status ? this.response.status : null
};
}
});
const prototype$1 = AxiosError.prototype;
const descriptors = {};
[
"ERR_BAD_OPTION_VALUE",
"ERR_BAD_OPTION",
"ECONNABORTED",
"ETIMEDOUT",
"ERR_NETWORK",
"ERR_FR_TOO_MANY_REDIRECTS",
"ERR_DEPRECATED",
"ERR_BAD_RESPONSE",
"ERR_BAD_REQUEST",
"ERR_CANCELED",
"ERR_NOT_SUPPORT",
"ERR_INVALID_URL"
// eslint-disable-next-line func-names
].forEach((code) => {
descriptors[code] = { value: code };
});
Object.defineProperties(AxiosError, descriptors);
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
AxiosError.from = (error, code, config, request, response, customProps) => {
const axiosError = Object.create(prototype$1);
utils$1.toFlatObject(error, axiosError, function filter2(obj) {
return obj !== Error.prototype;
}, (prop) => {
return prop !== "isAxiosError";
});
AxiosError.call(axiosError, error.message, code, config, request, response);
axiosError.cause = error;
axiosError.name = error.name;
customProps && Object.assign(axiosError, customProps);
return axiosError;
};
const httpAdapter = null;
function isVisitable(thing) {
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
}
function removeBrackets(key) {
return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
}
function renderKey(path, key, dots) {
if (!path) return key;
return path.concat(key).map(function each(token, i) {
token = removeBrackets(token);
return !dots && i ? "[" + token + "]" : token;
}).join(dots ? "." : "");
}
function isFlatArray(arr) {
return utils$1.isArray(arr) && !arr.some(isVisitable);
}
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
return /^is[A-Z]/.test(prop);
});
function toFormData(obj, formData, options) {
if (!utils$1.isObject(obj)) {
throw new TypeError("target must be an object");
}
formData = formData || new FormData();
options = utils$1.toFlatObject(options, {
metaTokens: true,
dots: false,
indexes: false
}, false, function defined(option, source) {
return !utils$1.isUndefined(source[option]);
});
const metaTokens = options.metaTokens;
const visitor = options.visitor || defaultVisitor;
const dots = options.dots;
const indexes = options.indexes;
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
if (!utils$1.isFunction(visitor)) {
throw new TypeError("visitor must be a function");
}
function convertValue(value) {
if (value === null) return "";
if (utils$1.isDate(value)) {
return value.toISOString();
}
if (!useBlob && utils$1.isBlob(value)) {
throw new AxiosError("Blob is not supported. Use a Buffer instead.");
}
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
}
return value;
}
function defaultVisitor(value, key, path) {
let arr = value;
if (value && !path && typeof value === "object") {
if (utils$1.endsWith(key, "{}")) {
key = metaTokens ? key : key.slice(0, -2);
value = JSON.stringify(value);
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
key = removeBrackets(key);
arr.forEach(function each(el, index2) {
!(utils$1.isUndefined(el) || el === null) && formData.append(
// eslint-disable-next-line no-nested-ternary
indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
convertValue(el)
);
});
return false;
}
}
if (isVisitable(value)) {
return true;
}
formData.append(renderKey(path, key, dots), convertValue(value));
return false;
}
const stack = [];
const exposedHelpers = Object.assign(predicates, {
defaultVisitor,
convertValue,
isVisitable
});
function build(value, path) {
if (utils$1.isUndefined(value)) return;
if (stack.indexOf(value) !== -1) {
throw Error("Circular reference detected in " + path.join("."));
}
stack.push(value);
utils$1.forEach(value, function each(el, key) {
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
formData,
el,
utils$1.isString(key) ? key.trim() : key,
path,
exposedHelpers
);
if (result === true) {
build(el, path ? path.concat(key) : [key]);
}
});
stack.pop();
}
if (!utils$1.isObject(obj)) {
throw new TypeError("data must be an object");
}
build(obj);
return formData;
}
function encode$1(str) {
const charMap = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
return charMap[match];
});
}
function AxiosURLSearchParams(params, options) {
this._pairs = [];
params && toFormData(params, this, options);
}
const prototype = AxiosURLSearchParams.prototype;
prototype.append = function append(name, value) {
this._pairs.push([name, value]);
};
prototype.toString = function toString(encoder) {
const _encode = encoder ? function(value) {
return encoder.call(this, value, encode$1);
} : encode$1;
return this._pairs.map(function each(pair) {
return _encode(pair[0]) + "=" + _encode(pair[1]);
}, "").join("&");
};
function encode(val) {
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function buildURL(url, params, options) {
if (!params) {
return url;
}
const _encode = options && options.encode || encode;
const serializeFn = options && options.serialize;
let serializedParams;
if (serializeFn) {
serializedParams = serializeFn(params, options);
} else {
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
}
if (serializedParams) {
const hashmarkIndex = url.indexOf("#");
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
}
return url;
}
class InterceptorManager {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(fulfilled, rejected, options) {
this.handlers.push({
fulfilled,
rejected,
synchronous: options ? options.synchronous : false,
runWhen: options ? options.runWhen : null
});
return this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
*/
eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
if (this.handlers) {
this.handlers = [];
}
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(fn) {
utils$1.forEach(this.handlers, function forEachHandler(h2) {
if (h2 !== null) {
fn(h2);
}
});
}
}
const transitionalDefaults = {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
};
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
const platform$1 = {
isBrowser: true,
classes: {
URLSearchParams: URLSearchParams$1,
FormData: FormData$1,
Blob: Blob$1
},
protocols: ["http", "https", "file", "blob", "url", "data"]
};
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
const hasStandardBrowserEnv = ((product) => {
return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
})(typeof navigator !== "undefined" && navigator.product);
const hasStandardBrowserWebWorkerEnv = (() => {
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
})();
const origin = hasBrowserEnv && window.location.href || "http://localhost";
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv,
hasStandardBrowserEnv,
hasStandardBrowserWebWorkerEnv,
origin
}, Symbol.toStringTag, { value: "Module" }));
const platform = {
...utils,
...platform$1
};
function toURLEncodedForm(data, options) {
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
visitor: function(value, key, path, helpers) {
if (platform.isNode && utils$1.isBuffer(value)) {
this.append(key, value.toString("base64"));
return false;
}
return helpers.defaultVisitor.apply(this, arguments);
}
}, options));
}
function parsePropPath(name) {
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
return match[0] === "[]" ? "" : match[1] || match[0];
});
}
function arrayToObject(arr) {
const obj = {};
const keys = Object.keys(arr);
let i;
const len = keys.length;
let key;
for (i = 0; i < len; i++) {
key = keys[i];
obj[key] = arr[key];
}
return obj;
}
function formDataToJSON(formData) {
function buildPath(path, value, target, index2) {
let name = path[index2++];
if (name === "__proto__") return true;
const isNumericKey = Number.isFinite(+name);
const isLast = index2 >= path.length;
name = !name && utils$1.isArray(target) ? target.length : name;
if (isLast) {
if (utils$1.hasOwnProp(target, name)) {
target[name] = [target[name], value];
} else {
target[name] = value;
}
return !isNumericKey;
}
if (!target[name] || !utils$1.isObject(target[name])) {
target[name] = [];
}
const result = buildPath(path, value, target[name], index2);
if (result && utils$1.isArray(target[name])) {
target[name] = arrayToObject(target[name]);
}
return !isNumericKey;
}
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
const obj = {};
utils$1.forEachEntry(formData, (name, value) => {
buildPath(parsePropPath(name), value, obj, 0);
});
return obj;
}
return null;
}
function stringifySafely(rawValue, parser, encoder) {
if (utils$1.isString(rawValue)) {
try {
(parser || JSON.parse)(rawValue);
return utils$1.trim(rawValue);
} catch (e) {
if (e.name !== "SyntaxError") {
throw e;
}
}
}
return (0, JSON.stringify)(rawValue);
}
const defaults = {
transitional: transitionalDefaults,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function transformRequest(data, headers) {
const contentType = headers.getContentType() || "";
const hasJSONContentType = contentType.indexOf("application/json") > -1;
const isObjectPayload = utils$1.isObject(data);
if (isObjectPayload && utils$1.isHTMLForm(data)) {
data = new FormData(data);
}
const isFormData2 = utils$1.isFormData(data);
if (isFormData2) {
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
}
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
return data;
}
if (utils$1.isArrayBufferView(data)) {
return data.buffer;
}
if (utils$1.isURLSearchParams(data)) {
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
return data.toString();
}
let isFileList2;
if (isObjectPayload) {
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
return toURLEncodedForm(data, this.formSerializer).toString();
}
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
const _FormData = this.env && this.env.FormData;
return toFormData(
isFileList2 ? { "files[]": data } : data,
_FormData && new _FormData(),
this.formSerializer
);
}
}
if (isObjectPayload || hasJSONContentType) {
headers.setContentType("application/json", false);
return stringifySafely(data);
}
return data;
}],
transformResponse: [function transformResponse(data) {
const transitional2 = this.transitional || defaults.transitional;
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
const JSONRequested = this.responseType === "json";
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
return data;
}
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
const strictJSONParsing = !silentJSONParsing && JSONRequested;
try {
return JSON.parse(data);
} catch (e) {
if (strictJSONParsing) {
if (e.name === "SyntaxError") {
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
}
throw e;
}
}
}
return data;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: platform.classes.FormData,
Blob: platform.classes.Blob
},
validateStatus: function validateStatus(status) {
return status >= 200 && status < 300;
},
headers: {
common: {
"Accept": "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
defaults.headers[method] = {};
});
const ignoreDuplicateOf = utils$1.toObjectSet([
"age",
"authorization",
"content-length",
"content-type",
"etag",
"expires",
"from",
"host",
"if-modified-since",
"if-unmodified-since",
"last-modified",
"location",
"max-forwards",
"proxy-authorization",
"referer",
"retry-after",
"user-agent"
]);
const parseHeaders = (rawHeaders) => {
const parsed = {};
let key;
let val;
let i;
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
i = line.indexOf(":");
key = line.substring(0, i).trim().toLowerCase();
val = line.substring(i + 1).trim();
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
return;
}
if (key === "set-cookie") {
if (parsed[key]) {
parsed[key].push(val);
} else {
parsed[key] = [val];
}
} else {
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
}
});
return parsed;
};
const $internals = Symbol("internals");
function normalizeHeader(header) {
return header && String(header).trim().toLowerCase();
}
function normalizeValue(value) {
if (value === false || value == null) {
return value;
}
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
}
function parseTokens(str) {
const tokens = /* @__PURE__ */ Object.create(null);
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let match;
while (match = tokensRE.exec(str)) {
tokens[match[1]] = match[2];
}
return tokens;
}
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
if (utils$1.isFunction(filter2)) {
return filter2.call(this, value, header);
}
if (isHeaderNameFilter) {
value = header;
}
if (!utils$1.isString(value)) return;
if (utils$1.isString(filter2)) {
return value.indexOf(filter2) !== -1;
}
if (utils$1.isRegExp(filter2)) {
return filter2.test(value);
}
}
function formatHeader(header) {
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
return char.toUpperCase() + str;
});
}
function buildAccessors(obj, header) {
const accessorName = utils$1.toCamelCase(" " + header);
["get", "set", "has"].forEach((methodName) => {
Object.defineProperty(obj, methodName + accessorName, {
value: function(arg1, arg2, arg3) {
return this[methodName].call(this, header, arg1, arg2, arg3);
},
configurable: true
});
});
}
class AxiosHeaders {
constructor(headers) {
headers && this.set(headers);
}
set(header, valueOrRewrite, rewrite) {
const self2 = this;
function setHeader(_value, _header, _rewrite) {
const lHeader = normalizeHeader(_header);
if (!lHeader) {
throw new Error("header name must be a non-empty string");
}
const key = utils$1.findKey(self2, lHeader);
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
self2[key || _header] = normalizeValue(_value);
}
}
const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
setHeaders(header, valueOrRewrite);
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
setHeaders(parseHeaders(header), valueOrRewrite);
} else if (utils$1.isHeaders(header)) {
for (const [key, value] of header.entries()) {
setHeader(value, key, rewrite);
}
} else {
header != null && setHeader(valueOrRewrite, header, rewrite);
}
return this;
}
get(header, parser) {
header = normalizeHeader(header);
if (header) {
const key = utils$1.findKey(this, header);
if (key) {
const value = this[key];
if (!parser) {
return value;
}
if (parser === true) {
return parseTokens(value);
}
if (utils$1.isFunction(parser)) {
return parser.call(this, value, key);
}
if (utils$1.isRegExp(parser)) {
return parser.exec(value);
}
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(header, matcher) {
header = normalizeHeader(header);
if (header) {
const key = utils$1.findKey(this, header);
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
}
return false;
}
delete(header, matcher) {
const self2 = this;
let deleted = false;
function deleteHeader(_header) {
_header = normalizeHeader(_header);
if (_header) {
const key = utils$1.findKey(self2, _header);
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
delete self2[key];
deleted = true;
}
}
}
if (utils$1.isArray(header)) {
header.forEach(deleteHeader);
} else {
deleteHeader(header);
}
return deleted;
}
clear(matcher) {
const keys = Object.keys(this);
let i = keys.length;
let deleted = false;
while (i--) {
const key = keys[i];
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
delete this[key];
deleted = true;
}
}
return deleted;
}
normalize(format) {
const self2 = this;
const headers = {};
utils$1.forEach(this, (value, header) => {
const key = utils$1.findKey(headers, header);
if (key) {
self2[key] = normalizeValue(value);
delete self2[header];
return;
}
const normalized = format ? formatHeader(header) : String(header).trim();
if (normalized !== header) {
delete self2[header];
}
self2[normalized] = normalizeValue(value);
headers[normalized] = true;
});
return this;
}
concat(...targets) {
return this.constructor.concat(this, ...targets);
}
toJSON(asStrings) {
const obj = /* @__PURE__ */ Object.create(null);
utils$1.forEach(this, (value, header) => {
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
});
return obj;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(thing) {
return thing instanceof this ? thing : new this(thing);
}
static concat(first, ...targets) {
const computed = new this(first);
targets.forEach((target) => computed.set(target));
return computed;
}
static accessor(header) {
const internals = this[$internals] = this[$internals] = {
accessors: {}
};
const accessors = internals.accessors;
const prototype2 = this.prototype;
function defineAccessor(_header) {
const lHeader = normalizeHeader(_header);
if (!accessors[lHeader]) {
buildAccessors(prototype2, _header);
accessors[lHeader] = true;
}
}
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
return this;
}
}
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
let mapped = key[0].toUpperCase() + key.slice(1);
return {
get: () => value,
set(headerValue) {
this[mapped] = headerValue;
}
};
});
utils$1.freezeMethods(AxiosHeaders);
function transformData(fns, response) {
const config = this || defaults;
const context = response || config;
const headers = AxiosHeaders.from(context.headers);
let data = context.data;
utils$1.forEach(fns, function transform(fn) {
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
});
headers.normalize();
return data;
}
function isCancel(value) {
return !!(value && value.__CANCEL__);
}
function CanceledError(message, config, request) {
AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request);
this.name = "CanceledError";
}
utils$1.inherits(CanceledError, AxiosError, {
__CANCEL__: true
});
function settle(resolve, reject, response) {
const validateStatus2 = response.config.validateStatus;
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
resolve(response);
} else {
reject(new AxiosError(
"Request failed with status code " + response.status,
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
response.config,
response.request,
response
));
}
}
function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
return match && match[1] || "";
}
function speedometer(samplesCount, min) {
samplesCount = samplesCount || 10;
const bytes = new Array(samplesCount);
const timestamps = new Array(samplesCount);
let head = 0;
let tail = 0;
let firstSampleTS;
min = min !== void 0 ? min : 1e3;
return function push(chunkLength) {
const now = Date.now();
const startedAt = timestamps[tail];
if (!firstSampleTS) {
firstSampleTS = now;
}
bytes[head] = chunkLength;
timestamps[head] = now;
let i = tail;
let bytesCount = 0;
while (i !== head) {
bytesCount += bytes[i++];
i = i % samplesCount;
}
head = (head + 1) % samplesCount;
if (head === tail) {
tail = (tail + 1) % samplesCount;
}
if (now - firstSampleTS < min) {
return;
}
const passed = startedAt && now - startedAt;
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
};
}
function throttle(fn, freq) {
let timestamp = 0;
let threshold = 1e3 / freq;
let lastArgs;
let timer;
const invoke = (args, now = Date.now()) => {
timestamp = now;
lastArgs = null;
if (timer) {
clearTimeout(timer);
timer = null;
}
fn.apply(null, args);
};
const throttled = (...args) => {
const now = Date.now();
const passed = now - timestamp;
if (passed >= threshold) {
invoke(args, now);
} else {
lastArgs = args;
if (!timer) {
timer = setTimeout(() => {
timer = null;
invoke(lastArgs);
}, threshold - passed);
}
}
};
const flush = () => lastArgs && invoke(lastArgs);
return [throttled, flush];
}
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
let bytesNotified = 0;
const _speedometer = speedometer(50, 250);
return throttle((e) => {
const loaded = e.loaded;
const total = e.lengthComputable ? e.total : void 0;
const progressBytes = loaded - bytesNotified;
const rate = _speedometer(progressBytes);
const inRange = loaded <= total;
bytesNotified = loaded;
const data = {
loaded,
total,
progress: total ? loaded / total : void 0,
bytes: progressBytes,
rate: rate ? rate : void 0,
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
event: e,
lengthComputable: total != null,
[isDownloadStream ? "download" : "upload"]: true
};
listener(data);
}, freq);
};
const progressEventDecorator = (total, throttled) => {
const lengthComputable = total != null;
return [(loaded) => throttled[0]({
lengthComputable,
total,
loaded
}), throttled[1]];
};
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
function standardBrowserEnv() {
const msie = /(msie|trident)/i.test(navigator.userAgent);
const urlParsingNode = document.createElement("a");
let originURL;
function resolveURL(url) {
let href = url;
if (msie) {
urlParsingNode.setAttribute("href", href);
href = urlParsingNode.href;
}
urlParsingNode.setAttribute("href", href);
return {
href: urlParsingNode.href,
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
host: urlParsingNode.host,
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
hostname: urlParsingNode.hostname,
port: urlParsingNode.port,
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
};
}
originURL = resolveURL(window.location.href);
return function isURLSameOrigin2(requestURL) {
const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
};
}()
) : (
// Non standard browser envs (web workers, react-native) lack needed support.
/* @__PURE__ */ function nonStandardBrowserEnv() {
return function isURLSameOrigin2() {
return true;
};
}()
);
const cookies = platform.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(name, value, expires, path, domain, secure) {
const cookie = [name + "=" + encodeURIComponent(value)];
utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
utils$1.isString(path) && cookie.push("path=" + path);
utils$1.isString(domain) && cookie.push("domain=" + domain);
secure === true && cookie.push("secure");
document.cookie = cookie.join("; ");
},
read(name) {
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
return match ? decodeURIComponent(match[3]) : null;
},
remove(name) {
this.write(name, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function isAbsoluteURL(url) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
}
function combineURLs(baseURL, relativeURL) {
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
}
function buildFullPath(baseURL, requestedURL) {
if (baseURL && !isAbsoluteURL(requestedURL)) {
return combineURLs(baseURL, requestedURL);
}
return requestedURL;
}
const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
function mergeConfig(config1, config2) {
config2 = config2 || {};
const config = {};
function getMergedValue(target, source, caseless) {
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
return utils$1.merge.call({ caseless }, target, source);
} else if (utils$1.isPlainObject(source)) {
return utils$1.merge({}, source);
} else if (utils$1.isArray(source)) {
return source.slice();
}
return source;
}
function mergeDeepProperties(a2, b, caseless) {
if (!utils$1.isUndefined(b)) {
return getMergedValue(a2, b, caseless);
} else if (!utils$1.isUndefined(a2)) {
return getMergedValue(void 0, a2, caseless);
}
}
function valueFromConfig2(a2, b) {
if (!utils$1.isUndefined(b)) {
return getMergedValue(void 0, b);
}
}
function defaultToConfig2(a2, b) {
if (!utils$1.isUndefined(b)) {
return getMergedValue(void 0, b);
} else if (!utils$1.isUndefined(a2)) {
return getMergedValue(void 0, a2);
}
}
function mergeDirectKeys(a2, b, prop) {
if (prop in config2) {
return getMergedValue(a2, b);
} else if (prop in config1) {
return getMergedValue(void 0, a2);
}
}
const mergeMap = {
url: valueFromConfig2,
method: valueFromConfig2,
data: valueFromConfig2,
baseURL: defaultToConfig2,
transformRequest: defaultToConfig2,
transformResponse: defaultToConfig2,
paramsSerializer: defaultToConfig2,
timeout: defaultToConfig2,
timeoutMessage: defaultToConfig2,
withCredentials: defaultToConfig2,
withXSRFToken: defaultToConfig2,
adapter: defaultToConfig2,
responseType: defaultToConfig2,
xsrfCookieName: defaultToConfig2,
xsrfHeaderName: defaultToConfig2,
onUploadProgress: defaultToConfig2,
onDownloadProgress: defaultToConfig2,
decompress: defaultToConfig2,
maxContentLength: defaultToConfig2,
maxBodyLength: defaultToConfig2,
beforeRedirect: defaultToConfig2,
transport: defaultToConfig2,
httpAgent: defaultToConfig2,
httpsAgent: defaultToConfig2,
cancelToken: defaultToConfig2,
socketPath: defaultToConfig2,
responseEncoding: defaultToConfig2,
validateStatus: mergeDirectKeys,
headers: (a2, b) => mergeDeepProperties(headersToObject(a2), headersToObject(b), true)
};
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
const merge2 = mergeMap[prop] || mergeDeepProperties;
const configValue = merge2(config1[prop], config2[prop], prop);
utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
});
return config;
}
const resolveConfig = (config) => {
const newConfig = mergeConfig({}, config);
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
newConfig.headers = headers = AxiosHeaders.from(headers);
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
if (auth) {
headers.set(
"Authorization",
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
);
}
let contentType;
if (utils$1.isFormData(data)) {
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
headers.setContentType(void 0);
} else if ((contentType = headers.getContentType()) !== false) {
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
}
}
if (platform.hasStandardBrowserEnv) {
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
if (xsrfValue) {
headers.set(xsrfHeaderName, xsrfValue);
}
}
}
return newConfig;
};
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
const xhrAdapter = isXHRAdapterSupported && function(config) {
return new Promise(function dispatchXhrRequest(resolve, reject) {
const _config = resolveConfig(config);
let requestData = _config.data;
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
let { responseType, onUploadProgress, onDownloadProgress } = _config;
let onCanceled;
let uploadThrottled, downloadThrottled;
let flushUpload, flushDownload;
function done() {
flushUpload && flushUpload();
flushDownload && flushDownload();
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
}
let request = new XMLHttpRequest();
request.open(_config.method.toUpperCase(), _config.url, true);
request.timeout = _config.timeout;
function onloadend() {
if (!request) {
return;
}
const responseHeaders = AxiosHeaders.from(
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
);
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
const response = {
data: responseData,
status: request.status,
statusText: request.statusText,
headers: responseHeaders,
config,
request
};
settle(function _resolve(value) {
resolve(value);
done();
}, function _reject(err) {
reject(err);
done();
}, response);
request = null;
}
if ("onloadend" in request) {
request.onloadend = onloadend;
} else {
request.onreadystatechange = function handleLoad() {
if (!request || request.readyState !== 4) {
return;
}
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
return;
}
setTimeout(onloadend);
};
}
request.onabort = function handleAbort() {
if (!request) {
return;
}
reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
request = null;
};
request.onerror = function handleError() {
reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request));
request = null;
};
request.ontimeout = function handleTimeout() {
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
const transitional2 = _config.transitional || transitionalDefaults;
if (_config.timeoutErrorMessage) {
timeoutErrorMessage = _config.timeoutErrorMessage;
}
reject(new AxiosError(
timeoutErrorMessage,
transitional2.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
config,
request
));
request = null;
};
requestData === void 0 && requestHeaders.setContentType(null);
if ("setRequestHeader" in request) {
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
request.setRequestHeader(key, val);
});
}
if (!utils$1.isUndefined(_config.withCredentials)) {
request.withCredentials = !!_config.withCredentials;
}
if (responseType && responseType !== "json") {
request.responseType = _config.responseType;
}
if (onDownloadProgress) {
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
request.addEventListener("progress", downloadThrottled);
}
if (onUploadProgress && request.upload) {
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
request.upload.addEventListener("progress", uploadThrottled);
request.upload.addEventListener("loadend", flushUpload);
}
if (_config.cancelToken || _config.signal) {
onCanceled = (cancel) => {
if (!request) {
return;
}
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
request.abort();
request = null;
};
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
if (_config.signal) {
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
}
}
const protocol = parseProtocol(_config.url);
if (protocol && platform.protocols.indexOf(protocol) === -1) {
reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
return;
}
request.send(requestData || null);
});
};
const composeSignals = (signals, timeout) => {
let controller = new AbortController();
let aborted;
const onabort = function(cancel) {
if (!aborted) {
aborted = true;
unsubscribe();
const err = cancel instanceof Error ? cancel : this.reason;
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
}
};
let timer = timeout && setTimeout(() => {
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
}, timeout);
const unsubscribe = () => {
if (signals) {
timer && clearTimeout(timer);
timer = null;
signals.forEach((signal2) => {
signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort));
});
signals = null;
}
};
signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort));
const { signal } = controller;
signal.unsubscribe = unsubscribe;
return [signal, () => {
timer && clearTimeout(timer);
timer = null;
}];
};
const streamChunk = function* (chunk, chunkSize) {
let len = chunk.byteLength;
if (len < chunkSize) {
yield chunk;
return;
}
let pos = 0;
let end;
while (pos < len) {
end = pos + chunkSize;
yield chunk.slice(pos, end);
pos = end;
}
};
const readBytes = async function* (iterable, chunkSize, encode2) {
for await (const chunk of iterable) {
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : await encode2(String(chunk)), chunkSize);
}
};
const trackStream = (stream, chunkSize, onProgress, onFinish, encode2) => {
const iterator = readBytes(stream, chunkSize, encode2);
let bytes = 0;
let done;
let _onFinish = (e) => {
if (!done) {
done = true;
onFinish && onFinish(e);
}
};
return new ReadableStream({
async pull(controller) {
try {
const { done: done2, value } = await iterator.next();
if (done2) {
_onFinish();
controller.close();
return;
}
let len = value.byteLength;
if (onProgress) {
let loadedBytes = bytes += len;
onProgress(loadedBytes);
}
controller.enqueue(new Uint8Array(value));
} catch (err) {
_onFinish(err);
throw err;
}
},
cancel(reason) {
_onFinish(reason);
return iterator.return();
}
}, {
highWaterMark: 2
});
};
const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
const test = (fn, ...args) => {
try {
return !!fn(...args);
} catch (e) {
return false;
}
};
const supportsRequestStream = isReadableStreamSupported && test(() => {
let duplexAccessed = false;
const hasContentType = new Request(platform.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
duplexAccessed = true;
return "half";
}
}).headers.has("Content-Type");
return duplexAccessed && !hasContentType;
});
const DEFAULT_CHUNK_SIZE = 64 * 1024;
const supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
const resolvers = {
stream: supportsResponseStream && ((res) => res.body)
};
isFetchSupported && ((res) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
});
});
})(new Response());
const getBodyLength = async (body) => {
if (body == null) {
return 0;
}
if (utils$1.isBlob(body)) {
return body.size;
}
if (utils$1.isSpecCompliantForm(body)) {
return (await new Request(body).arrayBuffer()).byteLength;
}
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
return body.byteLength;
}
if (utils$1.isURLSearchParams(body)) {
body = body + "";
}
if (utils$1.isString(body)) {
return (await encodeText(body)).byteLength;
}
};
const resolveBodyLength = async (headers, body) => {
const length = utils$1.toFiniteNumber(headers.getContentLength());
return length == null ? getBodyLength(body) : length;
};
const fetchAdapter = isFetchSupported && (async (config) => {
let {
url,
method,
data,
signal,
cancelToken,
timeout,
onDownloadProgress,
onUploadProgress,
responseType,
headers,
withCredentials = "same-origin",
fetchOptions
} = resolveConfig(config);
responseType = responseType ? (responseType + "").toLowerCase() : "text";
let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals([signal, cancelToken], timeout) : [];
let finished, request;
const onFinish = () => {
!finished && setTimeout(() => {
composedSignal && composedSignal.unsubscribe();
});
finished = true;
};
let requestContentLength;
try {
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
let _request = new Request(url, {
method: "POST",
body: data,
duplex: "half"
});
let contentTypeHeader;
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
headers.setContentType(contentTypeHeader);
}
if (_request.body) {
const [onProgress, flush] = progressEventDecorator(
requestContentLength,
progressEventReducer(asyncDecorator(onUploadProgress))
);
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
}
}
if (!utils$1.isString(withCredentials)) {
withCredentials = withCredentials ? "include" : "omit";
}
request = new Request(url, {
...fetchOptions,
signal: composedSignal,
method: method.toUpperCase(),
headers: headers.normalize().toJSON(),
body: data,
duplex: "half",
credentials: withCredentials
});
let response = await fetch(request);
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
const options = {};
["status", "statusText", "headers"].forEach((prop) => {
options[prop] = response[prop];
});
const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
responseContentLength,
progressEventReducer(asyncDecorator(onDownloadProgress), true)
) || [];
response = new Response(
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
flush && flush();
isStreamResponse && onFinish();
}, encodeText),
options
);
}
responseType = responseType || "text";
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
!isStreamResponse && onFinish();
stopTimeout && stopTimeout();
return await new Promise((resolve, reject) => {
settle(resolve, reject, {
data: responseData,
headers: AxiosHeaders.from(response.headers),
status: response.status,
statusText: response.statusText,
config,
request
});
});
} catch (err) {
onFinish();
if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
throw Object.assign(
new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request),
{
cause: err.cause || err
}
);
}
throw AxiosError.from(err, err && err.code, config, request);
}
});
const knownAdapters = {
http: httpAdapter,
xhr: xhrAdapter,
fetch: fetchAdapter
};
utils$1.forEach(knownAdapters, (fn, value) => {
if (fn) {
try {
Object.defineProperty(fn, "name", { value });
} catch (e) {
}
Object.defineProperty(fn, "adapterName", { value });
}
});
const renderReason = (reason) => `- ${reason}`;
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
const adapters = {
getAdapter: (adapters2) => {
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
const { length } = adapters2;
let nameOrAdapter;
let adapter;
const rejectedReasons = {};
for (let i = 0; i < length; i++) {
nameOrAdapter = adapters2[i];
let id;
adapter = nameOrAdapter;
if (!isResolvedHandle(nameOrAdapter)) {
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
if (adapter === void 0) {
throw new AxiosError(`Unknown adapter '${id}'`);
}
}
if (adapter) {
break;
}
rejectedReasons[id || "#" + i] = adapter;
}
if (!adapter) {
const reasons = Object.entries(rejectedReasons).map(
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
);
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
throw new AxiosError(
`There is no suitable adapter to dispatch the request ` + s,
"ERR_NOT_SUPPORT"
);
}
return adapter;
},
adapters: knownAdapters
};
function throwIfCancellationRequested(config) {
if (config.cancelToken) {
config.cancelToken.throwIfRequested();
}
if (config.signal && config.signal.aborted) {
throw new CanceledError(null, config);
}
}
function dispatchRequest(config) {
throwIfCancellationRequested(config);
config.headers = AxiosHeaders.from(config.headers);
config.data = transformData.call(
config,
config.transformRequest
);
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
config.headers.setContentType("application/x-www-form-urlencoded", false);
}
const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
return adapter(config).then(function onAdapterResolution(response) {
throwIfCancellationRequested(config);
response.data = transformData.call(
config,
config.transformResponse,
response
);
response.headers = AxiosHeaders.from(response.headers);
return response;
}, function onAdapterRejection(reason) {
if (!isCancel(reason)) {
throwIfCancellationRequested(config);
if (reason && reason.response) {
reason.response.data = transformData.call(
config,
config.transformResponse,
reason.response
);
reason.response.headers = AxiosHeaders.from(reason.response.headers);
}
}
return Promise.reject(reason);
});
}
const VERSION = "1.7.4";
const validators$1 = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
validators$1[type] = function validator2(thing) {
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
};
});
const deprecatedWarnings = {};
validators$1.transitional = function transitional(validator2, version, message) {
function formatMessage(opt, desc) {
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
}
return (value, opt, opts) => {
if (validator2 === false) {
throw new AxiosError(
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
AxiosError.ERR_DEPRECATED
);
}
if (version && !deprecatedWarnings[opt]) {
deprecatedWarnings[opt] = true;
console.warn(
formatMessage(
opt,
" has been deprecated since v" + version + " and will be removed in the near future"
)
);
}
return validator2 ? validator2(value, opt, opts) : true;
};
};
function assertOptions(options, schema, allowUnknown) {
if (typeof options !== "object") {
throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
}
const keys = Object.keys(options);
let i = keys.length;
while (i-- > 0) {
const opt = keys[i];
const validator2 = schema[opt];
if (validator2) {
const value = options[opt];
const result = value === void 0 || validator2(value, opt, options);
if (result !== true) {
throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
}
continue;
}
if (allowUnknown !== true) {
throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
}
}
}
const validator = {
assertOptions,
validators: validators$1
};
const validators = validator.validators;
class Axios {
constructor(instanceConfig) {
this.defaults = instanceConfig;
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()
};
}
/**
* Dispatch a request
*
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
* @param {?Object} config
*
* @returns {Promise} The Promise to be fulfilled
*/
async request(configOrUrl, config) {
try {
return await this._request(configOrUrl, config);
} catch (err) {
if (err instanceof Error) {
let dummy;
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
try {
if (!err.stack) {
err.stack = stack;
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
err.stack += "\n" + stack;
}
} catch (e) {
}
}
throw err;
}
}
_request(configOrUrl, config) {
if (typeof configOrUrl === "string") {
config = config || {};
config.url = configOrUrl;
} else {
config = configOrUrl || {};
}
config = mergeConfig(this.defaults, config);
const { transitional: transitional2, paramsSerializer, headers } = config;
if (transitional2 !== void 0) {
validator.assertOptions(transitional2, {
silentJSONParsing: validators.transitional(validators.boolean),
forcedJSONParsing: validators.transitional(validators.boolean),
clarifyTimeoutError: validators.transitional(validators.boolean)
}, false);
}
if (paramsSerializer != null) {
if (utils$1.isFunction(paramsSerializer)) {
config.paramsSerializer = {
serialize: paramsSerializer
};
} else {
validator.assertOptions(paramsSerializer, {
encode: validators.function,
serialize: validators.function
}, true);
}
}
config.method = (config.method || this.defaults.method || "get").toLowerCase();
let contextHeaders = headers && utils$1.merge(
headers.common,
headers[config.method]
);
headers && utils$1.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(method) => {
delete headers[method];
}
);
config.headers = AxiosHeaders.concat(contextHeaders, headers);
const requestInterceptorChain = [];
let synchronousRequestInterceptors = true;
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
return;
}
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
});
const responseInterceptorChain = [];
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
});
let promise2;
let i = 0;
let len;
if (!synchronousRequestInterceptors) {
const chain = [dispatchRequest.bind(this), void 0];
chain.unshift.apply(chain, requestInterceptorChain);
chain.push.apply(chain, responseInterceptorChain);
len = chain.length;
promise2 = Promise.resolve(config);
while (i < len) {
promise2 = promise2.then(chain[i++], chain[i++]);
}
return promise2;
}
len = requestInterceptorChain.length;
let newConfig = config;
i = 0;
while (i < len) {
const onFulfilled = requestInterceptorChain[i++];
const onRejected = requestInterceptorChain[i++];
try {
newConfig = onFulfilled(newConfig);
} catch (error) {
onRejected.call(this, error);
break;
}
}
try {
promise2 = dispatchRequest.call(this, newConfig);
} catch (error) {
return Promise.reject(error);
}
i = 0;
len = responseInterceptorChain.length;
while (i < len) {
promise2 = promise2.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
}
return promise2;
}
getUri(config) {
config = mergeConfig(this.defaults, config);
const fullPath = buildFullPath(config.baseURL, config.url);
return buildURL(fullPath, config.params, config.paramsSerializer);
}
}
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
Axios.prototype[method] = function(url, config) {
return this.request(mergeConfig(config || {}, {
method,
url,
data: (config || {}).data
}));
};
});
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
function generateHTTPMethod(isForm) {
return function httpMethod(url, data, config) {
return this.request(mergeConfig(config || {}, {
method,
headers: isForm ? {
"Content-Type": "multipart/form-data"
} : {},
url,
data
}));
};
}
Axios.prototype[method] = generateHTTPMethod();
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
});
class CancelToken {
constructor(executor) {
if (typeof executor !== "function") {
throw new TypeError("executor must be a function.");
}
let resolvePromise;
this.promise = new Promise(function promiseExecutor(resolve) {
resolvePromise = resolve;
});
const token = this;
this.promise.then((cancel) => {
if (!token._listeners) return;
let i = token._listeners.length;
while (i-- > 0) {
token._listeners[i](cancel);
}
token._listeners = null;
});
this.promise.then = (onfulfilled) => {
let _resolve;
const promise2 = new Promise((resolve) => {
token.subscribe(resolve);
_resolve = resolve;
}).then(onfulfilled);
promise2.cancel = function reject() {
token.unsubscribe(_resolve);
};
return promise2;
};
executor(function cancel(message, config, request) {
if (token.reason) {
return;
}
token.reason = new CanceledError(message, config, request);
resolvePromise(token.reason);
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason) {
throw this.reason;
}
}
/**
* Subscribe to the cancel signal
*/
subscribe(listener) {
if (this.reason) {
listener(this.reason);
return;
}
if (this._listeners) {
this._listeners.push(listener);
} else {
this._listeners = [listener];
}
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(listener) {
if (!this._listeners) {
return;
}
const index2 = this._listeners.indexOf(listener);
if (index2 !== -1) {
this._listeners.splice(index2, 1);
}
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let cancel;
const token = new CancelToken(function executor(c) {
cancel = c;
});
return {
token,
cancel
};
}
}
function spread(callback) {
return function wrap(arr) {
return callback.apply(null, arr);
};
}
function isAxiosError(payload) {
return utils$1.isObject(payload) && payload.isAxiosError === true;
}
const HttpStatusCode = {
Continue: 100,
SwitchingProtocols: 101,
Processing: 102,
EarlyHints: 103,
Ok: 200,
Created: 201,
Accepted: 202,
NonAuthoritativeInformation: 203,
NoContent: 204,
ResetContent: 205,
PartialContent: 206,
MultiStatus: 207,
AlreadyReported: 208,
ImUsed: 226,
MultipleChoices: 300,
MovedPermanently: 301,
Found: 302,
SeeOther: 303,
NotModified: 304,
UseProxy: 305,
Unused: 306,
TemporaryRedirect: 307,
PermanentRedirect: 308,
BadRequest: 400,
Unauthorized: 401,
PaymentRequired: 402,
Forbidden: 403,
NotFound: 404,
MethodNotAllowed: 405,
NotAcceptable: 406,
ProxyAuthenticationRequired: 407,
RequestTimeout: 408,
Conflict: 409,
Gone: 410,
LengthRequired: 411,
PreconditionFailed: 412,
PayloadTooLarge: 413,
UriTooLong: 414,
UnsupportedMediaType: 415,
RangeNotSatisfiable: 416,
ExpectationFailed: 417,
ImATeapot: 418,
MisdirectedRequest: 421,
UnprocessableEntity: 422,
Locked: 423,
FailedDependency: 424,
TooEarly: 425,
UpgradeRequired: 426,
PreconditionRequired: 428,
TooManyRequests: 429,
RequestHeaderFieldsTooLarge: 431,
UnavailableForLegalReasons: 451,
InternalServerError: 500,
NotImplemented: 501,
BadGateway: 502,
ServiceUnavailable: 503,
GatewayTimeout: 504,
HttpVersionNotSupported: 505,
VariantAlsoNegotiates: 506,
InsufficientStorage: 507,
LoopDetected: 508,
NotExtended: 510,
NetworkAuthenticationRequired: 511
};
Object.entries(HttpStatusCode).forEach(([key, value]) => {
HttpStatusCode[value] = key;
});
function createInstance(defaultConfig) {
const context = new Axios(defaultConfig);
const instance = bind(Axios.prototype.request, context);
utils$1.extend(instance, Axios.prototype, context, { allOwnKeys: true });
utils$1.extend(instance, context, null, { allOwnKeys: true });
instance.create = function create2(instanceConfig) {
return createInstance(mergeConfig(defaultConfig, instanceConfig));
};
return instance;
}
const axios = createInstance(defaults);
axios.Axios = Axios;
axios.CanceledError = CanceledError;
axios.CancelToken = CancelToken;
axios.isCancel = isCancel;
axios.VERSION = VERSION;
axios.toFormData = toFormData;
axios.AxiosError = AxiosError;
axios.Cancel = axios.CanceledError;
axios.all = function all(promises) {
return Promise.all(promises);
};
axios.spread = spread;
axios.isAxiosError = isAxiosError;
axios.mergeConfig = mergeConfig;
axios.AxiosHeaders = AxiosHeaders;
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.getAdapter = adapters.getAdapter;
axios.HttpStatusCode = HttpStatusCode;
axios.default = axios;
var scheduler = { exports: {} };
var scheduler_production_min = {};
/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasRequiredScheduler_production_min;
function requireScheduler_production_min() {
if (hasRequiredScheduler_production_min) return scheduler_production_min;
hasRequiredScheduler_production_min = 1;
(function(exports) {
function f2(a2, b) {
var c = a2.length;
a2.push(b);
a: for (; 0 < c; ) {
var d2 = c - 1 >>> 1, e = a2[d2];
if (0 < g(e, b)) a2[d2] = b, a2[c] = e, c = d2;
else break a;
}
}
function h2(a2) {
return 0 === a2.length ? null : a2[0];
}
function k(a2) {
if (0 === a2.length) return null;
var b = a2[0], c = a2.pop();
if (c !== b) {
a2[0] = c;
a: for (var d2 = 0, e = a2.length, w = e >>> 1; d2 < w; ) {
var m = 2 * (d2 + 1) - 1, C = a2[m], n = m + 1, x = a2[n];
if (0 > g(C, c)) n < e && 0 > g(x, C) ? (a2[d2] = x, a2[n] = c, d2 = n) : (a2[d2] = C, a2[m] = c, d2 = m);
else if (n < e && 0 > g(x, c)) a2[d2] = x, a2[n] = c, d2 = n;
else break a;
}
}
return b;
}
function g(a2, b) {
var c = a2.sortIndex - b.sortIndex;
return 0 !== c ? c : a2.id - b.id;
}
if ("object" === typeof performance && "function" === typeof performance.now) {
var l = performance;
exports.unstable_now = function() {
return l.now();
};
} else {
var p = Date, q = p.now();
exports.unstable_now = function() {
return p.now() - q;
};
}
var r = [], t = [], u = 1, v2 = null, y = 3, z = false, A = false, B = false, D = "function" === typeof setTimeout ? setTimeout : null, E2 = "function" === typeof clearTimeout ? clearTimeout : null, F = "undefined" !== typeof setImmediate ? setImmediate : null;
"undefined" !== typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling);
function G(a2) {
for (var b = h2(t); null !== b; ) {
if (null === b.callback) k(t);
else if (b.startTime <= a2) k(t), b.sortIndex = b.expirationTime, f2(r, b);
else break;
b = h2(t);
}
}
function H(a2) {
B = false;
G(a2);
if (!A) if (null !== h2(r)) A = true, I(J);
else {
var b = h2(t);
null !== b && K(H, b.startTime - a2);
}
}
function J(a2, b) {
A = false;
B && (B = false, E2(L), L = -1);
z = true;
var c = y;
try {
G(b);
for (v2 = h2(r); null !== v2 && (!(v2.expirationTime > b) || a2 && !M()); ) {
var d2 = v2.callback;
if ("function" === typeof d2) {
v2.callback = null;
y = v2.priorityLevel;
var e = d2(v2.expirationTime <= b);
b = exports.unstable_now();
"function" === typeof e ? v2.callback = e : v2 === h2(r) && k(r);
G(b);
} else k(r);
v2 = h2(r);
}
if (null !== v2) var w = true;
else {
var m = h2(t);
null !== m && K(H, m.startTime - b);
w = false;
}
return w;
} finally {
v2 = null, y = c, z = false;
}
}
var N = false, O = null, L = -1, P = 5, Q = -1;
function M() {
return exports.unstable_now() - Q < P ? false : true;
}
function R() {
if (null !== O) {
var a2 = exports.unstable_now();
Q = a2;
var b = true;
try {
b = O(true, a2);
} finally {
b ? S() : (N = false, O = null);
}
} else N = false;
}
var S;
if ("function" === typeof F) S = function() {
F(R);
};
else if ("undefined" !== typeof MessageChannel) {
var T = new MessageChannel(), U = T.port2;
T.port1.onmessage = R;
S = function() {
U.postMessage(null);
};
} else S = function() {
D(R, 0);
};
function I(a2) {
O = a2;
N || (N = true, S());
}
function K(a2, b) {
L = D(function() {
a2(exports.unstable_now());
}, b);
}
exports.unstable_IdlePriority = 5;
exports.unstable_ImmediatePriority = 1;
exports.unstable_LowPriority = 4;
exports.unstable_NormalPriority = 3;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = 2;
exports.unstable_cancelCallback = function(a2) {
a2.callback = null;
};
exports.unstable_continueExecution = function() {
A || z || (A = true, I(J));
};
exports.unstable_forceFrameRate = function(a2) {
0 > a2 || 125 < a2 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P = 0 < a2 ? Math.floor(1e3 / a2) : 5;
};
exports.unstable_getCurrentPriorityLevel = function() {
return y;
};
exports.unstable_getFirstCallbackNode = function() {
return h2(r);
};
exports.unstable_next = function(a2) {
switch (y) {
case 1:
case 2:
case 3:
var b = 3;
break;
default:
b = y;
}
var c = y;
y = b;
try {
return a2();
} finally {
y = c;
}
};
exports.unstable_pauseExecution = function() {
};
exports.unstable_requestPaint = function() {
};
exports.unstable_runWithPriority = function(a2, b) {
switch (a2) {
case 1:
case 2:
case 3:
case 4:
case 5:
break;
default:
a2 = 3;
}
var c = y;
y = a2;
try {
return b();
} finally {
y = c;
}
};
exports.unstable_scheduleCallback = function(a2, b, c) {
var d2 = exports.unstable_now();
"object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d2 + c : d2) : c = d2;
switch (a2) {
case 1:
var e = -1;
break;
case 2:
e = 250;
break;
case 5:
e = 1073741823;
break;
case 4:
e = 1e4;
break;
default:
e = 5e3;
}
e = c + e;
a2 = { id: u++, callback: b, priorityLevel: a2, startTime: c, expirationTime: e, sortIndex: -1 };
c > d2 ? (a2.sortIndex = c, f2(t, a2), null === h2(r) && a2 === h2(t) && (B ? (E2(L), L = -1) : B = true, K(H, c - d2))) : (a2.sortIndex = e, f2(r, a2), A || z || (A = true, I(J)));
return a2;
};
exports.unstable_shouldYield = M;
exports.unstable_wrapCallback = function(a2) {
var b = y;
return function() {
var c = y;
y = b;
try {
return a2.apply(this, arguments);
} finally {
y = c;
}
};
};
})(scheduler_production_min);
return scheduler_production_min;
}
var scheduler_development = {};
/**
* @license React
* scheduler.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasRequiredScheduler_development;
function requireScheduler_development() {
if (hasRequiredScheduler_development) return scheduler_development;
hasRequiredScheduler_development = 1;
(function(exports) {
if (process.env.NODE_ENV !== "production") {
(function() {
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var enableSchedulerDebugging = false;
var enableProfiling = false;
var frameYieldMs = 5;
function push(heap, node) {
var index2 = heap.length;
heap.push(node);
siftUp(heap, node, index2);
}
function peek(heap) {
return heap.length === 0 ? null : heap[0];
}
function pop(heap) {
if (heap.length === 0) {
return null;
}
var first = heap[0];
var last = heap.pop();
if (last !== first) {
heap[0] = last;
siftDown(heap, last, 0);
}
return first;
}
function siftUp(heap, node, i) {
var index2 = i;
while (index2 > 0) {
var parentIndex = index2 - 1 >>> 1;
var parent = heap[parentIndex];
if (compare(parent, node) > 0) {
heap[parentIndex] = node;
heap[index2] = parent;
index2 = parentIndex;
} else {
return;
}
}
}
function siftDown(heap, node, i) {
var index2 = i;
var length = heap.length;
var halfLength = length >>> 1;
while (index2 < halfLength) {
var leftIndex = (index2 + 1) * 2 - 1;
var left = heap[leftIndex];
var rightIndex = leftIndex + 1;
var right = heap[rightIndex];
if (compare(left, node) < 0) {
if (rightIndex < length && compare(right, left) < 0) {
heap[index2] = right;
heap[rightIndex] = node;
index2 = rightIndex;
} else {
heap[index2] = left;
heap[leftIndex] = node;
index2 = leftIndex;
}
} else if (rightIndex < length && compare(right, node) < 0) {
heap[index2] = right;
heap[rightIndex] = node;
index2 = rightIndex;
} else {
return;
}
}
}
function compare(a2, b) {
var diff = a2.sortIndex - b.sortIndex;
return diff !== 0 ? diff : a2.id - b.id;
}
var ImmediatePriority = 1;
var UserBlockingPriority = 2;
var NormalPriority = 3;
var LowPriority = 4;
var IdlePriority = 5;
function markTaskErrored(task, ms) {
}
var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
if (hasPerformanceNow) {
var localPerformance = performance;
exports.unstable_now = function() {
return localPerformance.now();
};
} else {
var localDate = Date;
var initialTime = localDate.now();
exports.unstable_now = function() {
return localDate.now() - initialTime;
};
}
var maxSigned31BitInt = 1073741823;
var IMMEDIATE_PRIORITY_TIMEOUT = -1;
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
var NORMAL_PRIORITY_TIMEOUT = 5e3;
var LOW_PRIORITY_TIMEOUT = 1e4;
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
var taskQueue = [];
var timerQueue = [];
var taskIdCounter = 1;
var currentTask = null;
var currentPriorityLevel = NormalPriority;
var isPerformingWork = false;
var isHostCallbackScheduled = false;
var isHostTimeoutScheduled = false;
var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null;
var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null;
var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null;
typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
function advanceTimers(currentTime) {
var timer = peek(timerQueue);
while (timer !== null) {
if (timer.callback === null) {
pop(timerQueue);
} else if (timer.startTime <= currentTime) {
pop(timerQueue);
timer.sortIndex = timer.expirationTime;
push(taskQueue, timer);
} else {
return;
}
timer = peek(timerQueue);
}
}
function handleTimeout(currentTime) {
isHostTimeoutScheduled = false;
advanceTimers(currentTime);
if (!isHostCallbackScheduled) {
if (peek(taskQueue) !== null) {
isHostCallbackScheduled = true;
requestHostCallback(flushWork);
} else {
var firstTimer = peek(timerQueue);
if (firstTimer !== null) {
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
}
}
}
}
function flushWork(hasTimeRemaining, initialTime2) {
isHostCallbackScheduled = false;
if (isHostTimeoutScheduled) {
isHostTimeoutScheduled = false;
cancelHostTimeout();
}
isPerformingWork = true;
var previousPriorityLevel = currentPriorityLevel;
try {
var currentTime;
if (enableProfiling) ;
else {
return workLoop(hasTimeRemaining, initialTime2);
}
} finally {
currentTask = null;
currentPriorityLevel = previousPriorityLevel;
isPerformingWork = false;
}
}
function workLoop(hasTimeRemaining, initialTime2) {
var currentTime = initialTime2;
advanceTimers(currentTime);
currentTask = peek(taskQueue);
while (currentTask !== null && !enableSchedulerDebugging) {
if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
break;
}
var callback = currentTask.callback;
if (typeof callback === "function") {
currentTask.callback = null;
currentPriorityLevel = currentTask.priorityLevel;
var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
var continuationCallback = callback(didUserCallbackTimeout);
currentTime = exports.unstable_now();
if (typeof continuationCallback === "function") {
currentTask.callback = continuationCallback;
} else {
if (currentTask === peek(taskQueue)) {
pop(taskQueue);
}
}
advanceTimers(currentTime);
} else {
pop(taskQueue);
}
currentTask = peek(taskQueue);
}
if (currentTask !== null) {
return true;
} else {
var firstTimer = peek(timerQueue);
if (firstTimer !== null) {
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
}
return false;
}
}
function unstable_runWithPriority(priorityLevel, eventHandler) {
switch (priorityLevel) {
case ImmediatePriority:
case UserBlockingPriority:
case NormalPriority:
case LowPriority:
case IdlePriority:
break;
default:
priorityLevel = NormalPriority;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
}
function unstable_next(eventHandler) {
var priorityLevel;
switch (currentPriorityLevel) {
case ImmediatePriority:
case UserBlockingPriority:
case NormalPriority:
priorityLevel = NormalPriority;
break;
default:
priorityLevel = currentPriorityLevel;
break;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
}
function unstable_wrapCallback(callback) {
var parentPriorityLevel = currentPriorityLevel;
return function() {
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = parentPriorityLevel;
try {
return callback.apply(this, arguments);
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
}
function unstable_scheduleCallback(priorityLevel, callback, options) {
var currentTime = exports.unstable_now();
var startTime2;
if (typeof options === "object" && options !== null) {
var delay = options.delay;
if (typeof delay === "number" && delay > 0) {
startTime2 = currentTime + delay;
} else {
startTime2 = currentTime;
}
} else {
startTime2 = currentTime;
}
var timeout;
switch (priorityLevel) {
case ImmediatePriority:
timeout = IMMEDIATE_PRIORITY_TIMEOUT;
break;
case UserBlockingPriority:
timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
break;
case IdlePriority:
timeout = IDLE_PRIORITY_TIMEOUT;
break;
case LowPriority:
timeout = LOW_PRIORITY_TIMEOUT;
break;
case NormalPriority:
default:
timeout = NORMAL_PRIORITY_TIMEOUT;
break;
}
var expirationTime = startTime2 + timeout;
var newTask = {
id: taskIdCounter++,
callback,
priorityLevel,
startTime: startTime2,
expirationTime,
sortIndex: -1
};
if (startTime2 > currentTime) {
newTask.sortIndex = startTime2;
push(timerQueue, newTask);
if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
if (isHostTimeoutScheduled) {
cancelHostTimeout();
} else {
isHostTimeoutScheduled = true;
}
requestHostTimeout(handleTimeout, startTime2 - currentTime);
}
} else {
newTask.sortIndex = expirationTime;
push(taskQueue, newTask);
if (!isHostCallbackScheduled && !isPerformingWork) {
isHostCallbackScheduled = true;
requestHostCallback(flushWork);
}
}
return newTask;
}
function unstable_pauseExecution() {
}
function unstable_continueExecution() {
if (!isHostCallbackScheduled && !isPerformingWork) {
isHostCallbackScheduled = true;
requestHostCallback(flushWork);
}
}
function unstable_getFirstCallbackNode() {
return peek(taskQueue);
}
function unstable_cancelCallback(task) {
task.callback = null;
}
function unstable_getCurrentPriorityLevel() {
return currentPriorityLevel;
}
var isMessageLoopRunning = false;
var scheduledHostCallback = null;
var taskTimeoutID = -1;
var frameInterval = frameYieldMs;
var startTime = -1;
function shouldYieldToHost() {
var timeElapsed = exports.unstable_now() - startTime;
if (timeElapsed < frameInterval) {
return false;
}
return true;
}
function requestPaint() {
}
function forceFrameRate(fps) {
if (fps < 0 || fps > 125) {
console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
return;
}
if (fps > 0) {
frameInterval = Math.floor(1e3 / fps);
} else {
frameInterval = frameYieldMs;
}
}
var performWorkUntilDeadline = function() {
if (scheduledHostCallback !== null) {
var currentTime = exports.unstable_now();
startTime = currentTime;
var hasTimeRemaining = true;
var hasMoreWork = true;
try {
hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
} finally {
if (hasMoreWork) {
schedulePerformWorkUntilDeadline();
} else {
isMessageLoopRunning = false;
scheduledHostCallback = null;
}
}
} else {
isMessageLoopRunning = false;
}
};
var schedulePerformWorkUntilDeadline;
if (typeof localSetImmediate === "function") {
schedulePerformWorkUntilDeadline = function() {
localSetImmediate(performWorkUntilDeadline);
};
} else if (typeof MessageChannel !== "undefined") {
var channel = new MessageChannel();
var port = channel.port2;
channel.port1.onmessage = performWorkUntilDeadline;
schedulePerformWorkUntilDeadline = function() {
port.postMessage(null);
};
} else {
schedulePerformWorkUntilDeadline = function() {
localSetTimeout(performWorkUntilDeadline, 0);
};
}
function requestHostCallback(callback) {
scheduledHostCallback = callback;
if (!isMessageLoopRunning) {
isMessageLoopRunning = true;
schedulePerformWorkUntilDeadline();
}
}
function requestHostTimeout(callback, ms) {
taskTimeoutID = localSetTimeout(function() {
callback(exports.unstable_now());
}, ms);
}
function cancelHostTimeout() {
localClearTimeout(taskTimeoutID);
taskTimeoutID = -1;
}
var unstable_requestPaint = requestPaint;
var unstable_Profiling = null;
exports.unstable_IdlePriority = IdlePriority;
exports.unstable_ImmediatePriority = ImmediatePriority;
exports.unstable_LowPriority = LowPriority;
exports.unstable_NormalPriority = NormalPriority;
exports.unstable_Profiling = unstable_Profiling;
exports.unstable_UserBlockingPriority = UserBlockingPriority;
exports.unstable_cancelCallback = unstable_cancelCallback;
exports.unstable_continueExecution = unstable_continueExecution;
exports.unstable_forceFrameRate = forceFrameRate;
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
exports.unstable_next = unstable_next;
exports.unstable_pauseExecution = unstable_pauseExecution;
exports.unstable_requestPaint = unstable_requestPaint;
exports.unstable_runWithPriority = unstable_runWithPriority;
exports.unstable_scheduleCallback = unstable_scheduleCallback;
exports.unstable_shouldYield = shouldYieldToHost;
exports.unstable_wrapCallback = unstable_wrapCallback;
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
}
})();
}
})(scheduler_development);
return scheduler_development;
}
if (process.env.NODE_ENV === "production") {
scheduler.exports = requireScheduler_production_min();
} else {
scheduler.exports = requireScheduler_development();
}
var schedulerExports = scheduler.exports;
const d = Symbol(), f = Symbol(), v = "undefined" == typeof window || /ServerSideRendering/.test(window.navigator && window.navigator.userAgent) ? useEffect : useLayoutEffect, a = schedulerExports.unstable_runWithPriority ? (e) => schedulerExports.unstable_runWithPriority(schedulerExports.unstable_NormalPriority, e) : (e) => e();
function E(r) {
const t = createContext$1({ [d]: { v: { current: r }, n: { current: -1 }, l: /* @__PURE__ */ new Set(), u: (e) => e() } });
var o;
return t[f] = t.Provider, t.Provider = (o = t.Provider, ({ value: e, children: r2 }) => {
const t2 = useRef(e), c = useRef(0), [i, p] = useState(null);
i && (i(e), p(null));
const f2 = useRef();
if (!f2.current) {
const e2 = /* @__PURE__ */ new Set(), r3 = (r4, t3) => {
unstable_batchedUpdates$1(() => {
c.current += 1;
const n = { n: c.current };
null != t3 && t3.suspense && (n.n *= -1, n.p = new Promise((e3) => {
p(() => (r5) => {
n.v = r5, delete n.p, e3(r5);
});
})), e2.forEach((e3) => e3(n)), r4();
});
};
f2.current = { [d]: { v: t2, n: c, l: e2, u: r3 } };
}
return v(() => {
t2.current = e, c.current += 1, a(() => {
f2.current[d].l.forEach((r3) => {
r3({ n: c.current, v: e });
});
});
}, [e]), createElement(o, { value: f2.current }, r2);
}), delete t.Consumer, t;
}
function h(e, n) {
const o = useContext(e)[d];
if ("object" == typeof process && "production" !== process.env.NODE_ENV && !o) throw new Error("useContextSelector requires special context");
const { v: { current: c }, n: { current: u }, l: s } = o, i = n(c), [p, l] = useReducer((e2, r) => {
if (!r) return [c, i];
if ("p" in r) throw r.p;
if (r.n === u) return Object.is(e2[1], i) ? e2 : [c, i];
try {
if ("v" in r) {
if (Object.is(e2[0], r.v)) return e2;
const t = n(r.v);
return Object.is(e2[1], t) ? e2 : [r.v, t];
}
} catch (e3) {
}
return [...e2];
}, [c, i]);
return Object.is(p[1], i) || l(), v(() => (s.add(l), () => {
s.delete(l);
}), [s]), p[1];
}
function createContext(rootComponentName, defaultContext) {
const Context = E(defaultContext);
const Provider2 = (props) => {
const { children, ...context } = props;
const value = React.useMemo(() => context, Object.values(context));
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
};
const useContext2 = (consumerName, selector) => h(Context, (ctx) => {
if (ctx)
return selector(ctx);
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
});
Provider2.displayName = rootComponentName + "Provider";
return [Provider2, useContext2];
}
const [StrapiAppProvider, useStrapiApp] = createContext("StrapiApp");
const useQueryParams = (initialParams) => {
const { search } = useLocation();
const navigate = useNavigate();
const query = useMemo(() => {
const searchQuery = search.startsWith("?") ? search.slice(1) : search;
if (!search && initialParams) {
return initialParams;
}
return { ...initialParams, ...parse(searchQuery) };
}, [search, initialParams]);
const setQuery = useCallback(
(nextParams, method = "push", replace = false) => {
let nextQuery = { ...query };
if (method === "remove") {
Object.keys(nextParams).forEach((key) => {
if (Object.prototype.hasOwnProperty.call(nextQuery, key)) {
delete nextQuery[key];
}
});
} else {
nextQuery = { ...query, ...nextParams };
}
navigate({ search: stringify(nextQuery, { encode: false }) }, { replace });
},
[navigate, query]
);
return [{ query, rawQuery: search }, setQuery];
};
const STORAGE_KEYS$1 = {
TOKEN: "jwtToken",
USER: "userInfo"
};
const THEME_LOCAL_STORAGE_KEY = "STRAPI_THEME";
const LANGUAGE_LOCAL_STORAGE_KEY = "strapi-admin-language";
const adminSlice = createSlice({
name: "admin",
initialState: () => {
return {
language: {
locale: "en",
localeNames: { en: "English" }
},
permissions: {},
theme: {
availableThemes: [],
currentTheme: localStorage.getItem(THEME_LOCAL_STORAGE_KEY) || "system"
},
token: null
};
},
reducers: {
setAppTheme(state, action) {
state.theme.currentTheme = action.payload;
window.localStorage.setItem(THEME_LOCAL_STORAGE_KEY, action.payload);
},
setAvailableThemes(state, action) {
state.theme.availableThemes = action.payload;
},
setLocale(state, action) {
state.language.locale = action.payload;
window.localStorage.setItem(LANGUAGE_LOCAL_STORAGE_KEY, action.payload);
document.documentElement.setAttribute("lang", action.payload);
},
setToken(state, action) {
state.token = action.payload;
},
login(state, action) {
const { token, persist } = action.payload;
if (!persist) {
window.sessionStorage.setItem(STORAGE_KEYS$1.TOKEN, JSON.stringify(token));
} else {
window.localStorage.setItem(STORAGE_KEYS$1.TOKEN, JSON.stringify(token));
}
state.token = token;
},
logout(state) {
state.token = null;
window.localStorage.removeItem(STORAGE_KEYS$1.TOKEN);
window.localStorage.removeItem(STORAGE_KEYS$1.USER);
window.sessionStorage.removeItem(STORAGE_KEYS$1.TOKEN);
window.sessionStorage.removeItem(STORAGE_KEYS$1.USER);
}
}
});
const reducer$1$1 = adminSlice.reducer;
const authService = adminApi.enhanceEndpoints({
addTagTypes: ["User", "Me", "ProvidersOptions"]
}).injectEndpoints({
endpoints: (builder) => ({
/**
* ME
*/
getMe: builder.query({
query: () => ({
method: "GET",
url: "/admin/users/me"
}),
transformResponse(res) {
return res.data;
},
providesTags: (res) => res ? ["Me", { type: "User", id: res.id }] : ["Me"]
}),
getMyPermissions: builder.query({
query: () => ({
method: "GET",
url: "/admin/users/me/permissions"
}),
transformResponse(res) {
return res.data;
}
}),
updateMe: builder.mutation({
query: (body) => ({
method: "PUT",
url: "/admin/users/me",
data: body
}),
transformResponse(res) {
return res.data;
},
invalidatesTags: ["Me"]
}),
/**
* Permissions
*/
checkPermissions: builder.query({
query: (permissions) => ({
method: "POST",
url: "/admin/permissions/check",
data: permissions
})
}),
/**
* Auth methods
*/
login: builder.mutation({
query: (body) => ({
method: "POST",
url: "/admin/login",
data: body
}),
transformResponse(res) {
return res.data;
},
invalidatesTags: ["Me"]
}),
logout: builder.mutation({
query: () => ({
method: "POST",
url: "/admin/logout"
})
}),
resetPassword: builder.mutation({
query: (body) => ({
method: "POST",
url: "/admin/reset-password",
data: body
}),
transformResponse(res) {
return res.data;
}
}),
renewToken: builder.mutation({
query: (body) => ({
method: "POST",
url: "/admin/renew-token",
data: body
}),
transformResponse(res) {
return res.data;
}
}),
getRegistrationInfo: builder.query({
query: (registrationToken) => ({
url: "/admin/registration-info",
method: "GET",
config: {
params: {
registrationToken
}
}
}),
transformResponse(res) {
return res.data;
}
}),
registerAdmin: builder.mutation({
query: (body) => ({
method: "POST",
url: "/admin/register-admin",
data: body
}),
transformResponse(res) {
return res.data;
}
}),
registerUser: builder.mutation({
query: (body) => ({
method: "POST",
url: "/admin/register",
data: body
}),
transformResponse(res) {
return res.data;
}
}),
forgotPassword: builder.mutation({
query: (body) => ({
url: "/admin/forgot-password",
method: "POST",
data: body
})
}),
isSSOLocked: builder.query({
query: () => ({
url: "/admin/providers/isSSOLocked",
method: "GET"
}),
transformResponse(res) {
return res.data;
}
}),
getProviders: builder.query({
query: () => ({
url: "/admin/providers",
method: "GET"
})
}),
getProviderOptions: builder.query({
query: () => ({
url: "/admin/providers/options",
method: "GET"
}),
transformResponse(res) {
return res.data;
},
providesTags: ["ProvidersOptions"]
}),
updateProviderOptions: builder.mutation({
query: (body) => ({
url: "/admin/providers/options",
method: "PUT",
data: body
}),
transformResponse(res) {
return res.data;
},
invalidatesTags: ["ProvidersOptions"]
})
}),
overrideExisting: false
});
const {
useCheckPermissionsQuery,
useLazyCheckPermissionsQuery,
useGetMeQuery,
useLoginMutation,
useRenewTokenMutation,
useLogoutMutation,
useUpdateMeMutation,
useResetPasswordMutation,
useRegisterAdminMutation,
useRegisterUserMutation,
useGetRegistrationInfoQuery,
useForgotPasswordMutation,
useGetMyPermissionsQuery,
useIsSSOLockedQuery,
useGetProvidersQuery,
useGetProviderOptionsQuery,
useUpdateProviderOptionsMutation
} = authService;
const [Provider$1, useAuth] = createContext("Auth");
const NotificationsContext = React.createContext({
toggleNotification: () => {
}
});
/**
* @preserve
* @description Returns an object to interact with the notification
* system. The callbacks are wrapped in `useCallback` for a stable
* identity.
*
* @example
* ```tsx
* import { useNotification } from '@strapi/strapi/admin';
*
* const MyComponent = () => {
* const { toggleNotification } = useNotification();
*
* return <button onClick={() => toggleNotification({ message: 'Hello world!' })}>Click me</button>;
*/
const useNotification = () => React.useContext(NotificationsContext);
function getPrefixedId(message, callback) {
const prefixedMessage = `apiError.${message}`;
if (typeof callback === "function") {
return callback(prefixedMessage);
}
return prefixedMessage;
}
function normalizeError(error, { name, intlMessagePrefixCallback }) {
const { message } = error;
const normalizedError = {
id: getPrefixedId(message, intlMessagePrefixCallback),
defaultMessage: message,
name: error.name ?? name,
values: {}
};
if ("path" in error) {
normalizedError.values = { path: error.path.join(".") };
}
return normalizedError;
}
const validateErrorIsYupValidationError = (err) => typeof err.details === "object" && err.details !== null && "errors" in err.details;
function normalizeAPIError(apiError, intlMessagePrefixCallback) {
const error = apiError.response?.data?.error;
if (error) {
if (validateErrorIsYupValidationError(error)) {
return {
name: error.name,
message: error?.message || null,
errors: error.details.errors.map(
(err) => normalizeError(err, { name: error.name, intlMessagePrefixCallback })
)
};
}
return normalizeError(error, { intlMessagePrefixCallback });
}
return null;
}
function getIn$1(obj, key, def, pathStartIndex = 0) {
const path = toPath(key);
while (obj && pathStartIndex < path.length) {
obj = obj[path[pathStartIndex++]];
}
if (pathStartIndex !== path.length && !obj) {
return def;
}
return obj === void 0 ? def : obj;
}
const isObject$1 = (obj) => obj !== null && typeof obj === "object" && !Array.isArray(obj);
const isInteger = (obj) => String(Math.floor(Number(obj))) === obj;
function setIn(obj, path, value) {
const res = clone$1(obj);
let resVal = res;
let i = 0;
const pathArray = toPath(path);
for (; i < pathArray.length - 1; i++) {
const currentPath = pathArray[i];
const currentObj = getIn$1(obj, pathArray.slice(0, i + 1));
if (currentObj && (isObject$1(currentObj) || Array.isArray(currentObj))) {
resVal = resVal[currentPath] = clone$1(currentObj);
} else {
const nextPath = pathArray[i + 1];
resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
}
}
if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {
return obj;
}
if (value === void 0) {
delete resVal[pathArray[i]];
} else {
resVal[pathArray[i]] = value;
}
if (i === 0 && value === void 0) {
delete res[pathArray[i]];
}
return res;
}
function useAPIErrorHandler(intlMessagePrefixCallback) {
const { formatMessage } = useIntl();
const formatError = React.useCallback(
(error) => {
try {
const formattedErr = formatAPIError(error, { intlMessagePrefixCallback, formatMessage });
if (!formattedErr) {
return formatFetchError(error, { intlMessagePrefixCallback, formatMessage });
}
return formattedErr;
} catch (_) {
throw new Error("formatAPIError: Unknown error:", error);
}
},
[formatMessage, intlMessagePrefixCallback]
);
return {
/**
* @alpha
* Convert ValidationErrors from the API into an object that can be used by forms.
*/
_unstableFormatValidationErrors: React.useCallback(
(error) => {
if (typeof error.details === "object" && error.details !== null) {
if ("errors" in error.details && Array.isArray(error.details.errors)) {
const validationErrors = error.details.errors;
return validationErrors.reduce((acc, err) => {
const { path, message } = err;
return setIn(acc, path.join("."), message);
}, {});
} else {
const details = error.details;
return Object.keys(details).reduce((acc, key) => {
const messages = details[key];
return {
...acc,
[key]: messages.join(", ")
};
}, {});
}
} else {
return {};
}
},
[]
),
/**
* @alpha
* This handles the errors given from `redux-toolkit`'s axios based baseQuery function.
*/
_unstableFormatAPIError: React.useCallback(
(error) => {
const err = {
response: {
data: {
error
}
}
};
if (!error.message) {
return "Unknown error occured.";
}
return formatError(err);
},
[formatError]
),
formatAPIError: formatError
};
}
function formatFetchError(error, { intlMessagePrefixCallback, formatMessage }) {
const { code, message } = error;
return formatMessage(
{
id: getPrefixedId(message, intlMessagePrefixCallback),
defaultMessage: message
},
{
code
}
);
}
function formatAPIError(error, { formatMessage, intlMessagePrefixCallback }) {
if (!formatMessage) {
throw new Error("The formatMessage callback is a mandatory argument.");
}
const normalizedError = normalizeAPIError(error, intlMessagePrefixCallback);
if (!normalizedError) {
return null;
}
if ("message" in normalizedError && normalizedError.message !== null) {
return normalizedError.message;
}
if ("errors" in normalizedError) {
return normalizedError.errors.map(({ id, defaultMessage, values }) => formatMessage({ id, defaultMessage }, values)).join("\n");
}
return formatMessage(normalizedError);
}
const PageMain = ({ children, ...restProps }) => {
return /* @__PURE__ */ jsx(Main, { ...restProps, children });
};
const Loading$1 = ({ children = "Loading content." }) => {
return /* @__PURE__ */ jsx(PageMain, { height: "100vh", "aria-busy": true, children: /* @__PURE__ */ jsx(Flex, { alignItems: "center", height: "100%", justifyContent: "center", children: /* @__PURE__ */ jsx(Loader, { children }) }) });
};
const Error$1 = (props) => {
const { formatMessage } = useIntl();
return /* @__PURE__ */ jsx(PageMain, { height: "100%", children: /* @__PURE__ */ jsx(Flex, { alignItems: "center", height: "100%", justifyContent: "center", children: /* @__PURE__ */ jsx(
EmptyStateLayout,
{
icon: /* @__PURE__ */ jsx(ForwardRef$3$1, { width: "16rem" }),
content: formatMessage({
id: "anErrorOccurred",
defaultMessage: "Woops! Something went wrong. Please, try again."
}),
...props
}
) }) });
};
const NoPermissions = (props) => {
const { formatMessage } = useIntl();
return /* @__PURE__ */ jsx(PageMain, { height: "100%", children: /* @__PURE__ */ jsx(Flex, { alignItems: "center", height: "100%", justifyContent: "center", children: /* @__PURE__ */ jsx(Box, { minWidth: "50%", children: /* @__PURE__ */ jsx(
EmptyStateLayout,
{
icon: /* @__PURE__ */ jsx(ForwardRef$H, { width: "16rem" }),
content: formatMessage({
id: "app.components.EmptyStateLayout.content-permissions",
defaultMessage: "You don't have the permissions to access that content"
}),
...props
}
) }) }) });
};
const NoData = (props) => {
const { formatMessage } = useIntl();
return /* @__PURE__ */ jsx(PageMain, { height: "100%", background: "neutral100", children: /* @__PURE__ */ jsx(Flex, { alignItems: "center", height: "100%", width: "100%", justifyContent: "center", children: /* @__PURE__ */ jsx(Box, { minWidth: "50%", children: /* @__PURE__ */ jsx(
EmptyStateLayout,
{
icon: /* @__PURE__ */ jsx(ForwardRef$J, { width: "16rem" }),
action: props.action,
content: formatMessage({
id: "app.components.EmptyStateLayout.content-document",
defaultMessage: "No content found"
}),
...props
}
) }) }) });
};
const Protect = ({ permissions = [], children }) => {
const userPermissions = useAuth("Protect", (state) => state.permissions);
const { toggleNotification } = useNotification();
const { _unstableFormatAPIError: formatAPIError2 } = useAPIErrorHandler();
const matchingPermissions = userPermissions.filter(
(permission) => permissions.findIndex(
(perm) => perm.action === permission.action && perm.subject === permission.subject
) >= 0
);
const shouldCheckConditions = matchingPermissions.some(
(perm) => Array.isArray(perm.conditions) && perm.conditions.length > 0
);
const { isLoading, error, data } = useCheckPermissionsQuery(
{
permissions: matchingPermissions.map((perm) => ({
action: perm.action,
subject: perm.subject
}))
},
{
skip: !shouldCheckConditions
}
);
React.useEffect(() => {
if (error) {
toggleNotification({
type: "danger",
message: formatAPIError2(error)
});
}
}, [error, formatAPIError2, toggleNotification]);
if (isLoading) {
return /* @__PURE__ */ jsx(Loading$1, {});
}
if (error) {
return /* @__PURE__ */ jsx(Error$1, {});
}
const { data: permissionsData } = data || {};
const canAccess = shouldCheckConditions && permissionsData ? !permissionsData.includes(false) : matchingPermissions.length > 0;
if (!canAccess) {
return /* @__PURE__ */ jsx(NoPermissions, {});
}
return /* @__PURE__ */ jsx(Fragment, { children: typeof children === "function" ? children({ permissions: matchingPermissions }) : children });
};
const Title = ({ children: title }) => {
React.useEffect(() => {
document.title = `${title} | Strapi`;
}, [title]);
return null;
};
const Page = {
Error: Error$1,
Loading: Loading$1,
NoPermissions,
Protect,
NoData,
Main: PageMain,
Title
};
const once$1 = (fn) => {
const func = fn;
let called = false;
if (typeof func !== "function") {
throw new TypeError(`once requires a function parameter`);
}
return (...args) => {
if (!called && process.env.NODE_ENV === "development") {
func(...args);
called = true;
}
};
};
const capitalise$1 = (str) => str.charAt(0).toUpperCase() + str.slice(1);
const usePrev = (value) => {
const ref = useRef();
useEffect(() => {
ref.current = value;
}, [value]);
return ref.current;
};
const useRBAC = (permissionsToCheck = [], passedPermissions, rawQueryContext) => {
const isLoadingAuth = useAuth("useRBAC", (state) => state.isLoading);
const [isLoading, setIsLoading] = React.useState(true);
const [error, setError] = React.useState();
const [data, setData] = React.useState();
const warnOnce = React.useMemo(() => once$1(console.warn), []);
const actualPermissionsToCheck = React.useMemo(() => {
if (Array.isArray(permissionsToCheck)) {
return permissionsToCheck;
} else {
warnOnce(
"useRBAC: The first argument should be an array of permissions, not an object. This will be deprecated in the future."
);
return Object.values(permissionsToCheck).flat();
}
}, [permissionsToCheck, warnOnce]);
const defaultAllowedActions = React.useMemo(() => {
return actualPermissionsToCheck.reduce((acc, permission) => {
return {
...acc,
[getActionName(permission)]: false
};
}, {});
}, [actualPermissionsToCheck]);
const checkUserHasPermissions = useAuth("useRBAC", (state) => state.checkUserHasPermissions);
const permssionsChecked = usePrev(actualPermissionsToCheck);
const contextChecked = usePrev(rawQueryContext);
React.useEffect(() => {
if (!isEqual(permssionsChecked, actualPermissionsToCheck) || // TODO: also run this when the query context changes
contextChecked !== rawQueryContext) {
setIsLoading(true);
setData(void 0);
setError(void 0);
checkUserHasPermissions(actualPermissionsToCheck, passedPermissions, rawQueryContext).then((res) => {
if (res) {
setData(
res.reduce((acc, permission) => {
return {
...acc,
[getActionName(permission)]: true
};
}, {})
);
}
}).catch((err) => {
setError(err);
}).finally(() => {
setIsLoading(false);
});
}
}, [
actualPermissionsToCheck,
checkUserHasPermissions,
passedPermissions,
permissionsToCheck,
permssionsChecked,
contextChecked,
rawQueryContext
]);
const allowedActions = Object.entries({
...defaultAllowedActions,
...data
}).reduce((acc, [name, allowed]) => {
acc[`can${capitalise$1(name)}`] = allowed;
return acc;
}, {});
return {
allowedActions,
permissions: actualPermissionsToCheck,
isLoading: isLoading || isLoadingAuth,
error
};
};
const getActionName = (permission) => {
const [action = ""] = permission.action.split(".").slice(-1);
return action.split("-").map(capitalise$1).join("");
};
const [AppInfoProvider, useAppInfo] = createContext("AppInfo", {});
const TrackingContext = React.createContext({
uuid: false
});
const useTracking = () => {
const { uuid, telemetryProperties } = React.useContext(TrackingContext);
const userId = useAppInfo("useTracking", (state) => state.userId);
const trackUsage = React.useCallback(
async (event, properties) => {
try {
if (uuid && !window.strapi.telemetryDisabled) {
const res = await axios.post(
"https://analytics.strapi.io/api/v2/track",
{
event,
userId,
eventProperties: { ...properties },
userProperties: {},
groupProperties: {
...telemetryProperties,
projectId: uuid,
projectType: window.strapi.projectType
}
},
{
headers: {
"Content-Type": "application/json",
"X-Strapi-Event": event
}
}
);
return res;
}
} catch (err) {
}
return null;
},
[telemetryProperties, userId, uuid]
);
return { trackUsage };
};
createContext("GuidedTour");
createGlobalStyle`
body {
background: ${({ theme }) => theme.colors.neutral100};
}
`;
function _setPrototypeOf(t, e) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
return t2.__proto__ = e2, t2;
}, _setPrototypeOf(t, e);
}
function _inheritsLoose(t, o) {
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
}
var Subscribable = /* @__PURE__ */ function() {
function Subscribable2() {
this.listeners = [];
}
var _proto = Subscribable2.prototype;
_proto.subscribe = function subscribe(listener) {
var _this = this;
var callback = listener || function() {
return void 0;
};
this.listeners.push(callback);
this.onSubscribe();
return function() {
_this.listeners = _this.listeners.filter(function(x) {
return x !== callback;
});
_this.onUnsubscribe();
};
};
_proto.hasListeners = function hasListeners() {
return this.listeners.length > 0;
};
_proto.onSubscribe = function onSubscribe() {
};
_proto.onUnsubscribe = function onUnsubscribe() {
};
return Subscribable2;
}();
function _extends$5() {
return _extends$5 = Object.assign ? Object.assign.bind() : function(n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends$5.apply(null, arguments);
}
var isServer = typeof window === "undefined";
function noop() {
return void 0;
}
function functionalUpdate(updater, input) {
return typeof updater === "function" ? updater(input) : updater;
}
function isValidTimeout(value) {
return typeof value === "number" && value >= 0 && value !== Infinity;
}
function ensureQueryKeyArray(value) {
return Array.isArray(value) ? value : [value];
}
function timeUntilStale(updatedAt, staleTime) {
return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
}
function parseQueryArgs(arg1, arg2, arg3) {
if (!isQueryKey(arg1)) {
return arg1;
}
if (typeof arg2 === "function") {
return _extends$5({}, arg3, {
queryKey: arg1,
queryFn: arg2
});
}
return _extends$5({}, arg2, {
queryKey: arg1
});
}
function parseFilterArgs(arg1, arg2, arg3) {
return isQueryKey(arg1) ? [_extends$5({}, arg2, {
queryKey: arg1
}), arg3] : [arg1 || {}, arg2];
}
function mapQueryStatusFilter(active, inactive) {
if (active === true && inactive === true || active == null && inactive == null) {
return "all";
} else if (active === false && inactive === false) {
return "none";
} else {
var isActive = active != null ? active : !inactive;
return isActive ? "active" : "inactive";
}
}
function matchQuery(filters, query) {
var active = filters.active, exact = filters.exact, fetching = filters.fetching, inactive = filters.inactive, predicate = filters.predicate, queryKey = filters.queryKey, stale = filters.stale;
if (isQueryKey(queryKey)) {
if (exact) {
if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {
return false;
}
} else if (!partialMatchKey(query.queryKey, queryKey)) {
return false;
}
}
var queryStatusFilter = mapQueryStatusFilter(active, inactive);
if (queryStatusFilter === "none") {
return false;
} else if (queryStatusFilter !== "all") {
var isActive = query.isActive();
if (queryStatusFilter === "active" && !isActive) {
return false;
}
if (queryStatusFilter === "inactive" && isActive) {
return false;
}
}
if (typeof stale === "boolean" && query.isStale() !== stale) {
return false;
}
if (typeof fetching === "boolean" && query.isFetching() !== fetching) {
return false;
}
if (predicate && !predicate(query)) {
return false;
}
return true;
}
function matchMutation(filters, mutation) {
var exact = filters.exact, fetching = filters.fetching, predicate = filters.predicate, mutationKey = filters.mutationKey;
if (isQueryKey(mutationKey)) {
if (!mutation.options.mutationKey) {
return false;
}
if (exact) {
if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) {
return false;
}
} else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {
return false;
}
}
if (typeof fetching === "boolean" && mutation.state.status === "loading" !== fetching) {
return false;
}
if (predicate && !predicate(mutation)) {
return false;
}
return true;
}
function hashQueryKeyByOptions(queryKey, options) {
var hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey;
return hashFn(queryKey);
}
function hashQueryKey(queryKey) {
var asArray = ensureQueryKeyArray(queryKey);
return stableValueHash(asArray);
}
function stableValueHash(value) {
return JSON.stringify(value, function(_, val) {
return isPlainObject(val) ? Object.keys(val).sort().reduce(function(result, key) {
result[key] = val[key];
return result;
}, {}) : val;
});
}
function partialMatchKey(a2, b) {
return partialDeepEqual(ensureQueryKeyArray(a2), ensureQueryKeyArray(b));
}
function partialDeepEqual(a2, b) {
if (a2 === b) {
return true;
}
if (typeof a2 !== typeof b) {
return false;
}
if (a2 && b && typeof a2 === "object" && typeof b === "object") {
return !Object.keys(b).some(function(key) {
return !partialDeepEqual(a2[key], b[key]);
});
}
return false;
}
function replaceEqualDeep(a2, b) {
if (a2 === b) {
return a2;
}
var array2 = Array.isArray(a2) && Array.isArray(b);
if (array2 || isPlainObject(a2) && isPlainObject(b)) {
var aSize = array2 ? a2.length : Object.keys(a2).length;
var bItems = array2 ? b : Object.keys(b);
var bSize = bItems.length;
var copy = array2 ? [] : {};
var equalItems = 0;
for (var i = 0; i < bSize; i++) {
var key = array2 ? i : bItems[i];
copy[key] = replaceEqualDeep(a2[key], b[key]);
if (copy[key] === a2[key]) {
equalItems++;
}
}
return aSize === bSize && equalItems === aSize ? a2 : copy;
}
return b;
}
function isPlainObject(o) {
if (!hasObjectPrototype(o)) {
return false;
}
var ctor = o.constructor;
if (typeof ctor === "undefined") {
return true;
}
var prot = ctor.prototype;
if (!hasObjectPrototype(prot)) {
return false;
}
if (!prot.hasOwnProperty("isPrototypeOf")) {
return false;
}
return true;
}
function hasObjectPrototype(o) {
return Object.prototype.toString.call(o) === "[object Object]";
}
function isQueryKey(value) {
return typeof value === "string" || Array.isArray(value);
}
function sleep(timeout) {
return new Promise(function(resolve) {
setTimeout(resolve, timeout);
});
}
function scheduleMicrotask(callback) {
Promise.resolve().then(callback).catch(function(error) {
return setTimeout(function() {
throw error;
});
});
}
function getAbortController() {
if (typeof AbortController === "function") {
return new AbortController();
}
}
var FocusManager = /* @__PURE__ */ function(_Subscribable) {
_inheritsLoose(FocusManager2, _Subscribable);
function FocusManager2() {
var _this;
_this = _Subscribable.call(this) || this;
_this.setup = function(onFocus2) {
var _window;
if (!isServer && ((_window = window) == null ? void 0 : _window.addEventListener)) {
var listener = function listener2() {
return onFocus2();
};
window.addEventListener("visibilitychange", listener, false);
window.addEventListener("focus", listener, false);
return function() {
window.removeEventListener("visibilitychange", listener);
window.removeEventListener("focus", listener);
};
}
};
return _this;
}
var _proto = FocusManager2.prototype;
_proto.onSubscribe = function onSubscribe() {
if (!this.cleanup) {
this.setEventListener(this.setup);
}
};
_proto.onUnsubscribe = function onUnsubscribe() {
if (!this.hasListeners()) {
var _this$cleanup;
(_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);
this.cleanup = void 0;
}
};
_proto.setEventListener = function setEventListener(setup) {
var _this$cleanup2, _this2 = this;
this.setup = setup;
(_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);
this.cleanup = setup(function(focused) {
if (typeof focused === "boolean") {
_this2.setFocused(focused);
} else {
_this2.onFocus();
}
});
};
_proto.setFocused = function setFocused(focused) {
this.focused = focused;
if (focused) {
this.onFocus();
}
};
_proto.onFocus = function onFocus2() {
this.listeners.forEach(function(listener) {
listener();
});
};
_proto.isFocused = function isFocused() {
if (typeof this.focused === "boolean") {
return this.focused;
}
if (typeof document === "undefined") {
return true;
}
return [void 0, "visible", "prerender"].includes(document.visibilityState);
};
return FocusManager2;
}(Subscribable);
var focusManager = new FocusManager();
var OnlineManager = /* @__PURE__ */ function(_Subscribable) {
_inheritsLoose(OnlineManager2, _Subscribable);
function OnlineManager2() {
var _this;
_this = _Subscribable.call(this) || this;
_this.setup = function(onOnline2) {
var _window;
if (!isServer && ((_window = window) == null ? void 0 : _window.addEventListener)) {
var listener = function listener2() {
return onOnline2();
};
window.addEventListener("online", listener, false);
window.addEventListener("offline", listener, false);
return function() {
window.removeEventListener("online", listener);
window.removeEventListener("offline", listener);
};
}
};
return _this;
}
var _proto = OnlineManager2.prototype;
_proto.onSubscribe = function onSubscribe() {
if (!this.cleanup) {
this.setEventListener(this.setup);
}
};
_proto.onUnsubscribe = function onUnsubscribe() {
if (!this.hasListeners()) {
var _this$cleanup;
(_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);
this.cleanup = void 0;
}
};
_proto.setEventListener = function setEventListener(setup) {
var _this$cleanup2, _this2 = this;
this.setup = setup;
(_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);
this.cleanup = setup(function(online) {
if (typeof online === "boolean") {
_this2.setOnline(online);
} else {
_this2.onOnline();
}
});
};
_proto.setOnline = function setOnline(online) {
this.online = online;
if (online) {
this.onOnline();
}
};
_proto.onOnline = function onOnline2() {
this.listeners.forEach(function(listener) {
listener();
});
};
_proto.isOnline = function isOnline2() {
if (typeof this.online === "boolean") {
return this.online;
}
if (typeof navigator === "undefined" || typeof navigator.onLine === "undefined") {
return true;
}
return navigator.onLine;
};
return OnlineManager2;
}(Subscribable);
var onlineManager = new OnlineManager();
function defaultRetryDelay(failureCount) {
return Math.min(1e3 * Math.pow(2, failureCount), 3e4);
}
function isCancelable(value) {
return typeof (value == null ? void 0 : value.cancel) === "function";
}
var CancelledError = function CancelledError2(options) {
this.revert = options == null ? void 0 : options.revert;
this.silent = options == null ? void 0 : options.silent;
};
function isCancelledError(value) {
return value instanceof CancelledError;
}
var Retryer = function Retryer2(config) {
var _this = this;
var cancelRetry = false;
var cancelFn;
var continueFn;
var promiseResolve;
var promiseReject;
this.abort = config.abort;
this.cancel = function(cancelOptions) {
return cancelFn == null ? void 0 : cancelFn(cancelOptions);
};
this.cancelRetry = function() {
cancelRetry = true;
};
this.continueRetry = function() {
cancelRetry = false;
};
this.continue = function() {
return continueFn == null ? void 0 : continueFn();
};
this.failureCount = 0;
this.isPaused = false;
this.isResolved = false;
this.isTransportCancelable = false;
this.promise = new Promise(function(outerResolve, outerReject) {
promiseResolve = outerResolve;
promiseReject = outerReject;
});
var resolve = function resolve2(value) {
if (!_this.isResolved) {
_this.isResolved = true;
config.onSuccess == null ? void 0 : config.onSuccess(value);
continueFn == null ? void 0 : continueFn();
promiseResolve(value);
}
};
var reject = function reject2(value) {
if (!_this.isResolved) {
_this.isResolved = true;
config.onError == null ? void 0 : config.onError(value);
continueFn == null ? void 0 : continueFn();
promiseReject(value);
}
};
var pause = function pause2() {
return new Promise(function(continueResolve) {
continueFn = continueResolve;
_this.isPaused = true;
config.onPause == null ? void 0 : config.onPause();
}).then(function() {
continueFn = void 0;
_this.isPaused = false;
config.onContinue == null ? void 0 : config.onContinue();
});
};
var run = function run2() {
if (_this.isResolved) {
return;
}
var promiseOrValue;
try {
promiseOrValue = config.fn();
} catch (error) {
promiseOrValue = Promise.reject(error);
}
cancelFn = function cancelFn2(cancelOptions) {
if (!_this.isResolved) {
reject(new CancelledError(cancelOptions));
_this.abort == null ? void 0 : _this.abort();
if (isCancelable(promiseOrValue)) {
try {
promiseOrValue.cancel();
} catch (_unused) {
}
}
}
};
_this.isTransportCancelable = isCancelable(promiseOrValue);
Promise.resolve(promiseOrValue).then(resolve).catch(function(error) {
var _config$retry, _config$retryDelay;
if (_this.isResolved) {
return;
}
var retry = (_config$retry = config.retry) != null ? _config$retry : 3;
var retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay;
var delay = typeof retryDelay === "function" ? retryDelay(_this.failureCount, error) : retryDelay;
var shouldRetry = retry === true || typeof retry === "number" && _this.failureCount < retry || typeof retry === "function" && retry(_this.failureCount, error);
if (cancelRetry || !shouldRetry) {
reject(error);
return;
}
_this.failureCount++;
config.onFail == null ? void 0 : config.onFail(_this.failureCount, error);
sleep(delay).then(function() {
if (!focusManager.isFocused() || !onlineManager.isOnline()) {
return pause();
}
}).then(function() {
if (cancelRetry) {
reject(error);
} else {
run2();
}
});
});
};
run();
};
var NotifyManager = /* @__PURE__ */ function() {
function NotifyManager2() {
this.queue = [];
this.transactions = 0;
this.notifyFn = function(callback) {
callback();
};
this.batchNotifyFn = function(callback) {
callback();
};
}
var _proto = NotifyManager2.prototype;
_proto.batch = function batch2(callback) {
var result;
this.transactions++;
try {
result = callback();
} finally {
this.transactions--;
if (!this.transactions) {
this.flush();
}
}
return result;
};
_proto.schedule = function schedule(callback) {
var _this = this;
if (this.transactions) {
this.queue.push(callback);
} else {
scheduleMicrotask(function() {
_this.notifyFn(callback);
});
}
};
_proto.batchCalls = function batchCalls(callback) {
var _this2 = this;
return function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this2.schedule(function() {
callback.apply(void 0, args);
});
};
};
_proto.flush = function flush() {
var _this3 = this;
var queue = this.queue;
this.queue = [];
if (queue.length) {
scheduleMicrotask(function() {
_this3.batchNotifyFn(function() {
queue.forEach(function(callback) {
_this3.notifyFn(callback);
});
});
});
}
};
_proto.setNotifyFunction = function setNotifyFunction(fn) {
this.notifyFn = fn;
};
_proto.setBatchNotifyFunction = function setBatchNotifyFunction(fn) {
this.batchNotifyFn = fn;
};
return NotifyManager2;
}();
var notifyManager = new NotifyManager();
var logger$1 = console;
function getLogger() {
return logger$1;
}
function setLogger(newLogger) {
logger$1 = newLogger;
}
var Query = /* @__PURE__ */ function() {
function Query2(config) {
this.abortSignalConsumed = false;
this.hadObservers = false;
this.defaultOptions = config.defaultOptions;
this.setOptions(config.options);
this.observers = [];
this.cache = config.cache;
this.queryKey = config.queryKey;
this.queryHash = config.queryHash;
this.initialState = config.state || this.getDefaultState(this.options);
this.state = this.initialState;
this.meta = config.meta;
this.scheduleGc();
}
var _proto = Query2.prototype;
_proto.setOptions = function setOptions(options) {
var _this$options$cacheTi;
this.options = _extends$5({}, this.defaultOptions, options);
this.meta = options == null ? void 0 : options.meta;
this.cacheTime = Math.max(this.cacheTime || 0, (_this$options$cacheTi = this.options.cacheTime) != null ? _this$options$cacheTi : 5 * 60 * 1e3);
};
_proto.setDefaultOptions = function setDefaultOptions(options) {
this.defaultOptions = options;
};
_proto.scheduleGc = function scheduleGc() {
var _this = this;
this.clearGcTimeout();
if (isValidTimeout(this.cacheTime)) {
this.gcTimeout = setTimeout(function() {
_this.optionalRemove();
}, this.cacheTime);
}
};
_proto.clearGcTimeout = function clearGcTimeout() {
if (this.gcTimeout) {
clearTimeout(this.gcTimeout);
this.gcTimeout = void 0;
}
};
_proto.optionalRemove = function optionalRemove() {
if (!this.observers.length) {
if (this.state.isFetching) {
if (this.hadObservers) {
this.scheduleGc();
}
} else {
this.cache.remove(this);
}
}
};
_proto.setData = function setData(updater, options) {
var _this$options$isDataE, _this$options;
var prevData = this.state.data;
var data = functionalUpdate(updater, prevData);
if ((_this$options$isDataE = (_this$options = this.options).isDataEqual) == null ? void 0 : _this$options$isDataE.call(_this$options, prevData, data)) {
data = prevData;
} else if (this.options.structuralSharing !== false) {
data = replaceEqualDeep(prevData, data);
}
this.dispatch({
data,
type: "success",
dataUpdatedAt: options == null ? void 0 : options.updatedAt
});
return data;
};
_proto.setState = function setState(state, setStateOptions) {
this.dispatch({
type: "setState",
state,
setStateOptions
});
};
_proto.cancel = function cancel(options) {
var _this$retryer;
var promise2 = this.promise;
(_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options);
return promise2 ? promise2.then(noop).catch(noop) : Promise.resolve();
};
_proto.destroy = function destroy() {
this.clearGcTimeout();
this.cancel({
silent: true
});
};
_proto.reset = function reset() {
this.destroy();
this.setState(this.initialState);
};
_proto.isActive = function isActive() {
return this.observers.some(function(observer) {
return observer.options.enabled !== false;
});
};
_proto.isFetching = function isFetching() {
return this.state.isFetching;
};
_proto.isStale = function isStale() {
return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(function(observer) {
return observer.getCurrentResult().isStale;
});
};
_proto.isStaleByTime = function isStaleByTime(staleTime) {
if (staleTime === void 0) {
staleTime = 0;
}
return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime);
};
_proto.onFocus = function onFocus2() {
var _this$retryer2;
var observer = this.observers.find(function(x) {
return x.shouldFetchOnWindowFocus();
});
if (observer) {
observer.refetch();
}
(_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue();
};
_proto.onOnline = function onOnline2() {
var _this$retryer3;
var observer = this.observers.find(function(x) {
return x.shouldFetchOnReconnect();
});
if (observer) {
observer.refetch();
}
(_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue();
};
_proto.addObserver = function addObserver(observer) {
if (this.observers.indexOf(observer) === -1) {
this.observers.push(observer);
this.hadObservers = true;
this.clearGcTimeout();
this.cache.notify({
type: "observerAdded",
query: this,
observer
});
}
};
_proto.removeObserver = function removeObserver(observer) {
if (this.observers.indexOf(observer) !== -1) {
this.observers = this.observers.filter(function(x) {
return x !== observer;
});
if (!this.observers.length) {
if (this.retryer) {
if (this.retryer.isTransportCancelable || this.abortSignalConsumed) {
this.retryer.cancel({
revert: true
});
} else {
this.retryer.cancelRetry();
}
}
if (this.cacheTime) {
this.scheduleGc();
} else {
this.cache.remove(this);
}
}
this.cache.notify({
type: "observerRemoved",
query: this,
observer
});
}
};
_proto.getObserversCount = function getObserversCount() {
return this.observers.length;
};
_proto.invalidate = function invalidate() {
if (!this.state.isInvalidated) {
this.dispatch({
type: "invalidate"
});
}
};
_proto.fetch = function fetch2(options, fetchOptions) {
var _this2 = this, _this$options$behavio, _context$fetchOptions, _abortController$abor;
if (this.state.isFetching) {
if (this.state.dataUpdatedAt && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) {
this.cancel({
silent: true
});
} else if (this.promise) {
var _this$retryer4;
(_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry();
return this.promise;
}
}
if (options) {
this.setOptions(options);
}
if (!this.options.queryFn) {
var observer = this.observers.find(function(x) {
return x.options.queryFn;
});
if (observer) {
this.setOptions(observer.options);
}
}
var queryKey = ensureQueryKeyArray(this.queryKey);
var abortController = getAbortController();
var queryFnContext = {
queryKey,
pageParam: void 0,
meta: this.meta
};
Object.defineProperty(queryFnContext, "signal", {
enumerable: true,
get: function get2() {
if (abortController) {
_this2.abortSignalConsumed = true;
return abortController.signal;
}
return void 0;
}
});
var fetchFn = function fetchFn2() {
if (!_this2.options.queryFn) {
return Promise.reject("Missing queryFn");
}
_this2.abortSignalConsumed = false;
return _this2.options.queryFn(queryFnContext);
};
var context = {
fetchOptions,
options: this.options,
queryKey,
state: this.state,
fetchFn,
meta: this.meta
};
if ((_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch) {
var _this$options$behavio2;
(_this$options$behavio2 = this.options.behavior) == null ? void 0 : _this$options$behavio2.onFetch(context);
}
this.revertState = this.state;
if (!this.state.isFetching || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) {
var _context$fetchOptions2;
this.dispatch({
type: "fetch",
meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta
});
}
this.retryer = new Retryer({
fn: context.fetchFn,
abort: abortController == null ? void 0 : (_abortController$abor = abortController.abort) == null ? void 0 : _abortController$abor.bind(abortController),
onSuccess: function onSuccess(data) {
_this2.setData(data);
_this2.cache.config.onSuccess == null ? void 0 : _this2.cache.config.onSuccess(data, _this2);
if (_this2.cacheTime === 0) {
_this2.optionalRemove();
}
},
onError: function onError(error) {
if (!(isCancelledError(error) && error.silent)) {
_this2.dispatch({
type: "error",
error
});
}
if (!isCancelledError(error)) {
_this2.cache.config.onError == null ? void 0 : _this2.cache.config.onError(error, _this2);
getLogger().error(error);
}
if (_this2.cacheTime === 0) {
_this2.optionalRemove();
}
},
onFail: function onFail() {
_this2.dispatch({
type: "failed"
});
},
onPause: function onPause() {
_this2.dispatch({
type: "pause"
});
},
onContinue: function onContinue() {
_this2.dispatch({
type: "continue"
});
},
retry: context.options.retry,
retryDelay: context.options.retryDelay
});
this.promise = this.retryer.promise;
return this.promise;
};
_proto.dispatch = function dispatch(action) {
var _this3 = this;
this.state = this.reducer(this.state, action);
notifyManager.batch(function() {
_this3.observers.forEach(function(observer) {
observer.onQueryUpdate(action);
});
_this3.cache.notify({
query: _this3,
type: "queryUpdated",
action
});
});
};
_proto.getDefaultState = function getDefaultState2(options) {
var data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
var hasInitialData = typeof options.initialData !== "undefined";
var initialDataUpdatedAt = hasInitialData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
var hasData = typeof data !== "undefined";
return {
data,
dataUpdateCount: 0,
dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0,
error: null,
errorUpdateCount: 0,
errorUpdatedAt: 0,
fetchFailureCount: 0,
fetchMeta: null,
isFetching: false,
isInvalidated: false,
isPaused: false,
status: hasData ? "success" : "idle"
};
};
_proto.reducer = function reducer2(state, action) {
var _action$meta, _action$dataUpdatedAt;
switch (action.type) {
case "failed":
return _extends$5({}, state, {
fetchFailureCount: state.fetchFailureCount + 1
});
case "pause":
return _extends$5({}, state, {
isPaused: true
});
case "continue":
return _extends$5({}, state, {
isPaused: false
});
case "fetch":
return _extends$5({}, state, {
fetchFailureCount: 0,
fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null,
isFetching: true,
isPaused: false
}, !state.dataUpdatedAt && {
error: null,
status: "loading"
});
case "success":
return _extends$5({}, state, {
data: action.data,
dataUpdateCount: state.dataUpdateCount + 1,
dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(),
error: null,
fetchFailureCount: 0,
isFetching: false,
isInvalidated: false,
isPaused: false,
status: "success"
});
case "error":
var error = action.error;
if (isCancelledError(error) && error.revert && this.revertState) {
return _extends$5({}, this.revertState);
}
return _extends$5({}, state, {
error,
errorUpdateCount: state.errorUpdateCount + 1,
errorUpdatedAt: Date.now(),
fetchFailureCount: state.fetchFailureCount + 1,
isFetching: false,
isPaused: false,
status: "error"
});
case "invalidate":
return _extends$5({}, state, {
isInvalidated: true
});
case "setState":
return _extends$5({}, state, action.state);
default:
return state;
}
};
return Query2;
}();
var QueryCache = /* @__PURE__ */ function(_Subscribable) {
_inheritsLoose(QueryCache2, _Subscribable);
function QueryCache2(config) {
var _this;
_this = _Subscribable.call(this) || this;
_this.config = config || {};
_this.queries = [];
_this.queriesMap = {};
return _this;
}
var _proto = QueryCache2.prototype;
_proto.build = function build(client, options, state) {
var _options$queryHash;
var queryKey = options.queryKey;
var queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options);
var query = this.get(queryHash);
if (!query) {
query = new Query({
cache: this,
queryKey,
queryHash,
options: client.defaultQueryOptions(options),
state,
defaultOptions: client.getQueryDefaults(queryKey),
meta: options.meta
});
this.add(query);
}
return query;
};
_proto.add = function add2(query) {
if (!this.queriesMap[query.queryHash]) {
this.queriesMap[query.queryHash] = query;
this.queries.push(query);
this.notify({
type: "queryAdded",
query
});
}
};
_proto.remove = function remove(query) {
var queryInMap = this.queriesMap[query.queryHash];
if (queryInMap) {
query.destroy();
this.queries = this.queries.filter(function(x) {
return x !== query;
});
if (queryInMap === query) {
delete this.queriesMap[query.queryHash];
}
this.notify({
type: "queryRemoved",
query
});
}
};
_proto.clear = function clear() {
var _this2 = this;
notifyManager.batch(function() {
_this2.queries.forEach(function(query) {
_this2.remove(query);
});
});
};
_proto.get = function get2(queryHash) {
return this.queriesMap[queryHash];
};
_proto.getAll = function getAll() {
return this.queries;
};
_proto.find = function find(arg1, arg2) {
var _parseFilterArgs = parseFilterArgs(arg1, arg2), filters = _parseFilterArgs[0];
if (typeof filters.exact === "undefined") {
filters.exact = true;
}
return this.queries.find(function(query) {
return matchQuery(filters, query);
});
};
_proto.findAll = function findAll(arg1, arg2) {
var _parseFilterArgs2 = parseFilterArgs(arg1, arg2), filters = _parseFilterArgs2[0];
return Object.keys(filters).length > 0 ? this.queries.filter(function(query) {
return matchQuery(filters, query);
}) : this.queries;
};
_proto.notify = function notify(event) {
var _this3 = this;
notifyManager.batch(function() {
_this3.listeners.forEach(function(listener) {
listener(event);
});
});
};
_proto.onFocus = function onFocus2() {
var _this4 = this;
notifyManager.batch(function() {
_this4.queries.forEach(function(query) {
query.onFocus();
});
});
};
_proto.onOnline = function onOnline2() {
var _this5 = this;
notifyManager.batch(function() {
_this5.queries.forEach(function(query) {
query.onOnline();
});
});
};
return QueryCache2;
}(Subscribable);
var Mutation = /* @__PURE__ */ function() {
function Mutation2(config) {
this.options = _extends$5({}, config.defaultOptions, config.options);
this.mutationId = config.mutationId;
this.mutationCache = config.mutationCache;
this.observers = [];
this.state = config.state || getDefaultState();
this.meta = config.meta;
}
var _proto = Mutation2.prototype;
_proto.setState = function setState(state) {
this.dispatch({
type: "setState",
state
});
};
_proto.addObserver = function addObserver(observer) {
if (this.observers.indexOf(observer) === -1) {
this.observers.push(observer);
}
};
_proto.removeObserver = function removeObserver(observer) {
this.observers = this.observers.filter(function(x) {
return x !== observer;
});
};
_proto.cancel = function cancel() {
if (this.retryer) {
this.retryer.cancel();
return this.retryer.promise.then(noop).catch(noop);
}
return Promise.resolve();
};
_proto.continue = function _continue() {
if (this.retryer) {
this.retryer.continue();
return this.retryer.promise;
}
return this.execute();
};
_proto.execute = function execute() {
var _this = this;
var data;
var restored = this.state.status === "loading";
var promise2 = Promise.resolve();
if (!restored) {
this.dispatch({
type: "loading",
variables: this.options.variables
});
promise2 = promise2.then(function() {
_this.mutationCache.config.onMutate == null ? void 0 : _this.mutationCache.config.onMutate(_this.state.variables, _this);
}).then(function() {
return _this.options.onMutate == null ? void 0 : _this.options.onMutate(_this.state.variables);
}).then(function(context) {
if (context !== _this.state.context) {
_this.dispatch({
type: "loading",
context,
variables: _this.state.variables
});
}
});
}
return promise2.then(function() {
return _this.executeMutation();
}).then(function(result) {
data = result;
_this.mutationCache.config.onSuccess == null ? void 0 : _this.mutationCache.config.onSuccess(data, _this.state.variables, _this.state.context, _this);
}).then(function() {
return _this.options.onSuccess == null ? void 0 : _this.options.onSuccess(data, _this.state.variables, _this.state.context);
}).then(function() {
return _this.options.onSettled == null ? void 0 : _this.options.onSettled(data, null, _this.state.variables, _this.state.context);
}).then(function() {
_this.dispatch({
type: "success",
data
});
return data;
}).catch(function(error) {
_this.mutationCache.config.onError == null ? void 0 : _this.mutationCache.config.onError(error, _this.state.variables, _this.state.context, _this);
getLogger().error(error);
return Promise.resolve().then(function() {
return _this.options.onError == null ? void 0 : _this.options.onError(error, _this.state.variables, _this.state.context);
}).then(function() {
return _this.options.onSettled == null ? void 0 : _this.options.onSettled(void 0, error, _this.state.variables, _this.state.context);
}).then(function() {
_this.dispatch({
type: "error",
error
});
throw error;
});
});
};
_proto.executeMutation = function executeMutation() {
var _this2 = this, _this$options$retry;
this.retryer = new Retryer({
fn: function fn() {
if (!_this2.options.mutationFn) {
return Promise.reject("No mutationFn found");
}
return _this2.options.mutationFn(_this2.state.variables);
},
onFail: function onFail() {
_this2.dispatch({
type: "failed"
});
},
onPause: function onPause() {
_this2.dispatch({
type: "pause"
});
},
onContinue: function onContinue() {
_this2.dispatch({
type: "continue"
});
},
retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0,
retryDelay: this.options.retryDelay
});
return this.retryer.promise;
};
_proto.dispatch = function dispatch(action) {
var _this3 = this;
this.state = reducer$2(this.state, action);
notifyManager.batch(function() {
_this3.observers.forEach(function(observer) {
observer.onMutationUpdate(action);
});
_this3.mutationCache.notify(_this3);
});
};
return Mutation2;
}();
function getDefaultState() {
return {
context: void 0,
data: void 0,
error: null,
failureCount: 0,
isPaused: false,
status: "idle",
variables: void 0
};
}
function reducer$2(state, action) {
switch (action.type) {
case "failed":
return _extends$5({}, state, {
failureCount: state.failureCount + 1
});
case "pause":
return _extends$5({}, state, {
isPaused: true
});
case "continue":
return _extends$5({}, state, {
isPaused: false
});
case "loading":
return _extends$5({}, state, {
context: action.context,
data: void 0,
error: null,
isPaused: false,
status: "loading",
variables: action.variables
});
case "success":
return _extends$5({}, state, {
data: action.data,
error: null,
status: "success",
isPaused: false
});
case "error":
return _extends$5({}, state, {
data: void 0,
error: action.error,
failureCount: state.failureCount + 1,
isPaused: false,
status: "error"
});
case "setState":
return _extends$5({}, state, action.state);
default:
return state;
}
}
var MutationCache = /* @__PURE__ */ function(_Subscribable) {
_inheritsLoose(MutationCache2, _Subscribable);
function MutationCache2(config) {
var _this;
_this = _Subscribable.call(this) || this;
_this.config = config || {};
_this.mutations = [];
_this.mutationId = 0;
return _this;
}
var _proto = MutationCache2.prototype;
_proto.build = function build(client, options, state) {
var mutation = new Mutation({
mutationCache: this,
mutationId: ++this.mutationId,
options: client.defaultMutationOptions(options),
state,
defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : void 0,
meta: options.meta
});
this.add(mutation);
return mutation;
};
_proto.add = function add2(mutation) {
this.mutations.push(mutation);
this.notify(mutation);
};
_proto.remove = function remove(mutation) {
this.mutations = this.mutations.filter(function(x) {
return x !== mutation;
});
mutation.cancel();
this.notify(mutation);
};
_proto.clear = function clear() {
var _this2 = this;
notifyManager.batch(function() {
_this2.mutations.forEach(function(mutation) {
_this2.remove(mutation);
});
});
};
_proto.getAll = function getAll() {
return this.mutations;
};
_proto.find = function find(filters) {
if (typeof filters.exact === "undefined") {
filters.exact = true;
}
return this.mutations.find(function(mutation) {
return matchMutation(filters, mutation);
});
};
_proto.findAll = function findAll(filters) {
return this.mutations.filter(function(mutation) {
return matchMutation(filters, mutation);
});
};
_proto.notify = function notify(mutation) {
var _this3 = this;
notifyManager.batch(function() {
_this3.listeners.forEach(function(listener) {
listener(mutation);
});
});
};
_proto.onFocus = function onFocus2() {
this.resumePausedMutations();
};
_proto.onOnline = function onOnline2() {
this.resumePausedMutations();
};
_proto.resumePausedMutations = function resumePausedMutations() {
var pausedMutations = this.mutations.filter(function(x) {
return x.state.isPaused;
});
return notifyManager.batch(function() {
return pausedMutations.reduce(function(promise2, mutation) {
return promise2.then(function() {
return mutation.continue().catch(noop);
});
}, Promise.resolve());
});
};
return MutationCache2;
}(Subscribable);
function infiniteQueryBehavior() {
return {
onFetch: function onFetch(context) {
context.fetchFn = function() {
var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2;
var refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage;
var fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore;
var pageParam = fetchMore == null ? void 0 : fetchMore.pageParam;
var isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === "forward";
var isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === "backward";
var oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || [];
var oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || [];
var abortController = getAbortController();
var abortSignal = abortController == null ? void 0 : abortController.signal;
var newPageParams = oldPageParams;
var cancelled = false;
var queryFn = context.options.queryFn || function() {
return Promise.reject("Missing queryFn");
};
var buildNewPages = function buildNewPages2(pages, param2, page, previous) {
newPageParams = previous ? [param2].concat(newPageParams) : [].concat(newPageParams, [param2]);
return previous ? [page].concat(pages) : [].concat(pages, [page]);
};
var fetchPage = function fetchPage2(pages, manual2, param2, previous) {
if (cancelled) {
return Promise.reject("Cancelled");
}
if (typeof param2 === "undefined" && !manual2 && pages.length) {
return Promise.resolve(pages);
}
var queryFnContext = {
queryKey: context.queryKey,
signal: abortSignal,
pageParam: param2,
meta: context.meta
};
var queryFnResult = queryFn(queryFnContext);
var promise3 = Promise.resolve(queryFnResult).then(function(page) {
return buildNewPages(pages, param2, page, previous);
});
if (isCancelable(queryFnResult)) {
var promiseAsAny = promise3;
promiseAsAny.cancel = queryFnResult.cancel;
}
return promise3;
};
var promise2;
if (!oldPages.length) {
promise2 = fetchPage([]);
} else if (isFetchingNextPage) {
var manual = typeof pageParam !== "undefined";
var param = manual ? pageParam : getNextPageParam(context.options, oldPages);
promise2 = fetchPage(oldPages, manual, param);
} else if (isFetchingPreviousPage) {
var _manual = typeof pageParam !== "undefined";
var _param = _manual ? pageParam : getPreviousPageParam(context.options, oldPages);
promise2 = fetchPage(oldPages, _manual, _param, true);
} else {
(function() {
newPageParams = [];
var manual2 = typeof context.options.getNextPageParam === "undefined";
var shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true;
promise2 = shouldFetchFirstPage ? fetchPage([], manual2, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0]));
var _loop = function _loop2(i2) {
promise2 = promise2.then(function(pages) {
var shouldFetchNextPage = refetchPage && oldPages[i2] ? refetchPage(oldPages[i2], i2, oldPages) : true;
if (shouldFetchNextPage) {
var _param2 = manual2 ? oldPageParams[i2] : getNextPageParam(context.options, pages);
return fetchPage(pages, manual2, _param2);
}
return Promise.resolve(buildNewPages(pages, oldPageParams[i2], oldPages[i2]));
});
};
for (var i = 1; i < oldPages.length; i++) {
_loop(i);
}
})();
}
var finalPromise = promise2.then(function(pages) {
return {
pages,
pageParams: newPageParams
};
});
var finalPromiseAsAny = finalPromise;
finalPromiseAsAny.cancel = function() {
cancelled = true;
abortController == null ? void 0 : abortController.abort();
if (isCancelable(promise2)) {
promise2.cancel();
}
};
return finalPromise;
};
}
};
}
function getNextPageParam(options, pages) {
return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages);
}
function getPreviousPageParam(options, pages) {
return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages);
}
var QueryClient = /* @__PURE__ */ function() {
function QueryClient2(config) {
if (config === void 0) {
config = {};
}
this.queryCache = config.queryCache || new QueryCache();
this.mutationCache = config.mutationCache || new MutationCache();
this.defaultOptions = config.defaultOptions || {};
this.queryDefaults = [];
this.mutationDefaults = [];
}
var _proto = QueryClient2.prototype;
_proto.mount = function mount() {
var _this = this;
this.unsubscribeFocus = focusManager.subscribe(function() {
if (focusManager.isFocused() && onlineManager.isOnline()) {
_this.mutationCache.onFocus();
_this.queryCache.onFocus();
}
});
this.unsubscribeOnline = onlineManager.subscribe(function() {
if (focusManager.isFocused() && onlineManager.isOnline()) {
_this.mutationCache.onOnline();
_this.queryCache.onOnline();
}
});
};
_proto.unmount = function unmount() {
var _this$unsubscribeFocu, _this$unsubscribeOnli;
(_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);
(_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);
};
_proto.isFetching = function isFetching(arg1, arg2) {
var _parseFilterArgs = parseFilterArgs(arg1, arg2), filters = _parseFilterArgs[0];
filters.fetching = true;
return this.queryCache.findAll(filters).length;
};
_proto.isMutating = function isMutating(filters) {
return this.mutationCache.findAll(_extends$5({}, filters, {
fetching: true
})).length;
};
_proto.getQueryData = function getQueryData(queryKey, filters) {
var _this$queryCache$find;
return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data;
};
_proto.getQueriesData = function getQueriesData(queryKeyOrFilters) {
return this.getQueryCache().findAll(queryKeyOrFilters).map(function(_ref) {
var queryKey = _ref.queryKey, state = _ref.state;
var data = state.data;
return [queryKey, data];
});
};
_proto.setQueryData = function setQueryData(queryKey, updater, options) {
var parsedOptions = parseQueryArgs(queryKey);
var defaultedOptions = this.defaultQueryOptions(parsedOptions);
return this.queryCache.build(this, defaultedOptions).setData(updater, options);
};
_proto.setQueriesData = function setQueriesData(queryKeyOrFilters, updater, options) {
var _this2 = this;
return notifyManager.batch(function() {
return _this2.getQueryCache().findAll(queryKeyOrFilters).map(function(_ref2) {
var queryKey = _ref2.queryKey;
return [queryKey, _this2.setQueryData(queryKey, updater, options)];
});
});
};
_proto.getQueryState = function getQueryState(queryKey, filters) {
var _this$queryCache$find2;
return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state;
};
_proto.removeQueries = function removeQueries(arg1, arg2) {
var _parseFilterArgs2 = parseFilterArgs(arg1, arg2), filters = _parseFilterArgs2[0];
var queryCache = this.queryCache;
notifyManager.batch(function() {
queryCache.findAll(filters).forEach(function(query) {
queryCache.remove(query);
});
});
};
_proto.resetQueries = function resetQueries(arg1, arg2, arg3) {
var _this3 = this;
var _parseFilterArgs3 = parseFilterArgs(arg1, arg2, arg3), filters = _parseFilterArgs3[0], options = _parseFilterArgs3[1];
var queryCache = this.queryCache;
var refetchFilters = _extends$5({}, filters, {
active: true
});
return notifyManager.batch(function() {
queryCache.findAll(filters).forEach(function(query) {
query.reset();
});
return _this3.refetchQueries(refetchFilters, options);
});
};
_proto.cancelQueries = function cancelQueries(arg1, arg2, arg3) {
var _this4 = this;
var _parseFilterArgs4 = parseFilterArgs(arg1, arg2, arg3), filters = _parseFilterArgs4[0], _parseFilterArgs4$ = _parseFilterArgs4[1], cancelOptions = _parseFilterArgs4$ === void 0 ? {} : _parseFilterArgs4$;
if (typeof cancelOptions.revert === "undefined") {
cancelOptions.revert = true;
}
var promises = notifyManager.batch(function() {
return _this4.queryCache.findAll(filters).map(function(query) {
return query.cancel(cancelOptions);
});
});
return Promise.all(promises).then(noop).catch(noop);
};
_proto.invalidateQueries = function invalidateQueries(arg1, arg2, arg3) {
var _ref3, _filters$refetchActiv, _filters$refetchInact, _this5 = this;
var _parseFilterArgs5 = parseFilterArgs(arg1, arg2, arg3), filters = _parseFilterArgs5[0], options = _parseFilterArgs5[1];
var refetchFilters = _extends$5({}, filters, {
// if filters.refetchActive is not provided and filters.active is explicitly false,
// e.g. invalidateQueries({ active: false }), we don't want to refetch active queries
active: (_ref3 = (_filters$refetchActiv = filters.refetchActive) != null ? _filters$refetchActiv : filters.active) != null ? _ref3 : true,
inactive: (_filters$refetchInact = filters.refetchInactive) != null ? _filters$refetchInact : false
});
return notifyManager.batch(function() {
_this5.queryCache.findAll(filters).forEach(function(query) {
query.invalidate();
});
return _this5.refetchQueries(refetchFilters, options);
});
};
_proto.refetchQueries = function refetchQueries(arg1, arg2, arg3) {
var _this6 = this;
var _parseFilterArgs6 = parseFilterArgs(arg1, arg2, arg3), filters = _parseFilterArgs6[0], options = _parseFilterArgs6[1];
var promises = notifyManager.batch(function() {
return _this6.queryCache.findAll(filters).map(function(query) {
return query.fetch(void 0, _extends$5({}, options, {
meta: {
refetchPage: filters == null ? void 0 : filters.refetchPage
}
}));
});
});
var promise2 = Promise.all(promises).then(noop);
if (!(options == null ? void 0 : options.throwOnError)) {
promise2 = promise2.catch(noop);
}
return promise2;
};
_proto.fetchQuery = function fetchQuery(arg1, arg2, arg3) {
var parsedOptions = parseQueryArgs(arg1, arg2, arg3);
var defaultedOptions = this.defaultQueryOptions(parsedOptions);
if (typeof defaultedOptions.retry === "undefined") {
defaultedOptions.retry = false;
}
var query = this.queryCache.build(this, defaultedOptions);
return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
};
_proto.prefetchQuery = function prefetchQuery(arg1, arg2, arg3) {
return this.fetchQuery(arg1, arg2, arg3).then(noop).catch(noop);
};
_proto.fetchInfiniteQuery = function fetchInfiniteQuery(arg1, arg2, arg3) {
var parsedOptions = parseQueryArgs(arg1, arg2, arg3);
parsedOptions.behavior = infiniteQueryBehavior();
return this.fetchQuery(parsedOptions);
};
_proto.prefetchInfiniteQuery = function prefetchInfiniteQuery(arg1, arg2, arg3) {
return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop).catch(noop);
};
_proto.cancelMutations = function cancelMutations() {
var _this7 = this;
var promises = notifyManager.batch(function() {
return _this7.mutationCache.getAll().map(function(mutation) {
return mutation.cancel();
});
});
return Promise.all(promises).then(noop).catch(noop);
};
_proto.resumePausedMutations = function resumePausedMutations() {
return this.getMutationCache().resumePausedMutations();
};
_proto.executeMutation = function executeMutation(options) {
return this.mutationCache.build(this, options).execute();
};
_proto.getQueryCache = function getQueryCache() {
return this.queryCache;
};
_proto.getMutationCache = function getMutationCache() {
return this.mutationCache;
};
_proto.getDefaultOptions = function getDefaultOptions() {
return this.defaultOptions;
};
_proto.setDefaultOptions = function setDefaultOptions(options) {
this.defaultOptions = options;
};
_proto.setQueryDefaults = function setQueryDefaults(queryKey, options) {
var result = this.queryDefaults.find(function(x) {
return hashQueryKey(queryKey) === hashQueryKey(x.queryKey);
});
if (result) {
result.defaultOptions = options;
} else {
this.queryDefaults.push({
queryKey,
defaultOptions: options
});
}
};
_proto.getQueryDefaults = function getQueryDefaults(queryKey) {
var _this$queryDefaults$f;
return queryKey ? (_this$queryDefaults$f = this.queryDefaults.find(function(x) {
return partialMatchKey(queryKey, x.queryKey);
})) == null ? void 0 : _this$queryDefaults$f.defaultOptions : void 0;
};
_proto.setMutationDefaults = function setMutationDefaults(mutationKey, options) {
var result = this.mutationDefaults.find(function(x) {
return hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey);
});
if (result) {
result.defaultOptions = options;
} else {
this.mutationDefaults.push({
mutationKey,
defaultOptions: options
});
}
};
_proto.getMutationDefaults = function getMutationDefaults(mutationKey) {
var _this$mutationDefault;
return mutationKey ? (_this$mutationDefault = this.mutationDefaults.find(function(x) {
return partialMatchKey(mutationKey, x.mutationKey);
})) == null ? void 0 : _this$mutationDefault.defaultOptions : void 0;
};
_proto.defaultQueryOptions = function defaultQueryOptions(options) {
if (options == null ? void 0 : options._defaulted) {
return options;
}
var defaultedOptions = _extends$5({}, this.defaultOptions.queries, this.getQueryDefaults(options == null ? void 0 : options.queryKey), options, {
_defaulted: true
});
if (!defaultedOptions.queryHash && defaultedOptions.queryKey) {
defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);
}
return defaultedOptions;
};
_proto.defaultQueryObserverOptions = function defaultQueryObserverOptions(options) {
return this.defaultQueryOptions(options);
};
_proto.defaultMutationOptions = function defaultMutationOptions(options) {
if (options == null ? void 0 : options._defaulted) {
return options;
}
return _extends$5({}, this.defaultOptions.mutations, this.getMutationDefaults(options == null ? void 0 : options.mutationKey), options, {
_defaulted: true
});
};
_proto.clear = function clear() {
this.queryCache.clear();
this.mutationCache.clear();
};
return QueryClient2;
}();
var unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates;
notifyManager.setBatchNotifyFunction(unstable_batchedUpdates);
var logger = console;
setLogger(logger);
var map;
try {
map = Map;
} catch (_) {
}
var set;
try {
set = Set;
} catch (_) {
}
function baseClone(src, circulars, clones) {
if (!src || typeof src !== "object" || typeof src === "function") {
return src;
}
if (src.nodeType && "cloneNode" in src) {
return src.cloneNode(true);
}
if (src instanceof Date) {
return new Date(src.getTime());
}
if (src instanceof RegExp) {
return new RegExp(src);
}
if (Array.isArray(src)) {
return src.map(clone);
}
if (map && src instanceof map) {
return new Map(Array.from(src.entries()));
}
if (set && src instanceof set) {
return new Set(Array.from(src.values()));
}
if (src instanceof Object) {
circulars.push(src);
var obj = Object.create(src);
clones.push(obj);
for (var key in src) {
var idx = circulars.findIndex(function(i) {
return i === src[key];
});
obj[key] = idx > -1 ? clones[idx] : baseClone(src[key], circulars, clones);
}
return obj;
}
return src;
}
function clone(src) {
return baseClone(src, [], []);
}
const toString2 = Object.prototype.toString;
const errorToString = Error.prototype.toString;
const regExpToString = RegExp.prototype.toString;
const symbolToString = typeof Symbol !== "undefined" ? Symbol.prototype.toString : () => "";
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
function printNumber(val) {
if (val != +val) return "NaN";
const isNegativeZero = val === 0 && 1 / val < 0;
return isNegativeZero ? "-0" : "" + val;
}
function printSimpleValue(val, quoteStrings = false) {
if (val == null || val === true || val === false) return "" + val;
const typeOf = typeof val;
if (typeOf === "number") return printNumber(val);
if (typeOf === "string") return quoteStrings ? `"${val}"` : val;
if (typeOf === "function") return "[Function " + (val.name || "anonymous") + "]";
if (typeOf === "symbol") return symbolToString.call(val).replace(SYMBOL_REGEXP, "Symbol($1)");
const tag = toString2.call(val).slice(8, -1);
if (tag === "Date") return isNaN(val.getTime()) ? "" + val : val.toISOString(val);
if (tag === "Error" || val instanceof Error) return "[" + errorToString.call(val) + "]";
if (tag === "RegExp") return regExpToString.call(val);
return null;
}
function printValue(value, quoteStrings) {
let result = printSimpleValue(value, quoteStrings);
if (result !== null) return result;
return JSON.stringify(value, function(key, value2) {
let result2 = printSimpleValue(this[key], quoteStrings);
if (result2 !== null) return result2;
return value2;
}, 2);
}
let mixed = {
default: "${path} is invalid",
required: "${path} is a required field",
oneOf: "${path} must be one of the following values: ${values}",
notOneOf: "${path} must not be one of the following values: ${values}",
notType: ({
path,
type,
value,
originalValue
}) => {
let isCast = originalValue != null && originalValue !== value;
let msg = `${path} must be a \`${type}\` type, but the final value was: \`${printValue(value, true)}\`` + (isCast ? ` (cast from the value \`${printValue(originalValue, true)}\`).` : ".");
if (value === null) {
msg += `
If "null" is intended as an empty value be sure to mark the schema as \`.nullable()\``;
}
return msg;
},
defined: "${path} must be defined"
};
let string = {
length: "${path} must be exactly ${length} characters",
min: "${path} must be at least ${min} characters",
max: "${path} must be at most ${max} characters",
matches: '${path} must match the following: "${regex}"',
email: "${path} must be a valid email",
url: "${path} must be a valid URL",
uuid: "${path} must be a valid UUID",
trim: "${path} must be a trimmed string",
lowercase: "${path} must be a lowercase string",
uppercase: "${path} must be a upper case string"
};
let number = {
min: "${path} must be greater than or equal to ${min}",
max: "${path} must be less than or equal to ${max}",
lessThan: "${path} must be less than ${less}",
moreThan: "${path} must be greater than ${more}",
positive: "${path} must be a positive number",
negative: "${path} must be a negative number",
integer: "${path} must be an integer"
};
let date = {
min: "${path} field must be later than ${min}",
max: "${path} field must be at earlier than ${max}"
};
let boolean = {
isValue: "${path} field must be ${value}"
};
let object = {
noUnknown: "${path} field has unspecified keys: ${unknown}"
};
let array = {
min: "${path} field must have at least ${min} items",
max: "${path} field must have less than or equal to ${max} items",
length: "${path} must be have ${length} items"
};
Object.assign(/* @__PURE__ */ Object.create(null), {
mixed,
string,
number,
date,
object,
array,
boolean
});
const isSchema = (obj) => obj && obj.__isYupSchema__;
class Condition {
constructor(refs, options) {
this.refs = refs;
this.refs = refs;
if (typeof options === "function") {
this.fn = options;
return;
}
if (!has(options, "is")) throw new TypeError("`is:` is required for `when()` conditions");
if (!options.then && !options.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
let {
is,
then,
otherwise
} = options;
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
this.fn = function(...args) {
let options2 = args.pop();
let schema = args.pop();
let branch = check(...args) ? then : otherwise;
if (!branch) return void 0;
if (typeof branch === "function") return branch(schema);
return schema.concat(branch.resolve(options2));
};
}
resolve(base, options) {
let values = this.refs.map((ref) => ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context));
let schema = this.fn.apply(base, values.concat(base, options));
if (schema === void 0 || schema === base) return base;
if (!isSchema(schema)) throw new TypeError("conditions must return a schema object");
return schema.resolve(options);
}
}
function toArray(value) {
return value == null ? [] : [].concat(value);
}
function _extends$4() {
_extends$4 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$4.apply(this, arguments);
}
let strReg = /\$\{\s*(\w+)\s*\}/g;
class ValidationError extends Error {
static formatError(message, params) {
const path = params.label || params.path || "this";
if (path !== params.path) params = _extends$4({}, params, {
path
});
if (typeof message === "string") return message.replace(strReg, (_, key) => printValue(params[key]));
if (typeof message === "function") return message(params);
return message;
}
static isError(err) {
return err && err.name === "ValidationError";
}
constructor(errorOrErrors, value, field, type) {
super();
this.name = "ValidationError";
this.value = value;
this.path = field;
this.type = type;
this.errors = [];
this.inner = [];
toArray(errorOrErrors).forEach((err) => {
if (ValidationError.isError(err)) {
this.errors.push(...err.errors);
this.inner = this.inner.concat(err.inner.length ? err.inner : err);
} else {
this.errors.push(err);
}
});
this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];
if (Error.captureStackTrace) Error.captureStackTrace(this, ValidationError);
}
}
const once = (cb) => {
let fired = false;
return (...args) => {
if (fired) return;
fired = true;
cb(...args);
};
};
function runTests(options, cb) {
let {
endEarly,
tests,
args,
value,
errors,
sort,
path
} = options;
let callback = once(cb);
let count = tests.length;
const nestedErrors = [];
errors = errors ? errors : [];
if (!count) return errors.length ? callback(new ValidationError(errors, value, path)) : callback(null, value);
for (let i = 0; i < tests.length; i++) {
const test2 = tests[i];
test2(args, function finishTestRun(err) {
if (err) {
if (!ValidationError.isError(err)) {
return callback(err, value);
}
if (endEarly) {
err.value = value;
return callback(err, value);
}
nestedErrors.push(err);
}
if (--count <= 0) {
if (nestedErrors.length) {
if (sort) nestedErrors.sort(sort);
if (errors.length) nestedErrors.push(...errors);
errors = nestedErrors;
}
if (errors.length) {
callback(new ValidationError(errors, value, path), value);
return;
}
callback(null, value);
}
});
}
}
function Cache(maxSize) {
this._maxSize = maxSize;
this.clear();
}
Cache.prototype.clear = function() {
this._size = 0;
this._values = /* @__PURE__ */ Object.create(null);
};
Cache.prototype.get = function(key) {
return this._values[key];
};
Cache.prototype.set = function(key, value) {
this._size >= this._maxSize && this.clear();
if (!(key in this._values)) this._size++;
return this._values[key] = value;
};
var SPLIT_REGEX = /[^.^\]^[]+|(?=\[\]|\.\.)/g, DIGIT_REGEX = /^\d+$/, LEAD_DIGIT_REGEX = /^\d/, SPEC_CHAR_REGEX = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, CLEAN_QUOTES_REGEX = /^\s*(['"]?)(.*?)(\1)\s*$/, MAX_CACHE_SIZE = 512;
var pathCache = new Cache(MAX_CACHE_SIZE), setCache = new Cache(MAX_CACHE_SIZE), getCache = new Cache(MAX_CACHE_SIZE);
var propertyExpr = {
Cache,
split,
normalizePath,
setter: function(path) {
var parts = normalizePath(path);
return setCache.get(path) || setCache.set(path, function setter(obj, value) {
var index2 = 0;
var len = parts.length;
var data = obj;
while (index2 < len - 1) {
var part = parts[index2];
if (part === "__proto__" || part === "constructor" || part === "prototype") {
return obj;
}
data = data[parts[index2++]];
}
data[parts[index2]] = value;
});
},
getter: function(path, safe) {
var parts = normalizePath(path);
return getCache.get(path) || getCache.set(path, function getter(data) {
var index2 = 0, len = parts.length;
while (index2 < len) {
if (data != null || !safe) data = data[parts[index2++]];
else return;
}
return data;
});
},
join: function(segments) {
return segments.reduce(function(path, part) {
return path + (isQuoted(part) || DIGIT_REGEX.test(part) ? "[" + part + "]" : (path ? "." : "") + part);
}, "");
},
forEach: function(path, cb, thisArg) {
forEach(Array.isArray(path) ? path : split(path), cb, thisArg);
}
};
function normalizePath(path) {
return pathCache.get(path) || pathCache.set(
path,
split(path).map(function(part) {
return part.replace(CLEAN_QUOTES_REGEX, "$2");
})
);
}
function split(path) {
return path.match(SPLIT_REGEX) || [""];
}
function forEach(parts, iter, thisArg) {
var len = parts.length, part, idx, isArray2, isBracket;
for (idx = 0; idx < len; idx++) {
part = parts[idx];
if (part) {
if (shouldBeQuoted(part)) {
part = '"' + part + '"';
}
isBracket = isQuoted(part);
isArray2 = !isBracket && /^\d+$/.test(part);
iter.call(thisArg, part, isBracket, isArray2, idx, parts);
}
}
}
function isQuoted(str) {
return typeof str === "string" && str && ["'", '"'].indexOf(str.charAt(0)) !== -1;
}
function hasLeadingNumber(part) {
return part.match(LEAD_DIGIT_REGEX) && !part.match(DIGIT_REGEX);
}
function hasSpecialChars(part) {
return SPEC_CHAR_REGEX.test(part);
}
function shouldBeQuoted(part) {
return !isQuoted(part) && (hasLeadingNumber(part) || hasSpecialChars(part));
}
const prefixes = {
context: "$",
value: "."
};
function create$7(key, options) {
return new Reference(key, options);
}
class Reference {
constructor(key, options = {}) {
if (typeof key !== "string") throw new TypeError("ref must be a string, got: " + key);
this.key = key.trim();
if (key === "") throw new TypeError("ref must be a non-empty string");
this.isContext = this.key[0] === prefixes.context;
this.isValue = this.key[0] === prefixes.value;
this.isSibling = !this.isContext && !this.isValue;
let prefix = this.isContext ? prefixes.context : this.isValue ? prefixes.value : "";
this.path = this.key.slice(prefix.length);
this.getter = this.path && propertyExpr.getter(this.path, true);
this.map = options.map;
}
getValue(value, parent, context) {
let result = this.isContext ? context : this.isValue ? value : parent;
if (this.getter) result = this.getter(result || {});
if (this.map) result = this.map(result);
return result;
}
/**
*
* @param {*} value
* @param {Object} options
* @param {Object=} options.context
* @param {Object=} options.parent
*/
cast(value, options) {
return this.getValue(value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context);
}
resolve() {
return this;
}
describe() {
return {
type: "ref",
key: this.key
};
}
toString() {
return `Ref(${this.key})`;
}
static isRef(value) {
return value && value.__isYupRef;
}
}
Reference.prototype.__isYupRef = true;
function _extends$3() {
_extends$3 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$3.apply(this, arguments);
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function createValidation(config) {
function validate(_ref, cb) {
let {
value,
path = "",
label,
options,
originalValue,
sync
} = _ref, rest = _objectWithoutPropertiesLoose(_ref, ["value", "path", "label", "options", "originalValue", "sync"]);
const {
name,
test: test2,
params,
message
} = config;
let {
parent,
context
} = options;
function resolve(item) {
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
}
function createError(overrides = {}) {
const nextParams = mapValues(_extends$3({
value,
originalValue,
label,
path: overrides.path || path
}, params, overrides.params), resolve);
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name);
error.params = nextParams;
return error;
}
let ctx = _extends$3({
path,
parent,
type: name,
createError,
resolve,
options,
originalValue
}, rest);
if (!sync) {
try {
Promise.resolve(test2.call(ctx, value, ctx)).then((validOrError) => {
if (ValidationError.isError(validOrError)) cb(validOrError);
else if (!validOrError) cb(createError());
else cb(null, validOrError);
});
} catch (err) {
cb(err);
}
return;
}
let result;
try {
var _ref2;
result = test2.call(ctx, value, ctx);
if (typeof ((_ref2 = result) == null ? void 0 : _ref2.then) === "function") {
throw new Error(`Validation test of type: "${ctx.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
}
} catch (err) {
cb(err);
return;
}
if (ValidationError.isError(result)) cb(result);
else if (!result) cb(createError());
else cb(null, result);
}
validate.OPTIONS = config;
return validate;
}
let trim = (part) => part.substr(0, part.length - 1).substr(1);
function getIn(schema, path, value, context = value) {
let parent, lastPart, lastPartDebug;
if (!path) return {
parent,
parentPath: path,
schema
};
propertyExpr.forEach(path, (_part, isBracket, isArray2) => {
let part = isBracket ? trim(_part) : _part;
schema = schema.resolve({
context,
parent,
value
});
if (schema.innerType) {
let idx = isArray2 ? parseInt(part, 10) : 0;
if (value && idx >= value.length) {
throw new Error(`Yup.reach cannot resolve an array item at index: ${_part}, in the path: ${path}. because there is no value at that index. `);
}
parent = value;
value = value && value[idx];
schema = schema.innerType;
}
if (!isArray2) {
if (!schema.fields || !schema.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema._type}")`);
parent = value;
value = value && value[part];
schema = schema.fields[part];
}
lastPart = part;
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
});
return {
schema,
parent,
parentPath: lastPart
};
}
class ReferenceSet {
constructor() {
this.list = /* @__PURE__ */ new Set();
this.refs = /* @__PURE__ */ new Map();
}
get size() {
return this.list.size + this.refs.size;
}
describe() {
const description = [];
for (const item of this.list) description.push(item);
for (const [, ref] of this.refs) description.push(ref.describe());
return description;
}
toArray() {
return Array.from(this.list).concat(Array.from(this.refs.values()));
}
add(value) {
Reference.isRef(value) ? this.refs.set(value.key, value) : this.list.add(value);
}
delete(value) {
Reference.isRef(value) ? this.refs.delete(value.key) : this.list.delete(value);
}
has(value, resolve) {
if (this.list.has(value)) return true;
let item, values = this.refs.values();
while (item = values.next(), !item.done) if (resolve(item.value) === value) return true;
return false;
}
clone() {
const next = new ReferenceSet();
next.list = new Set(this.list);
next.refs = new Map(this.refs);
return next;
}
merge(newItems, removeItems) {
const next = this.clone();
newItems.list.forEach((value) => next.add(value));
newItems.refs.forEach((value) => next.add(value));
removeItems.list.forEach((value) => next.delete(value));
removeItems.refs.forEach((value) => next.delete(value));
return next;
}
}
function _extends$2() {
_extends$2 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$2.apply(this, arguments);
}
class BaseSchema {
constructor(options) {
this.deps = [];
this.conditions = [];
this._whitelist = new ReferenceSet();
this._blacklist = new ReferenceSet();
this.exclusiveTests = /* @__PURE__ */ Object.create(null);
this.tests = [];
this.transforms = [];
this.withMutation(() => {
this.typeError(mixed.notType);
});
this.type = (options == null ? void 0 : options.type) || "mixed";
this.spec = _extends$2({
strip: false,
strict: false,
abortEarly: true,
recursive: true,
nullable: false,
presence: "optional"
}, options == null ? void 0 : options.spec);
}
// TODO: remove
get _type() {
return this.type;
}
_typeCheck(_value) {
return true;
}
clone(spec) {
if (this._mutate) {
if (spec) Object.assign(this.spec, spec);
return this;
}
const next = Object.create(Object.getPrototypeOf(this));
next.type = this.type;
next._typeError = this._typeError;
next._whitelistError = this._whitelistError;
next._blacklistError = this._blacklistError;
next._whitelist = this._whitelist.clone();
next._blacklist = this._blacklist.clone();
next.exclusiveTests = _extends$2({}, this.exclusiveTests);
next.deps = [...this.deps];
next.conditions = [...this.conditions];
next.tests = [...this.tests];
next.transforms = [...this.transforms];
next.spec = clone(_extends$2({}, this.spec, spec));
return next;
}
label(label) {
var next = this.clone();
next.spec.label = label;
return next;
}
meta(...args) {
if (args.length === 0) return this.spec.meta;
let next = this.clone();
next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);
return next;
}
// withContext<TContext extends AnyObject>(): BaseSchema<
// TCast,
// TContext,
// TOutput
// > {
// return this as any;
// }
withMutation(fn) {
let before = this._mutate;
this._mutate = true;
let result = fn(this);
this._mutate = before;
return result;
}
concat(schema) {
if (!schema || schema === this) return this;
if (schema.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema.type}`);
let base = this;
let combined = schema.clone();
const mergedSpec = _extends$2({}, base.spec, combined.spec);
combined.spec = mergedSpec;
combined._typeError || (combined._typeError = base._typeError);
combined._whitelistError || (combined._whitelistError = base._whitelistError);
combined._blacklistError || (combined._blacklistError = base._blacklistError);
combined._whitelist = base._whitelist.merge(schema._whitelist, schema._blacklist);
combined._blacklist = base._blacklist.merge(schema._blacklist, schema._whitelist);
combined.tests = base.tests;
combined.exclusiveTests = base.exclusiveTests;
combined.withMutation((next) => {
schema.tests.forEach((fn) => {
next.test(fn.OPTIONS);
});
});
return combined;
}
isType(v2) {
if (this.spec.nullable && v2 === null) return true;
return this._typeCheck(v2);
}
resolve(options) {
let schema = this;
if (schema.conditions.length) {
let conditions = schema.conditions;
schema = schema.clone();
schema.conditions = [];
schema = conditions.reduce((schema2, condition) => condition.resolve(schema2, options), schema);
schema = schema.resolve(options);
}
return schema;
}
/**
*
* @param {*} value
* @param {Object} options
* @param {*=} options.parent
* @param {*=} options.context
*/
cast(value, options = {}) {
let resolvedSchema = this.resolve(_extends$2({
value
}, options));
let result = resolvedSchema._cast(value, options);
if (value !== void 0 && options.assert !== false && resolvedSchema.isType(result) !== true) {
let formattedValue = printValue(value);
let formattedResult = printValue(result);
throw new TypeError(`The value of ${options.path || "field"} could not be cast to a value that satisfies the schema type: "${resolvedSchema._type}".
attempted value: ${formattedValue}
` + (formattedResult !== formattedValue ? `result of cast: ${formattedResult}` : ""));
}
return result;
}
_cast(rawValue, _options) {
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((value2, fn) => fn.call(this, value2, rawValue, this), rawValue);
if (value === void 0) {
value = this.getDefault();
}
return value;
}
_validate(_value, options = {}, cb) {
let {
sync,
path,
from = [],
originalValue = _value,
strict = this.spec.strict,
abortEarly = this.spec.abortEarly
} = options;
let value = _value;
if (!strict) {
value = this._cast(value, _extends$2({
assert: false
}, options));
}
let args = {
value,
path,
options,
originalValue,
schema: this,
label: this.spec.label,
sync,
from
};
let initialTests = [];
if (this._typeError) initialTests.push(this._typeError);
if (this._whitelistError) initialTests.push(this._whitelistError);
if (this._blacklistError) initialTests.push(this._blacklistError);
runTests({
args,
value,
path,
sync,
tests: initialTests,
endEarly: abortEarly
}, (err) => {
if (err) return void cb(err, value);
runTests({
tests: this.tests,
args,
path,
sync,
value,
endEarly: abortEarly
}, cb);
});
}
validate(value, options, maybeCb) {
let schema = this.resolve(_extends$2({}, options, {
value
}));
return typeof maybeCb === "function" ? schema._validate(value, options, maybeCb) : new Promise((resolve, reject) => schema._validate(value, options, (err, value2) => {
if (err) reject(err);
else resolve(value2);
}));
}
validateSync(value, options) {
let schema = this.resolve(_extends$2({}, options, {
value
}));
let result;
schema._validate(value, _extends$2({}, options, {
sync: true
}), (err, value2) => {
if (err) throw err;
result = value2;
});
return result;
}
isValid(value, options) {
return this.validate(value, options).then(() => true, (err) => {
if (ValidationError.isError(err)) return false;
throw err;
});
}
isValidSync(value, options) {
try {
this.validateSync(value, options);
return true;
} catch (err) {
if (ValidationError.isError(err)) return false;
throw err;
}
}
_getDefault() {
let defaultValue = this.spec.default;
if (defaultValue == null) {
return defaultValue;
}
return typeof defaultValue === "function" ? defaultValue.call(this) : clone(defaultValue);
}
getDefault(options) {
let schema = this.resolve(options || {});
return schema._getDefault();
}
default(def) {
if (arguments.length === 0) {
return this._getDefault();
}
let next = this.clone({
default: def
});
return next;
}
strict(isStrict = true) {
var next = this.clone();
next.spec.strict = isStrict;
return next;
}
_isPresent(value) {
return value != null;
}
defined(message = mixed.defined) {
return this.test({
message,
name: "defined",
exclusive: true,
test(value) {
return value !== void 0;
}
});
}
required(message = mixed.required) {
return this.clone({
presence: "required"
}).withMutation((s) => s.test({
message,
name: "required",
exclusive: true,
test(value) {
return this.schema._isPresent(value);
}
}));
}
notRequired() {
var next = this.clone({
presence: "optional"
});
next.tests = next.tests.filter((test2) => test2.OPTIONS.name !== "required");
return next;
}
nullable(isNullable = true) {
var next = this.clone({
nullable: isNullable !== false
});
return next;
}
transform(fn) {
var next = this.clone();
next.transforms.push(fn);
return next;
}
/**
* Adds a test function to the schema's queue of tests.
* tests can be exclusive or non-exclusive.
*
* - exclusive tests, will replace any existing tests of the same name.
* - non-exclusive: can be stacked
*
* If a non-exclusive test is added to a schema with an exclusive test of the same name
* the exclusive test is removed and further tests of the same name will be stacked.
*
* If an exclusive test is added to a schema with non-exclusive tests of the same name
* the previous tests are removed and further tests of the same name will replace each other.
*/
test(...args) {
let opts;
if (args.length === 1) {
if (typeof args[0] === "function") {
opts = {
test: args[0]
};
} else {
opts = args[0];
}
} else if (args.length === 2) {
opts = {
name: args[0],
test: args[1]
};
} else {
opts = {
name: args[0],
message: args[1],
test: args[2]
};
}
if (opts.message === void 0) opts.message = mixed.default;
if (typeof opts.test !== "function") throw new TypeError("`test` is a required parameters");
let next = this.clone();
let validate = createValidation(opts);
let isExclusive = opts.exclusive || opts.name && next.exclusiveTests[opts.name] === true;
if (opts.exclusive) {
if (!opts.name) throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");
}
if (opts.name) next.exclusiveTests[opts.name] = !!opts.exclusive;
next.tests = next.tests.filter((fn) => {
if (fn.OPTIONS.name === opts.name) {
if (isExclusive) return false;
if (fn.OPTIONS.test === validate.OPTIONS.test) return false;
}
return true;
});
next.tests.push(validate);
return next;
}
when(keys, options) {
if (!Array.isArray(keys) && typeof keys !== "string") {
options = keys;
keys = ".";
}
let next = this.clone();
let deps = toArray(keys).map((key) => new Reference(key));
deps.forEach((dep) => {
if (dep.isSibling) next.deps.push(dep.key);
});
next.conditions.push(new Condition(deps, options));
return next;
}
typeError(message) {
var next = this.clone();
next._typeError = createValidation({
message,
name: "typeError",
test(value) {
if (value !== void 0 && !this.schema.isType(value)) return this.createError({
params: {
type: this.schema._type
}
});
return true;
}
});
return next;
}
oneOf(enums, message = mixed.oneOf) {
var next = this.clone();
enums.forEach((val) => {
next._whitelist.add(val);
next._blacklist.delete(val);
});
next._whitelistError = createValidation({
message,
name: "oneOf",
test(value) {
if (value === void 0) return true;
let valids = this.schema._whitelist;
return valids.has(value, this.resolve) ? true : this.createError({
params: {
values: valids.toArray().join(", ")
}
});
}
});
return next;
}
notOneOf(enums, message = mixed.notOneOf) {
var next = this.clone();
enums.forEach((val) => {
next._blacklist.add(val);
next._whitelist.delete(val);
});
next._blacklistError = createValidation({
message,
name: "notOneOf",
test(value) {
let invalids = this.schema._blacklist;
if (invalids.has(value, this.resolve)) return this.createError({
params: {
values: invalids.toArray().join(", ")
}
});
return true;
}
});
return next;
}
strip(strip = true) {
let next = this.clone();
next.spec.strip = strip;
return next;
}
describe() {
const next = this.clone();
const {
label,
meta
} = next.spec;
const description = {
meta,
label,
type: next.type,
oneOf: next._whitelist.describe(),
notOneOf: next._blacklist.describe(),
tests: next.tests.map((fn) => ({
name: fn.OPTIONS.name,
params: fn.OPTIONS.params
})).filter((n, idx, list) => list.findIndex((c) => c.name === n.name) === idx)
};
return description;
}
}
BaseSchema.prototype.__isYupSchema__ = true;
for (const method of ["validate", "validateSync"]) BaseSchema.prototype[`${method}At`] = function(path, value, options = {}) {
const {
parent,
parentPath,
schema
} = getIn(this, path, value, options.context);
return schema[method](parent && parent[parentPath], _extends$2({}, options, {
parent,
path
}));
};
for (const alias of ["equals", "is"]) BaseSchema.prototype[alias] = BaseSchema.prototype.oneOf;
for (const alias of ["not", "nope"]) BaseSchema.prototype[alias] = BaseSchema.prototype.notOneOf;
BaseSchema.prototype.optional = BaseSchema.prototype.notRequired;
const Mixed = BaseSchema;
function create$6() {
return new Mixed();
}
create$6.prototype = Mixed.prototype;
const isAbsent = (value) => value == null;
function create$5() {
return new BooleanSchema();
}
class BooleanSchema extends BaseSchema {
constructor() {
super({
type: "boolean"
});
this.withMutation(() => {
this.transform(function(value) {
if (!this.isType(value)) {
if (/^(true|1)$/i.test(String(value))) return true;
if (/^(false|0)$/i.test(String(value))) return false;
}
return value;
});
});
}
_typeCheck(v2) {
if (v2 instanceof Boolean) v2 = v2.valueOf();
return typeof v2 === "boolean";
}
isTrue(message = boolean.isValue) {
return this.test({
message,
name: "is-value",
exclusive: true,
params: {
value: "true"
},
test(value) {
return isAbsent(value) || value === true;
}
});
}
isFalse(message = boolean.isValue) {
return this.test({
message,
name: "is-value",
exclusive: true,
params: {
value: "false"
},
test(value) {
return isAbsent(value) || value === false;
}
});
}
}
create$5.prototype = BooleanSchema.prototype;
let rEmail = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
let rUrl = /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;
let rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
let isTrimmed = (value) => isAbsent(value) || value === value.trim();
let objStringTag = {}.toString();
function create$4() {
return new StringSchema();
}
class StringSchema extends BaseSchema {
constructor() {
super({
type: "string"
});
this.withMutation(() => {
this.transform(function(value) {
if (this.isType(value)) return value;
if (Array.isArray(value)) return value;
const strValue = value != null && value.toString ? value.toString() : value;
if (strValue === objStringTag) return value;
return strValue;
});
});
}
_typeCheck(value) {
if (value instanceof String) value = value.valueOf();
return typeof value === "string";
}
_isPresent(value) {
return super._isPresent(value) && !!value.length;
}
length(length, message = string.length) {
return this.test({
message,
name: "length",
exclusive: true,
params: {
length
},
test(value) {
return isAbsent(value) || value.length === this.resolve(length);
}
});
}
min(min, message = string.min) {
return this.test({
message,
name: "min",
exclusive: true,
params: {
min
},
test(value) {
return isAbsent(value) || value.length >= this.resolve(min);
}
});
}
max(max, message = string.max) {
return this.test({
name: "max",
exclusive: true,
message,
params: {
max
},
test(value) {
return isAbsent(value) || value.length <= this.resolve(max);
}
});
}
matches(regex, options) {
let excludeEmptyString = false;
let message;
let name;
if (options) {
if (typeof options === "object") {
({
excludeEmptyString = false,
message,
name
} = options);
} else {
message = options;
}
}
return this.test({
name: name || "matches",
message: message || string.matches,
params: {
regex
},
test: (value) => isAbsent(value) || value === "" && excludeEmptyString || value.search(regex) !== -1
});
}
email(message = string.email) {
return this.matches(rEmail, {
name: "email",
message,
excludeEmptyString: true
});
}
url(message = string.url) {
return this.matches(rUrl, {
name: "url",
message,
excludeEmptyString: true
});
}
uuid(message = string.uuid) {
return this.matches(rUUID, {
name: "uuid",
message,
excludeEmptyString: false
});
}
//-- transforms --
ensure() {
return this.default("").transform((val) => val === null ? "" : val);
}
trim(message = string.trim) {
return this.transform((val) => val != null ? val.trim() : val).test({
message,
name: "trim",
test: isTrimmed
});
}
lowercase(message = string.lowercase) {
return this.transform((value) => !isAbsent(value) ? value.toLowerCase() : value).test({
message,
name: "string_case",
exclusive: true,
test: (value) => isAbsent(value) || value === value.toLowerCase()
});
}
uppercase(message = string.uppercase) {
return this.transform((value) => !isAbsent(value) ? value.toUpperCase() : value).test({
message,
name: "string_case",
exclusive: true,
test: (value) => isAbsent(value) || value === value.toUpperCase()
});
}
}
create$4.prototype = StringSchema.prototype;
let isNaN$1 = (value) => value != +value;
function create$3() {
return new NumberSchema();
}
class NumberSchema extends BaseSchema {
constructor() {
super({
type: "number"
});
this.withMutation(() => {
this.transform(function(value) {
let parsed = value;
if (typeof parsed === "string") {
parsed = parsed.replace(/\s/g, "");
if (parsed === "") return NaN;
parsed = +parsed;
}
if (this.isType(parsed)) return parsed;
return parseFloat(parsed);
});
});
}
_typeCheck(value) {
if (value instanceof Number) value = value.valueOf();
return typeof value === "number" && !isNaN$1(value);
}
min(min, message = number.min) {
return this.test({
message,
name: "min",
exclusive: true,
params: {
min
},
test(value) {
return isAbsent(value) || value >= this.resolve(min);
}
});
}
max(max, message = number.max) {
return this.test({
message,
name: "max",
exclusive: true,
params: {
max
},
test(value) {
return isAbsent(value) || value <= this.resolve(max);
}
});
}
lessThan(less, message = number.lessThan) {
return this.test({
message,
name: "max",
exclusive: true,
params: {
less
},
test(value) {
return isAbsent(value) || value < this.resolve(less);
}
});
}
moreThan(more, message = number.moreThan) {
return this.test({
message,
name: "min",
exclusive: true,
params: {
more
},
test(value) {
return isAbsent(value) || value > this.resolve(more);
}
});
}
positive(msg = number.positive) {
return this.moreThan(0, msg);
}
negative(msg = number.negative) {
return this.lessThan(0, msg);
}
integer(message = number.integer) {
return this.test({
name: "integer",
message,
test: (val) => isAbsent(val) || Number.isInteger(val)
});
}
truncate() {
return this.transform((value) => !isAbsent(value) ? value | 0 : value);
}
round(method) {
var _method;
var avail = ["ceil", "floor", "round", "trunc"];
method = ((_method = method) == null ? void 0 : _method.toLowerCase()) || "round";
if (method === "trunc") return this.truncate();
if (avail.indexOf(method.toLowerCase()) === -1) throw new TypeError("Only valid options for round() are: " + avail.join(", "));
return this.transform((value) => !isAbsent(value) ? Math[method](value) : value);
}
}
create$3.prototype = NumberSchema.prototype;
var isoReg = /^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;
function parseIsoDate(date2) {
var numericKeys = [1, 4, 5, 6, 7, 10, 11], minutesOffset = 0, timestamp, struct;
if (struct = isoReg.exec(date2)) {
for (var i = 0, k; k = numericKeys[i]; ++i) struct[k] = +struct[k] || 0;
struct[2] = (+struct[2] || 1) - 1;
struct[3] = +struct[3] || 1;
struct[7] = struct[7] ? String(struct[7]).substr(0, 3) : 0;
if ((struct[8] === void 0 || struct[8] === "") && (struct[9] === void 0 || struct[9] === "")) timestamp = +new Date(struct[1], struct[2], struct[3], struct[4], struct[5], struct[6], struct[7]);
else {
if (struct[8] !== "Z" && struct[9] !== void 0) {
minutesOffset = struct[10] * 60 + struct[11];
if (struct[9] === "+") minutesOffset = 0 - minutesOffset;
}
timestamp = Date.UTC(struct[1], struct[2], struct[3], struct[4], struct[5] + minutesOffset, struct[6], struct[7]);
}
} else timestamp = Date.parse ? Date.parse(date2) : NaN;
return timestamp;
}
let invalidDate = /* @__PURE__ */ new Date("");
let isDate = (obj) => Object.prototype.toString.call(obj) === "[object Date]";
class DateSchema extends BaseSchema {
constructor() {
super({
type: "date"
});
this.withMutation(() => {
this.transform(function(value) {
if (this.isType(value)) return value;
value = parseIsoDate(value);
return !isNaN(value) ? new Date(value) : invalidDate;
});
});
}
_typeCheck(v2) {
return isDate(v2) && !isNaN(v2.getTime());
}
prepareParam(ref, name) {
let param;
if (!Reference.isRef(ref)) {
let cast = this.cast(ref);
if (!this._typeCheck(cast)) throw new TypeError(`\`${name}\` must be a Date or a value that can be \`cast()\` to a Date`);
param = cast;
} else {
param = ref;
}
return param;
}
min(min, message = date.min) {
let limit = this.prepareParam(min, "min");
return this.test({
message,
name: "min",
exclusive: true,
params: {
min
},
test(value) {
return isAbsent(value) || value >= this.resolve(limit);
}
});
}
max(max, message = date.max) {
var limit = this.prepareParam(max, "max");
return this.test({
message,
name: "max",
exclusive: true,
params: {
max
},
test(value) {
return isAbsent(value) || value <= this.resolve(limit);
}
});
}
}
DateSchema.INVALID_DATE = invalidDate;
DateSchema.prototype;
var toposort$2 = { exports: {} };
toposort$2.exports = function(edges) {
return toposort(uniqueNodes(edges), edges);
};
toposort$2.exports.array = toposort;
function toposort(nodes, edges) {
var cursor = nodes.length, sorted = new Array(cursor), visited = {}, i = cursor, outgoingEdges = makeOutgoingEdges(edges), nodesHash = makeNodesHash(nodes);
edges.forEach(function(edge) {
if (!nodesHash.has(edge[0]) || !nodesHash.has(edge[1])) {
throw new Error("Unknown node. There is an unknown node in the supplied edges.");
}
});
while (i--) {
if (!visited[i]) visit(nodes[i], i, /* @__PURE__ */ new Set());
}
return sorted;
function visit(node, i2, predecessors) {
if (predecessors.has(node)) {
var nodeRep;
try {
nodeRep = ", node was:" + JSON.stringify(node);
} catch (e) {
nodeRep = "";
}
throw new Error("Cyclic dependency" + nodeRep);
}
if (!nodesHash.has(node)) {
throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(node));
}
if (visited[i2]) return;
visited[i2] = true;
var outgoing = outgoingEdges.get(node) || /* @__PURE__ */ new Set();
outgoing = Array.from(outgoing);
if (i2 = outgoing.length) {
predecessors.add(node);
do {
var child = outgoing[--i2];
visit(child, nodesHash.get(child), predecessors);
} while (i2);
predecessors.delete(node);
}
sorted[--cursor] = node;
}
}
function uniqueNodes(arr) {
var res = /* @__PURE__ */ new Set();
for (var i = 0, len = arr.length; i < len; i++) {
var edge = arr[i];
res.add(edge[0]);
res.add(edge[1]);
}
return Array.from(res);
}
function makeOutgoingEdges(arr) {
var edges = /* @__PURE__ */ new Map();
for (var i = 0, len = arr.length; i < len; i++) {
var edge = arr[i];
if (!edges.has(edge[0])) edges.set(edge[0], /* @__PURE__ */ new Set());
if (!edges.has(edge[1])) edges.set(edge[1], /* @__PURE__ */ new Set());
edges.get(edge[0]).add(edge[1]);
}
return edges;
}
function makeNodesHash(arr) {
var res = /* @__PURE__ */ new Map();
for (var i = 0, len = arr.length; i < len; i++) {
res.set(arr[i], i);
}
return res;
}
var toposortExports = toposort$2.exports;
const toposort$1 = /* @__PURE__ */ getDefaultExportFromCjs(toposortExports);
function sortFields(fields, excludes = []) {
let edges = [];
let nodes = [];
function addNode(depPath, key) {
var node = propertyExpr.split(depPath)[0];
if (!~nodes.indexOf(node)) nodes.push(node);
if (!~excludes.indexOf(`${key}-${node}`)) edges.push([key, node]);
}
for (const key in fields) if (has(fields, key)) {
let value = fields[key];
if (!~nodes.indexOf(key)) nodes.push(key);
if (Reference.isRef(value) && value.isSibling) addNode(value.path, key);
else if (isSchema(value) && "deps" in value) value.deps.forEach((path) => addNode(path, key));
}
return toposort$1.array(nodes, edges).reverse();
}
function findIndex(arr, err) {
let idx = Infinity;
arr.some((key, ii) => {
var _err$path;
if (((_err$path = err.path) == null ? void 0 : _err$path.indexOf(key)) !== -1) {
idx = ii;
return true;
}
});
return idx;
}
function sortByKeyOrder(keys) {
return (a2, b) => {
return findIndex(keys, a2) - findIndex(keys, b);
};
}
function _extends$1() {
_extends$1 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$1.apply(this, arguments);
}
let isObject = (obj) => Object.prototype.toString.call(obj) === "[object Object]";
function unknown(ctx, value) {
let known = Object.keys(ctx.fields);
return Object.keys(value).filter((key) => known.indexOf(key) === -1);
}
const defaultSort = sortByKeyOrder([]);
class ObjectSchema extends BaseSchema {
constructor(spec) {
super({
type: "object"
});
this.fields = /* @__PURE__ */ Object.create(null);
this._sortErrors = defaultSort;
this._nodes = [];
this._excludedEdges = [];
this.withMutation(() => {
this.transform(function coerce(value) {
if (typeof value === "string") {
try {
value = JSON.parse(value);
} catch (err) {
value = null;
}
}
if (this.isType(value)) return value;
return null;
});
if (spec) {
this.shape(spec);
}
});
}
_typeCheck(value) {
return isObject(value) || typeof value === "function";
}
_cast(_value, options = {}) {
var _options$stripUnknown;
let value = super._cast(_value, options);
if (value === void 0) return this.getDefault();
if (!this._typeCheck(value)) return value;
let fields = this.fields;
let strip = (_options$stripUnknown = options.stripUnknown) != null ? _options$stripUnknown : this.spec.noUnknown;
let props = this._nodes.concat(Object.keys(value).filter((v2) => this._nodes.indexOf(v2) === -1));
let intermediateValue = {};
let innerOptions = _extends$1({}, options, {
parent: intermediateValue,
__validating: options.__validating || false
});
let isChanged = false;
for (const prop of props) {
let field = fields[prop];
let exists = has(value, prop);
if (field) {
let fieldValue;
let inputValue = value[prop];
innerOptions.path = (options.path ? `${options.path}.` : "") + prop;
field = field.resolve({
value: inputValue,
context: options.context,
parent: intermediateValue
});
let fieldSpec = "spec" in field ? field.spec : void 0;
let strict = fieldSpec == null ? void 0 : fieldSpec.strict;
if (fieldSpec == null ? void 0 : fieldSpec.strip) {
isChanged = isChanged || prop in value;
continue;
}
fieldValue = !options.__validating || !strict ? (
// TODO: use _cast, this is double resolving
field.cast(value[prop], innerOptions)
) : value[prop];
if (fieldValue !== void 0) {
intermediateValue[prop] = fieldValue;
}
} else if (exists && !strip) {
intermediateValue[prop] = value[prop];
}
if (intermediateValue[prop] !== value[prop]) {
isChanged = true;
}
}
return isChanged ? intermediateValue : value;
}
_validate(_value, opts = {}, callback) {
let errors = [];
let {
sync,
from = [],
originalValue = _value,
abortEarly = this.spec.abortEarly,
recursive = this.spec.recursive
} = opts;
from = [{
schema: this,
value: originalValue
}, ...from];
opts.__validating = true;
opts.originalValue = originalValue;
opts.from = from;
super._validate(_value, opts, (err, value) => {
if (err) {
if (!ValidationError.isError(err) || abortEarly) {
return void callback(err, value);
}
errors.push(err);
}
if (!recursive || !isObject(value)) {
callback(errors[0] || null, value);
return;
}
originalValue = originalValue || value;
let tests = this._nodes.map((key) => (_, cb) => {
let path = key.indexOf(".") === -1 ? (opts.path ? `${opts.path}.` : "") + key : `${opts.path || ""}["${key}"]`;
let field = this.fields[key];
if (field && "validate" in field) {
field.validate(value[key], _extends$1({}, opts, {
// @ts-ignore
path,
from,
// inner fields are always strict:
// 1. this isn't strict so the casting will also have cast inner values
// 2. this is strict in which case the nested values weren't cast either
strict: true,
parent: value,
originalValue: originalValue[key]
}), cb);
return;
}
cb(null);
});
runTests({
sync,
tests,
value,
errors,
endEarly: abortEarly,
sort: this._sortErrors,
path: opts.path
}, callback);
});
}
clone(spec) {
const next = super.clone(spec);
next.fields = _extends$1({}, this.fields);
next._nodes = this._nodes;
next._excludedEdges = this._excludedEdges;
next._sortErrors = this._sortErrors;
return next;
}
concat(schema) {
let next = super.concat(schema);
let nextFields = next.fields;
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
const target = nextFields[field];
if (target === void 0) {
nextFields[field] = schemaOrRef;
} else if (target instanceof BaseSchema && schemaOrRef instanceof BaseSchema) {
nextFields[field] = schemaOrRef.concat(target);
}
}
return next.withMutation(() => next.shape(nextFields));
}
getDefaultFromShape() {
let dft = {};
this._nodes.forEach((key) => {
const field = this.fields[key];
dft[key] = "default" in field ? field.getDefault() : void 0;
});
return dft;
}
_getDefault() {
if ("default" in this.spec) {
return super._getDefault();
}
if (!this._nodes.length) {
return void 0;
}
return this.getDefaultFromShape();
}
shape(additions, excludes = []) {
let next = this.clone();
let fields = Object.assign(next.fields, additions);
next.fields = fields;
next._sortErrors = sortByKeyOrder(Object.keys(fields));
if (excludes.length) {
if (!Array.isArray(excludes[0])) excludes = [excludes];
let keys = excludes.map(([first, second]) => `${first}-${second}`);
next._excludedEdges = next._excludedEdges.concat(keys);
}
next._nodes = sortFields(fields, next._excludedEdges);
return next;
}
pick(keys) {
const picked = {};
for (const key of keys) {
if (this.fields[key]) picked[key] = this.fields[key];
}
return this.clone().withMutation((next) => {
next.fields = {};
return next.shape(picked);
});
}
omit(keys) {
const next = this.clone();
const fields = next.fields;
next.fields = {};
for (const key of keys) {
delete fields[key];
}
return next.withMutation(() => next.shape(fields));
}
from(from, to, alias) {
let fromGetter = propertyExpr.getter(from, true);
return this.transform((obj) => {
if (obj == null) return obj;
let newObj = obj;
if (has(obj, from)) {
newObj = _extends$1({}, obj);
if (!alias) delete newObj[from];
newObj[to] = fromGetter(obj);
}
return newObj;
});
}
noUnknown(noAllow = true, message = object.noUnknown) {
if (typeof noAllow === "string") {
message = noAllow;
noAllow = true;
}
let next = this.test({
name: "noUnknown",
exclusive: true,
message,
test(value) {
if (value == null) return true;
const unknownKeys = unknown(this.schema, value);
return !noAllow || unknownKeys.length === 0 || this.createError({
params: {
unknown: unknownKeys.join(", ")
}
});
}
});
next.spec.noUnknown = noAllow;
return next;
}
unknown(allow = true, message = object.noUnknown) {
return this.noUnknown(!allow, message);
}
transformKeys(fn) {
return this.transform((obj) => obj && mapKeys(obj, (_, key) => fn(key)));
}
camelCase() {
return this.transformKeys(camelCase);
}
snakeCase() {
return this.transformKeys(snakeCase);
}
constantCase() {
return this.transformKeys((key) => snakeCase(key).toUpperCase());
}
describe() {
let base = super.describe();
base.fields = mapValues(this.fields, (value) => value.describe());
return base;
}
}
function create$2(spec) {
return new ObjectSchema(spec);
}
create$2.prototype = ObjectSchema.prototype;
function _extends() {
_extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function create$1(type) {
return new ArraySchema(type);
}
class ArraySchema extends BaseSchema {
constructor(type) {
super({
type: "array"
});
this.innerType = type;
this.withMutation(() => {
this.transform(function(values) {
if (typeof values === "string") try {
values = JSON.parse(values);
} catch (err) {
values = null;
}
return this.isType(values) ? values : null;
});
});
}
_typeCheck(v2) {
return Array.isArray(v2);
}
get _subType() {
return this.innerType;
}
_cast(_value, _opts) {
const value = super._cast(_value, _opts);
if (!this._typeCheck(value) || !this.innerType) return value;
let isChanged = false;
const castArray = value.map((v2, idx) => {
const castElement = this.innerType.cast(v2, _extends({}, _opts, {
path: `${_opts.path || ""}[${idx}]`
}));
if (castElement !== v2) {
isChanged = true;
}
return castElement;
});
return isChanged ? castArray : value;
}
_validate(_value, options = {}, callback) {
var _options$abortEarly, _options$recursive;
let errors = [];
let sync = options.sync;
let path = options.path;
let innerType = this.innerType;
let endEarly = (_options$abortEarly = options.abortEarly) != null ? _options$abortEarly : this.spec.abortEarly;
let recursive = (_options$recursive = options.recursive) != null ? _options$recursive : this.spec.recursive;
let originalValue = options.originalValue != null ? options.originalValue : _value;
super._validate(_value, options, (err, value) => {
if (err) {
if (!ValidationError.isError(err) || endEarly) {
return void callback(err, value);
}
errors.push(err);
}
if (!recursive || !innerType || !this._typeCheck(value)) {
callback(errors[0] || null, value);
return;
}
originalValue = originalValue || value;
let tests = new Array(value.length);
for (let idx = 0; idx < value.length; idx++) {
let item = value[idx];
let path2 = `${options.path || ""}[${idx}]`;
let innerOptions = _extends({}, options, {
path: path2,
strict: true,
parent: value,
index: idx,
originalValue: originalValue[idx]
});
tests[idx] = (_, cb) => innerType.validate(item, innerOptions, cb);
}
runTests({
sync,
path,
value,
errors,
endEarly,
tests
}, callback);
});
}
clone(spec) {
const next = super.clone(spec);
next.innerType = this.innerType;
return next;
}
concat(schema) {
let next = super.concat(schema);
next.innerType = this.innerType;
if (schema.innerType) next.innerType = next.innerType ? (
// @ts-expect-error Lazy doesn't have concat()
next.innerType.concat(schema.innerType)
) : schema.innerType;
return next;
}
of(schema) {
let next = this.clone();
if (!isSchema(schema)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema));
next.innerType = schema;
return next;
}
length(length, message = array.length) {
return this.test({
message,
name: "length",
exclusive: true,
params: {
length
},
test(value) {
return isAbsent(value) || value.length === this.resolve(length);
}
});
}
min(min, message) {
message = message || array.min;
return this.test({
message,
name: "min",
exclusive: true,
params: {
min
},
// FIXME(ts): Array<typeof T>
test(value) {
return isAbsent(value) || value.length >= this.resolve(min);
}
});
}
max(max, message) {
message = message || array.max;
return this.test({
message,
name: "max",
exclusive: true,
params: {
max
},
test(value) {
return isAbsent(value) || value.length <= this.resolve(max);
}
});
}
ensure() {
return this.default(() => []).transform((val, original2) => {
if (this._typeCheck(val)) return val;
return original2 == null ? [] : [].concat(original2);
});
}
compact(rejector) {
let reject = !rejector ? (v2) => !!v2 : (v2, i, a2) => !rejector(v2, i, a2);
return this.transform((values) => values != null ? values.filter(reject) : values);
}
describe() {
let base = super.describe();
if (this.innerType) base.innerType = this.innerType.describe();
return base;
}
nullable(isNullable = true) {
return super.nullable(isNullable);
}
defined() {
return super.defined();
}
required(msg) {
return super.required(msg);
}
}
create$1.prototype = ArraySchema.prototype;
function create(builder) {
return new Lazy(builder);
}
class Lazy {
constructor(builder) {
this.type = "lazy";
this.__isYupSchema__ = true;
this._resolve = (value, options = {}) => {
let schema = this.builder(value, options);
if (!isSchema(schema)) throw new TypeError("lazy() functions must return a valid schema");
return schema.resolve(options);
};
this.builder = builder;
}
resolve(options) {
return this._resolve(options.value, options);
}
cast(value, options) {
return this._resolve(value, options).cast(value, options);
}
validate(value, options, maybeCb) {
return this._resolve(value, options).validate(value, options, maybeCb);
}
validateSync(value, options) {
return this._resolve(value, options).validateSync(value, options);
}
validateAt(path, value, options) {
return this._resolve(value, options).validateAt(path, value, options);
}
validateSyncAt(path, value, options) {
return this._resolve(value, options).validateSyncAt(path, value, options);
}
describe() {
return null;
}
isValid(value, options) {
return this._resolve(value, options).isValid(value, options);
}
isValidSync(value, options) {
return this._resolve(value, options).isValidSync(value, options);
}
}
const BASE_62_DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
function midpoint(a2, b, digits) {
const zero = digits[0];
if (b != null && a2 >= b) {
throw new Error(a2 + " >= " + b);
}
if (a2.slice(-1) === zero || b && b.slice(-1) === zero) {
throw new Error("trailing zero");
}
if (b) {
let n = 0;
while ((a2[n] || zero) === b[n]) {
n++;
}
if (n > 0) {
return b.slice(0, n) + midpoint(a2.slice(n), b.slice(n), digits);
}
}
const digitA = a2 ? digits.indexOf(a2[0]) : 0;
const digitB = b != null ? digits.indexOf(b[0]) : digits.length;
if (digitB - digitA > 1) {
const midDigit = Math.round(0.5 * (digitA + digitB));
return digits[midDigit];
} else {
if (b && b.length > 1) {
return b.slice(0, 1);
} else {
return digits[digitA] + midpoint(a2.slice(1), null, digits);
}
}
}
function validateInteger(int) {
if (int.length !== getIntegerLength(int[0])) {
throw new Error("invalid integer part of order key: " + int);
}
}
function getIntegerLength(head) {
if (head >= "a" && head <= "z") {
return head.charCodeAt(0) - "a".charCodeAt(0) + 2;
} else if (head >= "A" && head <= "Z") {
return "Z".charCodeAt(0) - head.charCodeAt(0) + 2;
} else {
throw new Error("invalid order key head: " + head);
}
}
function getIntegerPart(key) {
const integerPartLength = getIntegerLength(key[0]);
if (integerPartLength > key.length) {
throw new Error("invalid order key: " + key);
}
return key.slice(0, integerPartLength);
}
function validateOrderKey(key, digits) {
if (key === "A" + digits[0].repeat(26)) {
throw new Error("invalid order key: " + key);
}
const i = getIntegerPart(key);
const f2 = key.slice(i.length);
if (f2.slice(-1) === digits[0]) {
throw new Error("invalid order key: " + key);
}
}
function incrementInteger(x, digits) {
validateInteger(x);
const [head, ...digs] = x.split("");
let carry = true;
for (let i = digs.length - 1; carry && i >= 0; i--) {
const d2 = digits.indexOf(digs[i]) + 1;
if (d2 === digits.length) {
digs[i] = digits[0];
} else {
digs[i] = digits[d2];
carry = false;
}
}
if (carry) {
if (head === "Z") {
return "a" + digits[0];
}
if (head === "z") {
return null;
}
const h2 = String.fromCharCode(head.charCodeAt(0) + 1);
if (h2 > "a") {
digs.push(digits[0]);
} else {
digs.pop();
}
return h2 + digs.join("");
} else {
return head + digs.join("");
}
}
function decrementInteger(x, digits) {
validateInteger(x);
const [head, ...digs] = x.split("");
let borrow = true;
for (let i = digs.length - 1; borrow && i >= 0; i--) {
const d2 = digits.indexOf(digs[i]) - 1;
if (d2 === -1) {
digs[i] = digits.slice(-1);
} else {
digs[i] = digits[d2];
borrow = false;
}
}
if (borrow) {
if (head === "a") {
return "Z" + digits.slice(-1);
}
if (head === "A") {
return null;
}
const h2 = String.fromCharCode(head.charCodeAt(0) - 1);
if (h2 < "Z") {
digs.push(digits.slice(-1));
} else {
digs.pop();
}
return h2 + digs.join("");
} else {
return head + digs.join("");
}
}
function generateKeyBetween(a2, b, digits = BASE_62_DIGITS) {
if (a2 != null) {
validateOrderKey(a2, digits);
}
if (b != null) {
validateOrderKey(b, digits);
}
if (a2 != null && b != null && a2 >= b) {
throw new Error(a2 + " >= " + b);
}
if (a2 == null) {
if (b == null) {
return "a" + digits[0];
}
const ib2 = getIntegerPart(b);
const fb2 = b.slice(ib2.length);
if (ib2 === "A" + digits[0].repeat(26)) {
return ib2 + midpoint("", fb2, digits);
}
if (ib2 < b) {
return ib2;
}
const res = decrementInteger(ib2, digits);
if (res == null) {
throw new Error("cannot decrement any more");
}
return res;
}
if (b == null) {
const ia2 = getIntegerPart(a2);
const fa2 = a2.slice(ia2.length);
const i2 = incrementInteger(ia2, digits);
return i2 == null ? ia2 + midpoint(fa2, null, digits) : i2;
}
const ia = getIntegerPart(a2);
const fa = a2.slice(ia.length);
const ib = getIntegerPart(b);
const fb = b.slice(ib.length);
if (ia === ib) {
return ia + midpoint(fa, fb, digits);
}
const i = incrementInteger(ia, digits);
if (i == null) {
throw new Error("cannot increment any more");
}
if (i < b) {
return i;
}
return ia + midpoint(fa, null, digits);
}
function generateNKeysBetween(a2, b, n, digits = BASE_62_DIGITS) {
if (n === 0) {
return [];
}
if (n === 1) {
return [generateKeyBetween(a2, b, digits)];
}
if (b == null) {
let c2 = generateKeyBetween(a2, b, digits);
const result = [c2];
for (let i = 0; i < n - 1; i++) {
c2 = generateKeyBetween(c2, b, digits);
result.push(c2);
}
return result;
}
if (a2 == null) {
let c2 = generateKeyBetween(a2, b, digits);
const result = [c2];
for (let i = 0; i < n - 1; i++) {
c2 = generateKeyBetween(a2, c2, digits);
result.push(c2);
}
result.reverse();
return result;
}
const mid = Math.floor(n / 2);
const c = generateKeyBetween(a2, b, digits);
return [
...generateNKeysBetween(a2, c, mid, digits),
c,
...generateNKeysBetween(c, b, n - mid - 1, digits)
];
}
function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
return amount - numerator * Math.floor(amount / numerator);
}
const $3b62074eb05584b2$var$EPOCH = 1721426;
function $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {
year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);
let y1 = year - 1;
let monthOffset = -2;
if (month <= 2) monthOffset = 0;
else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) monthOffset = -1;
return $3b62074eb05584b2$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
}
function $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
}
function $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {
return era === "BC" ? 1 - year : year;
}
function $3b62074eb05584b2$export$4475b7e617eb123c(year) {
let era = "AD";
if (year <= 0) {
era = "BC";
year = 1 - year;
}
return [
era,
year
];
}
const $3b62074eb05584b2$var$daysInMonth = {
standard: [
31,
28,
31,
30,
31,
30,
31,
31,
30,
31,
30,
31
],
leapyear: [
31,
29,
31,
30,
31,
30,
31,
31,
30,
31,
30,
31
]
};
class $3b62074eb05584b2$export$80ee6245ec4f29ec {
fromJulianDay(jd) {
let jd0 = jd;
let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;
let quadricent = Math.floor(depoch / 146097);
let dqc = $2b4dce13dd5a17fa$export$842a2cf37af977e1(depoch, 146097);
let cent = Math.floor(dqc / 36524);
let dcent = $2b4dce13dd5a17fa$export$842a2cf37af977e1(dqc, 36524);
let quad = Math.floor(dcent / 1461);
let dquad = $2b4dce13dd5a17fa$export$842a2cf37af977e1(dcent, 1461);
let yindex = Math.floor(dquad / 365);
let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);
let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);
let leapAdj = 2;
if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) leapAdj = 1;
let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(era, year, month, day);
}
toJulianDay(date2) {
return $3b62074eb05584b2$export$f297eb839006d339(date2.era, date2.year, date2.month, date2.day);
}
getDaysInMonth(date2) {
return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date2.year) ? "leapyear" : "standard"][date2.month - 1];
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
getMonthsInYear(date2) {
return 12;
}
getDaysInYear(date2) {
return $3b62074eb05584b2$export$553d7fa8e3805fc0(date2.year) ? 366 : 365;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
getYearsInEra(date2) {
return 9999;
}
getEras() {
return [
"BC",
"AD"
];
}
isInverseEra(date2) {
return date2.era === "BC";
}
balanceDate(date2) {
if (date2.year <= 0) {
date2.era = date2.era === "BC" ? "AD" : "BC";
date2.year = 1 - date2.year;
}
}
constructor() {
this.identifier = "gregory";
}
}
function $14e0f24ef4ac5c92$export$68781ddf31c0090f(a2, b) {
return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
}
function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a2, b) {
return $14e0f24ef4ac5c92$var$timeToMs(a2) - $14e0f24ef4ac5c92$var$timeToMs(b);
}
function $14e0f24ef4ac5c92$var$timeToMs(a2) {
return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
}
let $14e0f24ef4ac5c92$var$localTimeZone = null;
function $14e0f24ef4ac5c92$export$aa8b41735afcabd2() {
if ($14e0f24ef4ac5c92$var$localTimeZone == null) $14e0f24ef4ac5c92$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
return $14e0f24ef4ac5c92$var$localTimeZone;
}
function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date2) {
date2 = $11d87f3f76e88657$export$b4a036af3fc0b032(date2, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
let year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(date2.era, date2.year);
return $11d87f3f76e88657$var$epochFromParts(year, date2.month, date2.day, date2.hour, date2.minute, date2.second, date2.millisecond);
}
function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
let date2 = /* @__PURE__ */ new Date();
date2.setUTCHours(hour, minute, second, millisecond);
date2.setUTCFullYear(year, month - 1, day);
return date2.getTime();
}
function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
if (timeZone === "UTC") return 0;
if (ms > 0 && timeZone === $14e0f24ef4ac5c92$export$aa8b41735afcabd2()) return new Date(ms).getTimezoneOffset() * -6e4;
let { year, month, day, hour, minute, second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
return utc - Math.floor(ms / 1e3) * 1e3;
}
const $11d87f3f76e88657$var$formattersByTimeZone = /* @__PURE__ */ new Map();
function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
if (!formatter) {
formatter = new Intl.DateTimeFormat("en-US", {
timeZone,
hour12: false,
era: "short",
year: "numeric",
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric"
});
$11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
}
let parts = formatter.formatToParts(new Date(ms));
let namedParts = {};
for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value;
return {
// Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
month: +namedParts.month,
day: +namedParts.day,
hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
minute: +namedParts.minute,
second: +namedParts.second
};
}
const $11d87f3f76e88657$var$DAYMILLIS = 864e5;
function $11d87f3f76e88657$var$getValidWallTimes(date2, timeZone, earlier, later) {
let found = earlier === later ? [
earlier
] : [
earlier,
later
];
return found.filter((absolute) => $11d87f3f76e88657$var$isValidWallTime(date2, timeZone, absolute));
}
function $11d87f3f76e88657$var$isValidWallTime(date2, timeZone, absolute) {
let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
return date2.year === parts.year && date2.month === parts.month && date2.day === parts.day && date2.hour === parts.hour && date2.minute === parts.minute && date2.second === parts.second;
}
function $11d87f3f76e88657$export$5107c82f94518f5c(date2, timeZone, disambiguation = "compatible") {
let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date2);
if (timeZone === "UTC") return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
if (timeZone === $14e0f24ef4ac5c92$export$aa8b41735afcabd2() && disambiguation === "compatible") {
dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
let date3 = /* @__PURE__ */ new Date();
let year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(dateTime.era, dateTime.year);
date3.setFullYear(year, dateTime.month - 1, dateTime.day);
date3.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
return date3.getTime();
}
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
if (valid.length === 1) return valid[0];
if (valid.length > 1) switch (disambiguation) {
case "compatible":
case "earlier":
return valid[0];
case "later":
return valid[valid.length - 1];
case "reject":
throw new RangeError("Multiple possible absolute times found");
}
switch (disambiguation) {
case "earlier":
return Math.min(ms - offsetBefore, ms - offsetAfter);
case "compatible":
case "later":
return Math.max(ms - offsetBefore, ms - offsetAfter);
case "reject":
throw new RangeError("No such absolute time found");
}
}
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
}
function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
let date2 = new Date(ms + offset);
let year = date2.getUTCFullYear();
let month = date2.getUTCMonth() + 1;
let day = date2.getUTCDate();
let hour = date2.getUTCHours();
let minute = date2.getUTCMinutes();
let second = date2.getUTCSeconds();
let millisecond = date2.getUTCMilliseconds();
return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(year, month, day, timeZone, offset, hour, minute, second, millisecond);
}
function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
}
function $11d87f3f76e88657$export$b21e0b124e224484(date2, time) {
let hour = 0, minute = 0, second = 0, millisecond = 0;
if ("timeZone" in date2) ({ hour, minute, second, millisecond } = date2);
else if ("hour" in date2 && !time) return date2;
if (time) ({ hour, minute, second, millisecond } = time);
return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(date2.calendar, date2.era, date2.year, date2.month, date2.day, hour, minute, second, millisecond);
}
function $11d87f3f76e88657$export$b4a036af3fc0b032(date2, calendar) {
if (date2.calendar.identifier === calendar.identifier) return date2;
let calendarDate = calendar.fromJulianDay(date2.calendar.toJulianDay(date2));
let copy = date2.copy();
copy.calendar = calendar;
copy.era = calendarDate.era;
copy.year = calendarDate.year;
copy.month = calendarDate.month;
copy.day = calendarDate.day;
$735220c2d4774dd3$export$c4e2ecac49351ef2(copy);
return copy;
}
function $11d87f3f76e88657$export$84c95a83c799e074(date2, timeZone, disambiguation) {
if (date2 instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea) {
if (date2.timeZone === timeZone) return date2;
return $11d87f3f76e88657$export$538b00033cc11c75(date2, timeZone);
}
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date2, timeZone, disambiguation);
return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
}
function $11d87f3f76e88657$export$83aac07b4c37b25(date2) {
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date2) - date2.offset;
return new Date(ms);
}
function $11d87f3f76e88657$export$538b00033cc11c75(date2, timeZone) {
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date2) - date2.offset;
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date2.calendar);
}
const $735220c2d4774dd3$var$ONE_HOUR = 36e5;
function $735220c2d4774dd3$export$e16d8520af44a096(date2, duration) {
let mutableDate = date2.copy();
let days = "hour" in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
$735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);
if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date2);
mutableDate.month += duration.months || 0;
$735220c2d4774dd3$var$balanceYearMonth(mutableDate);
$735220c2d4774dd3$var$constrainMonthDay(mutableDate);
mutableDate.day += (duration.weeks || 0) * 7;
mutableDate.day += duration.days || 0;
mutableDate.day += days;
$735220c2d4774dd3$var$balanceDay(mutableDate);
if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
if (mutableDate.year < 1) {
mutableDate.year = 1;
mutableDate.month = 1;
mutableDate.day = 1;
}
let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
if (mutableDate.year > maxYear) {
var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
let isInverseEra = (_mutableDate_calendar_isInverseEra = (_mutableDate_calendar = mutableDate.calendar).isInverseEra) === null || _mutableDate_calendar_isInverseEra === void 0 ? void 0 : _mutableDate_calendar_isInverseEra.call(_mutableDate_calendar, mutableDate);
mutableDate.year = maxYear;
mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
}
if (mutableDate.month < 1) {
mutableDate.month = 1;
mutableDate.day = 1;
}
let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
if (mutableDate.month > maxMonth) {
mutableDate.month = maxMonth;
mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
}
mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
return mutableDate;
}
function $735220c2d4774dd3$var$addYears(date2, years) {
var _date_calendar_isInverseEra, _date_calendar;
if ((_date_calendar_isInverseEra = (_date_calendar = date2.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date2)) years = -years;
date2.year += years;
}
function $735220c2d4774dd3$var$balanceYearMonth(date2) {
while (date2.month < 1) {
$735220c2d4774dd3$var$addYears(date2, -1);
date2.month += date2.calendar.getMonthsInYear(date2);
}
let monthsInYear = 0;
while (date2.month > (monthsInYear = date2.calendar.getMonthsInYear(date2))) {
date2.month -= monthsInYear;
$735220c2d4774dd3$var$addYears(date2, 1);
}
}
function $735220c2d4774dd3$var$balanceDay(date2) {
while (date2.day < 1) {
date2.month--;
$735220c2d4774dd3$var$balanceYearMonth(date2);
date2.day += date2.calendar.getDaysInMonth(date2);
}
while (date2.day > date2.calendar.getDaysInMonth(date2)) {
date2.day -= date2.calendar.getDaysInMonth(date2);
date2.month++;
$735220c2d4774dd3$var$balanceYearMonth(date2);
}
}
function $735220c2d4774dd3$var$constrainMonthDay(date2) {
date2.month = Math.max(1, Math.min(date2.calendar.getMonthsInYear(date2), date2.month));
date2.day = Math.max(1, Math.min(date2.calendar.getDaysInMonth(date2), date2.day));
}
function $735220c2d4774dd3$export$c4e2ecac49351ef2(date2) {
if (date2.calendar.constrainDate) date2.calendar.constrainDate(date2);
date2.year = Math.max(1, Math.min(date2.calendar.getYearsInEra(date2), date2.year));
$735220c2d4774dd3$var$constrainMonthDay(date2);
}
function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
let inverseDuration = {};
for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
return inverseDuration;
}
function $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date2, duration) {
return $735220c2d4774dd3$export$e16d8520af44a096(date2, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
}
function $735220c2d4774dd3$export$adaa4cf7ef1b65be(date2, fields) {
let mutableDate = date2.copy();
if (fields.era != null) mutableDate.era = fields.era;
if (fields.year != null) mutableDate.year = fields.year;
if (fields.month != null) mutableDate.month = fields.month;
if (fields.day != null) mutableDate.day = fields.day;
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);
return mutableDate;
}
function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
let mutableValue = value.copy();
if (fields.hour != null) mutableValue.hour = fields.hour;
if (fields.minute != null) mutableValue.minute = fields.minute;
if (fields.second != null) mutableValue.second = fields.second;
if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
$735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
return mutableValue;
}
function $735220c2d4774dd3$var$balanceTime(time) {
time.second += Math.floor(time.millisecond / 1e3);
time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1e3);
time.minute += Math.floor(time.second / 60);
time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
time.hour += Math.floor(time.minute / 60);
time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
let days = Math.floor(time.hour / 24);
time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
return days;
}
function $735220c2d4774dd3$export$7555de1e070510cb(time) {
time.millisecond = Math.max(0, Math.min(time.millisecond, 1e3));
time.second = Math.max(0, Math.min(time.second, 59));
time.minute = Math.max(0, Math.min(time.minute, 59));
time.hour = Math.max(0, Math.min(time.hour, 23));
}
function $735220c2d4774dd3$var$nonNegativeMod(a2, b) {
let result = a2 % b;
if (result < 0) result += b;
return result;
}
function $735220c2d4774dd3$var$addTimeFields(time, duration) {
time.hour += duration.hours || 0;
time.minute += duration.minutes || 0;
time.second += duration.seconds || 0;
time.millisecond += duration.milliseconds || 0;
return $735220c2d4774dd3$var$balanceTime(time);
}
function $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {
let mutable = value.copy();
switch (field) {
case "era": {
let eras = value.calendar.getEras();
let eraIndex = eras.indexOf(value.era);
if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
mutable.era = eras[eraIndex];
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
break;
}
case "year":
var _mutable_calendar_isInverseEra, _mutable_calendar;
if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable)) amount = -amount;
mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
if (mutable.year === -Infinity) mutable.year = 1;
if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
break;
case "month":
mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
break;
case "day":
mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
break;
default:
throw new Error("Unsupported field " + field);
}
if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
return mutable;
}
function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
let mutable = value.copy();
switch (field) {
case "hour": {
let hours = value.hour;
let min = 0;
let max = 23;
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
let isPM = hours >= 12;
min = isPM ? 12 : 0;
max = isPM ? 23 : 11;
}
mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
break;
}
case "minute":
mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
break;
case "second":
mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
break;
case "millisecond":
mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
break;
default:
throw new Error("Unsupported field " + field);
}
return mutable;
}
function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
if (round) {
value += Math.sign(amount);
if (value < min) value = max;
let div = Math.abs(amount);
if (amount > 0) value = Math.ceil(value / div) * div;
else value = Math.floor(value / div) * div;
if (value > max) value = min;
} else {
value += amount;
if (value < min) value = max - (min - value - 1);
else if (value > max) value = min + (value - max - 1);
}
return value;
}
function $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {
let ms;
if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {
let res2 = $735220c2d4774dd3$export$e16d8520af44a096($11d87f3f76e88657$export$b21e0b124e224484(dateTime), {
years: duration.years,
months: duration.months,
weeks: duration.weeks,
days: duration.days
});
ms = $11d87f3f76e88657$export$5107c82f94518f5c(res2, dateTime.timeZone);
} else
ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
ms += duration.milliseconds || 0;
ms += (duration.seconds || 0) * 1e3;
ms += (duration.minutes || 0) * 6e4;
ms += (duration.hours || 0) * 36e5;
let res = $11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone);
return $11d87f3f76e88657$export$b4a036af3fc0b032(res, dateTime.calendar);
}
function $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {
return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
}
function $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {
switch (field) {
case "hour": {
let min = 0;
let max = 23;
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
let isPM = dateTime.hour >= 12;
min = isPM ? 12 : 0;
max = isPM ? 23 : 11;
}
let plainDateTime = $11d87f3f76e88657$export$b21e0b124e224484(dateTime);
let minDate = $11d87f3f76e88657$export$b4a036af3fc0b032($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
hour: min
}), new $3b62074eb05584b2$export$80ee6245ec4f29ec());
let minAbsolute = [
$11d87f3f76e88657$export$5107c82f94518f5c(minDate, dateTime.timeZone, "earlier"),
$11d87f3f76e88657$export$5107c82f94518f5c(minDate, dateTime.timeZone, "later")
].filter((ms2) => $11d87f3f76e88657$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === minDate.day)[0];
let maxDate = $11d87f3f76e88657$export$b4a036af3fc0b032($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
hour: max
}), new $3b62074eb05584b2$export$80ee6245ec4f29ec());
let maxAbsolute = [
$11d87f3f76e88657$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "earlier"),
$11d87f3f76e88657$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "later")
].filter((ms2) => $11d87f3f76e88657$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === maxDate.day).pop();
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);
let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;
ms = $735220c2d4774dd3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $735220c2d4774dd3$var$ONE_HOUR), Math.floor(maxAbsolute / $735220c2d4774dd3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $735220c2d4774dd3$var$ONE_HOUR + remainder;
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
}
case "minute":
case "second":
case "millisecond":
return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
case "era":
case "year":
case "month":
case "day": {
let res = $735220c2d4774dd3$export$d52ced6badfb9a4c($11d87f3f76e88657$export$b21e0b124e224484(dateTime), field, amount, options);
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(res, dateTime.timeZone);
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
}
default:
throw new Error("Unsupported field " + field);
}
}
function $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
let plainDateTime = $11d87f3f76e88657$export$b21e0b124e224484(dateTime);
let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
if (res.compare(plainDateTime) === 0) return dateTime;
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(res, dateTime.timeZone, disambiguation);
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
}
const $fae977aafc393c5c$var$ABSOLUTE_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
function $fae977aafc393c5c$export$5adfdab05168c219(value, timeZone) {
let m = value.match($fae977aafc393c5c$var$ABSOLUTE_RE);
if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
let date2 = new $35ea8db9cb2ccb90$export$d3b7288e7994edea($fae977aafc393c5c$var$parseNumber(m[1], 1, 9999), $fae977aafc393c5c$var$parseNumber(m[2], 1, 12), 1, timeZone, 0, m[4] ? $fae977aafc393c5c$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $fae977aafc393c5c$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $fae977aafc393c5c$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $fae977aafc393c5c$var$parseNumber(m[7], 0, Infinity) * 1e3 : 0);
date2.day = $fae977aafc393c5c$var$parseNumber(m[3], 0, date2.calendar.getDaysInMonth(date2));
var _m_;
if (m[8]) date2.offset = $fae977aafc393c5c$var$parseNumber(m[8], -23, 23) * 36e5 + $fae977aafc393c5c$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 6e4;
return $11d87f3f76e88657$export$538b00033cc11c75(date2, timeZone);
}
function $fae977aafc393c5c$var$parseNumber(value, min, max) {
let val = Number(value);
if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
return val;
}
function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
}
function $fae977aafc393c5c$export$60dfd74aa96791bd(date2) {
let gregorianDate = $11d87f3f76e88657$export$b4a036af3fc0b032(date2, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
return `${String(gregorianDate.year).padStart(4, "0")}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
}
function $fae977aafc393c5c$export$4223de14708adc63(date2) {
return `${$fae977aafc393c5c$export$60dfd74aa96791bd(date2)}T${$fae977aafc393c5c$export$f59dee82248f5ad4(date2)}`;
}
function $fae977aafc393c5c$var$offsetToString(offset) {
let sign = Math.sign(offset) < 0 ? "-" : "+";
offset = Math.abs(offset);
let offsetHours = Math.floor(offset / 36e5);
let offsetMinutes = offset % 36e5 / 6e4;
return `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMinutes).padStart(2, "0")}`;
}
function $fae977aafc393c5c$export$bf79f1ebf4b18792(date2) {
return `${$fae977aafc393c5c$export$4223de14708adc63(date2)}${$fae977aafc393c5c$var$offsetToString(date2.offset)}[${date2.timeZone}]`;
}
function _check_private_redeclaration(obj, privateCollection) {
if (privateCollection.has(obj)) {
throw new TypeError("Cannot initialize the same private elements twice on an object");
}
}
function _class_private_field_init(obj, privateMap, value) {
_check_private_redeclaration(obj, privateMap);
privateMap.set(obj, value);
}
function $35ea8db9cb2ccb90$var$shiftArgs(args) {
let calendar = typeof args[0] === "object" ? args.shift() : new $3b62074eb05584b2$export$80ee6245ec4f29ec();
let era;
if (typeof args[0] === "string") era = args.shift();
else {
let eras = calendar.getEras();
era = eras[eras.length - 1];
}
let year = args.shift();
let month = args.shift();
let day = args.shift();
return [
calendar,
era,
year,
month,
day
];
}
var $35ea8db9cb2ccb90$var$_type = /* @__PURE__ */ new WeakMap();
class $35ea8db9cb2ccb90$export$99faa760c7908e4f {
/** Returns a copy of this date. */
copy() {
if (this.era) return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
else return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
}
/** Returns a new `CalendarDate` with the given duration added to it. */
add(duration) {
return $735220c2d4774dd3$export$e16d8520af44a096(this, duration);
}
/** Returns a new `CalendarDate` with the given duration subtracted from it. */
subtract(duration) {
return $735220c2d4774dd3$export$4e2d2ead65e5f7e3(this, duration);
}
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
set(fields) {
return $735220c2d4774dd3$export$adaa4cf7ef1b65be(this, fields);
}
/**
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
* When the resulting value reaches the limits of the field, it wraps around.
*/
cycle(field, amount, options) {
return $735220c2d4774dd3$export$d52ced6badfb9a4c(this, field, amount, options);
}
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
toDate(timeZone) {
return $11d87f3f76e88657$export$e67a095c620b86fe(this, timeZone);
}
/** Converts the date to an ISO 8601 formatted string. */
toString() {
return $fae977aafc393c5c$export$60dfd74aa96791bd(this);
}
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
compare(b) {
return $14e0f24ef4ac5c92$export$68781ddf31c0090f(this, b);
}
constructor(...args) {
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type, {
writable: true,
value: void 0
});
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
this.calendar = calendar;
this.era = era;
this.year = year;
this.month = month;
this.day = day;
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
}
}
var $35ea8db9cb2ccb90$var$_type2 = /* @__PURE__ */ new WeakMap();
class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
/** Returns a copy of this date. */
copy() {
if (this.era) return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
else return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
}
/** Returns a new `CalendarDateTime` with the given duration added to it. */
add(duration) {
return $735220c2d4774dd3$export$e16d8520af44a096(this, duration);
}
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
subtract(duration) {
return $735220c2d4774dd3$export$4e2d2ead65e5f7e3(this, duration);
}
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
set(fields) {
return $735220c2d4774dd3$export$adaa4cf7ef1b65be($735220c2d4774dd3$export$e5d5e1c1822b6e56(this, fields), fields);
}
/**
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
* When the resulting value reaches the limits of the field, it wraps around.
*/
cycle(field, amount, options) {
switch (field) {
case "era":
case "year":
case "month":
case "day":
return $735220c2d4774dd3$export$d52ced6badfb9a4c(this, field, amount, options);
default:
return $735220c2d4774dd3$export$dd02b3e0007dfe28(this, field, amount, options);
}
}
/** Converts the date to a native JavaScript Date object in the given time zone. */
toDate(timeZone, disambiguation) {
return $11d87f3f76e88657$export$e67a095c620b86fe(this, timeZone, disambiguation);
}
/** Converts the date to an ISO 8601 formatted string. */
toString() {
return $fae977aafc393c5c$export$4223de14708adc63(this);
}
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
compare(b) {
let res = $14e0f24ef4ac5c92$export$68781ddf31c0090f(this, b);
if (res === 0) return $14e0f24ef4ac5c92$export$c19a80a9721b80f6(this, $11d87f3f76e88657$export$b21e0b124e224484(b));
return res;
}
constructor(...args) {
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type2, {
writable: true,
value: void 0
});
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
this.calendar = calendar;
this.era = era;
this.year = year;
this.month = month;
this.day = day;
this.hour = args.shift() || 0;
this.minute = args.shift() || 0;
this.second = args.shift() || 0;
this.millisecond = args.shift() || 0;
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
}
}
var $35ea8db9cb2ccb90$var$_type3 = /* @__PURE__ */ new WeakMap();
class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
/** Returns a copy of this date. */
copy() {
if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
}
/** Returns a new `ZonedDateTime` with the given duration added to it. */
add(duration) {
return $735220c2d4774dd3$export$96b1d28349274637(this, duration);
}
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
subtract(duration) {
return $735220c2d4774dd3$export$6814caac34ca03c7(this, duration);
}
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
set(fields, disambiguation) {
return $735220c2d4774dd3$export$31b5430eb18be4f8(this, fields, disambiguation);
}
/**
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
* When the resulting value reaches the limits of the field, it wraps around.
*/
cycle(field, amount, options) {
return $735220c2d4774dd3$export$9a297d111fc86b79(this, field, amount, options);
}
/** Converts the date to a native JavaScript Date object. */
toDate() {
return $11d87f3f76e88657$export$83aac07b4c37b25(this);
}
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */
toString() {
return $fae977aafc393c5c$export$bf79f1ebf4b18792(this);
}
/** Converts the date to an ISO 8601 formatted string in UTC. */
toAbsoluteString() {
return this.toDate().toISOString();
}
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
compare(b) {
return this.toDate().getTime() - $11d87f3f76e88657$export$84c95a83c799e074(b, this.timeZone).toDate().getTime();
}
constructor(...args) {
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type3, {
writable: true,
value: void 0
});
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
let timeZone = args.shift();
let offset = args.shift();
this.calendar = calendar;
this.era = era;
this.year = year;
this.month = month;
this.day = day;
this.timeZone = timeZone;
this.offset = offset;
this.hour = args.shift() || 0;
this.minute = args.shift() || 0;
this.second = args.shift() || 0;
this.millisecond = args.shift() || 0;
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
}
}
const [Provider, useHistory] = createContext("History", {
history: [],
currentLocationIndex: 0,
currentLocation: "",
canGoBack: false,
pushState: () => {
throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
},
goBack: () => {
throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
}
});
const BackButton = React.forwardRef(
({ disabled, fallback = "" }, ref) => {
const { formatMessage } = useIntl();
const navigate = useNavigate();
const canGoBack = useHistory("BackButton", (state) => state.canGoBack);
const goBack = useHistory("BackButton", (state) => state.goBack);
const history = useHistory("BackButton", (state) => state.history);
const hasFallback = fallback !== "";
const shouldBeDisabled = disabled || !canGoBack && !hasFallback;
const handleClick = (e) => {
e.preventDefault();
if (canGoBack) {
goBack();
} else if (hasFallback) {
navigate(fallback);
}
};
const historyTo = canGoBack ? history.at(-1) : void 0;
const toWithFallback = historyTo ?? fallback;
return /* @__PURE__ */ jsx(
Link,
{
ref,
tag: NavLink,
to: toWithFallback,
onClick: handleClick,
disabled: shouldBeDisabled,
"aria-disabled": shouldBeDisabled,
startIcon: /* @__PURE__ */ jsx(ForwardRef$55, {}),
children: formatMessage({
id: "global.back",
defaultMessage: "Back"
})
}
);
}
);
new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false
}
}
});
const useClipboard = () => {
const copy = useCallback(async (value) => {
try {
if (typeof value !== "string" && typeof value !== "number") {
throw new Error(
`Cannot copy typeof ${typeof value} to clipboard, must be a string or number`
);
} else if (value === "") {
throw new Error(`Cannot copy empty string to clipboard.`);
}
const stringifiedValue = value.toString();
await navigator.clipboard.writeText(stringifiedValue);
return true;
} catch (error) {
if (process.env.NODE_ENV === "development") {
console.warn("Copy failed", error);
}
return false;
}
}, []);
return { copy };
};
styled$1(Alert)`
& > div:first-child {
display: none;
}
& > button {
display: none;
}
`;
styled$1(Typography)`
word-break: break-all;
color: ${({ theme }) => theme.colors.danger600};
`;
const ActionLayout = ({ startActions, endActions }) => {
if (!startActions && !endActions) {
return null;
}
return /* @__PURE__ */ jsxs(
Flex,
{
justifyContent: "space-between",
alignItems: "flex-start",
paddingBottom: 4,
paddingLeft: 10,
paddingRight: 10,
children: [
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
/* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
]
}
);
};
const ContentLayout = ({ children }) => {
return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
};
const GridColSize = {
S: 180,
M: 250
};
const StyledGrid = styled$1(Box)`
display: grid;
grid-template-columns: repeat(
auto-fit,
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
);
grid-gap: ${({ theme }) => theme.spaces[4]};
`;
const GridLayout = ({ size, children }) => {
return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
};
const BaseHeaderLayout = React.forwardRef(
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
const isSubtitleString = typeof subtitle === "string";
if (sticky) {
return /* @__PURE__ */ jsx(
Box,
{
paddingLeft: 6,
paddingRight: 6,
paddingTop: 3,
paddingBottom: 3,
position: "fixed",
top: 0,
right: 0,
background: "neutral0",
shadow: "tableShadow",
width: `${width}px`,
zIndex: 1,
"data-strapi-header-sticky": true,
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
/* @__PURE__ */ jsxs(Flex, { children: [
navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
/* @__PURE__ */ jsxs(Box, { children: [
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
] }),
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
] }),
/* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
] })
}
);
}
return /* @__PURE__ */ jsxs(
Box,
{
ref,
paddingLeft: 10,
paddingRight: 10,
paddingBottom: 8,
paddingTop: navigationAction ? 6 : 8,
background: "neutral100",
"data-strapi-header": true,
children: [
navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
/* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
/* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
] }),
primaryAction
] }),
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
]
}
);
}
);
const HeaderLayout = (props) => {
const baseHeaderLayoutRef = React.useRef(null);
const [headerSize, setHeaderSize] = React.useState(null);
const [containerRef, isVisible] = useElementOnScreen({
root: null,
rootMargin: "0px",
threshold: 0
});
useResizeObserver(containerRef, () => {
if (containerRef.current) {
setHeaderSize(containerRef.current.getBoundingClientRect());
}
});
React.useEffect(() => {
if (baseHeaderLayoutRef.current) {
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
}
}, [baseHeaderLayoutRef]);
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
!isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
] });
};
HeaderLayout.displayName = "HeaderLayout";
const useElementOnScreen = (options) => {
const containerRef = React.useRef(null);
const [isVisible, setIsVisible] = React.useState(true);
const callback = ([entry]) => {
setIsVisible(entry.isIntersecting);
};
React.useEffect(() => {
const containerEl = containerRef.current;
const observer = new IntersectionObserver(callback, options);
if (containerEl) {
observer.observe(containerRef.current);
}
return () => {
if (containerEl) {
observer.disconnect();
}
};
}, [containerRef, options]);
return [containerRef, isVisible];
};
const useResizeObserver = (sources, onResize) => {
const handleResize = useCallbackRef(onResize);
React.useLayoutEffect(() => {
const resizeObs = new ResizeObserver(handleResize);
if (Array.isArray(sources)) {
sources.forEach((source) => {
if (source.current) {
resizeObs.observe(source.current);
}
});
} else if (sources.current) {
resizeObs.observe(sources.current);
}
return () => {
resizeObs.disconnect();
};
}, [sources, handleResize]);
};
const GridContainer = styled$1(Box)`
display: grid;
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
`;
const OverflowingItem = styled$1(Box)`
overflow-x: hidden;
`;
const RootLayout = ({ sideNav, children }) => {
return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
sideNav,
/* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
] });
};
const Layouts = {
Root: RootLayout,
Header: HeaderLayout,
BaseHeader: BaseHeaderLayout,
Grid: GridLayout,
Action: ActionLayout,
Content: ContentLayout
};
const ERR_MSG = "The Form Component has not been initialised, ensure you are using this hook within a Form component";
const [FormProvider, useForm] = createContext("Form", {
disabled: false,
errors: {},
initialValues: {},
isSubmitting: false,
modified: false,
addFieldRow: () => {
throw new Error(ERR_MSG);
},
moveFieldRow: () => {
throw new Error(ERR_MSG);
},
onChange: () => {
throw new Error(ERR_MSG);
},
removeFieldRow: () => {
throw new Error(ERR_MSG);
},
resetForm: () => {
throw new Error(ERR_MSG);
},
setErrors: () => {
throw new Error(ERR_MSG);
},
setValues: () => {
throw new Error(ERR_MSG);
},
setSubmitting: () => {
throw new Error(ERR_MSG);
},
validate: async () => {
throw new Error(ERR_MSG);
},
values: {}
});
const Form = React.forwardRef(
({ disabled = false, method, onSubmit, initialErrors, ...props }, ref) => {
const formRef = React.useRef(null);
const initialValues = React.useRef(props.initialValues ?? {});
const [state, dispatch] = React.useReducer(reducer, {
errors: initialErrors ?? {},
isSubmitting: false,
values: props.initialValues ?? {}
});
React.useEffect(() => {
if (!isEqual(initialValues.current, props.initialValues)) {
initialValues.current = props.initialValues ?? {};
dispatch({
type: "SET_INITIAL_VALUES",
payload: props.initialValues ?? {}
});
}
}, [props.initialValues]);
const setErrors = React.useCallback((errors) => {
dispatch({
type: "SET_ERRORS",
payload: errors
});
}, []);
const setValues = React.useCallback((values) => {
dispatch({
type: "SET_VALUES",
payload: values
});
}, []);
React.useEffect(() => {
if (Object.keys(state.errors).length === 0)
return;
const ref2 = setTimeout(() => {
const [firstError] = formRef.current.querySelectorAll("[data-strapi-field-error]");
if (firstError) {
const errorId = firstError.getAttribute("id");
const formElementInError = formRef.current.querySelector(
`[aria-describedby="${errorId}"]`
);
if (formElementInError && formElementInError instanceof HTMLElement) {
formElementInError.focus();
}
}
});
return () => clearTimeout(ref2);
}, [state.errors]);
const validate = React.useCallback(
async (shouldSetErrors = true, options = {}) => {
setErrors({});
if (!props.validationSchema && !props.validate) {
return { data: state.values };
}
try {
let data;
if (props.validationSchema) {
data = await props.validationSchema.validate(state.values, { abortEarly: false });
} else if (props.validate) {
data = await props.validate(state.values, options);
} else {
throw new Error("No validation schema or validate function provided");
}
return { data };
} catch (err) {
if (isErrorYupValidationError(err)) {
const errors = getYupValidationErrors(err);
if (shouldSetErrors) {
setErrors(errors);
}
return { errors };
} else {
if (process.env.NODE_ENV !== "production") {
console.warn(
`Warning: An unhandled error was caught during validation in <Form validationSchema />`,
err
);
}
throw err;
}
}
},
[props, setErrors, state.values]
);
const handleSubmit = async (e) => {
e.stopPropagation();
e.preventDefault();
if (!onSubmit) {
return;
}
dispatch({
type: "SUBMIT_ATTEMPT"
});
try {
const { data, errors } = await validate();
if (errors) {
setErrors(errors);
throw new Error("Submission failed");
}
await onSubmit(data, {
setErrors,
setValues,
resetForm
});
dispatch({
type: "SUBMIT_SUCCESS"
});
} catch (err) {
dispatch({
type: "SUBMIT_FAILURE"
});
if (err instanceof Error && err.message === "Submission failed") {
return;
}
}
};
const modified = React.useMemo(
() => !isEqual(initialValues.current, state.values),
[state.values]
);
const handleChange = useCallbackRef((eventOrPath, v2) => {
if (typeof eventOrPath === "string") {
dispatch({
type: "SET_FIELD_VALUE",
payload: {
field: eventOrPath,
value: v2
}
});
return;
}
const target = eventOrPath.target || eventOrPath.currentTarget;
const { type, name, id, value, options, multiple } = target;
const field = name || id;
if (!field && process.env.NODE_ENV !== "production") {
console.warn(
`\`onChange\` was called with an event, but you forgot to pass a \`name\` or \`id'\` attribute to your input. The field to update cannot be determined`
);
}
let val;
if (/number|range/.test(type)) {
const parsed = parseFloat(value);
val = isNaN(parsed) ? "" : parsed;
} else if (/checkbox/.test(type)) {
val = !getIn$1(state.values, field);
} else if (options && multiple) {
val = Array.from(options).filter((el) => el.selected).map((el) => el.value);
} else {
if (value === "") {
val = null;
} else {
val = value;
}
}
if (field) {
dispatch({
type: "SET_FIELD_VALUE",
payload: {
field,
value: val
}
});
}
});
const addFieldRow = React.useCallback(
(field, value, addAtIndex) => {
dispatch({
type: "ADD_FIELD_ROW",
payload: {
field,
value,
addAtIndex
}
});
},
[]
);
const removeFieldRow = React.useCallback(
(field, removeAtIndex) => {
dispatch({
type: "REMOVE_FIELD_ROW",
payload: {
field,
removeAtIndex
}
});
},
[]
);
const moveFieldRow = React.useCallback(
(field, fromIndex, toIndex) => {
dispatch({
type: "MOVE_FIELD_ROW",
payload: {
field,
fromIndex,
toIndex
}
});
},
[]
);
const resetForm = React.useCallback(() => {
dispatch({
type: "RESET_FORM",
payload: {
errors: {},
isSubmitting: false,
values: initialValues.current
}
});
}, []);
const setSubmitting = React.useCallback((isSubmitting) => {
dispatch({ type: "SET_ISSUBMITTING", payload: isSubmitting });
}, []);
const composedRefs = useComposedRefs(formRef, ref);
return /* @__PURE__ */ jsx("form", { ref: composedRefs, method, noValidate: true, onSubmit: handleSubmit, children: /* @__PURE__ */ jsx(
FormProvider,
{
disabled,
onChange: handleChange,
initialValues: initialValues.current,
modified,
addFieldRow,
moveFieldRow,
removeFieldRow,
resetForm,
setErrors,
setValues,
setSubmitting,
validate,
...state,
children: typeof props.children === "function" ? props.children({
modified,
disabled,
onChange: handleChange,
...state,
setErrors,
resetForm
}) : props.children
}
) });
}
);
const isErrorYupValidationError = (err) => typeof err === "object" && err !== null && "name" in err && typeof err.name === "string" && err.name === "ValidationError";
const getYupValidationErrors = (err) => {
let errors = {};
if (err.inner) {
if (err.inner.length === 0) {
return setIn(errors, err.path, err.message);
}
for (const error of err.inner) {
if (!getIn$1(errors, error.path)) {
errors = setIn(errors, error.path, error.message);
}
}
}
return errors;
};
const reducer = (state, action) => produce(state, (draft) => {
switch (action.type) {
case "SET_INITIAL_VALUES":
draft.values = action.payload;
break;
case "SET_VALUES":
draft.values = action.payload;
break;
case "SUBMIT_ATTEMPT":
draft.isSubmitting = true;
break;
case "SUBMIT_FAILURE":
draft.isSubmitting = false;
break;
case "SUBMIT_SUCCESS":
draft.isSubmitting = false;
break;
case "SET_FIELD_VALUE":
draft.values = setIn(state.values, action.payload.field, action.payload.value);
break;
case "ADD_FIELD_ROW": {
const currentField = getIn$1(state.values, action.payload.field, []);
let position = action.payload.addAtIndex;
if (position === void 0) {
position = currentField.length;
} else if (position < 0) {
position = 0;
}
const [key] = generateNKeysBetween(
currentField.at(position - 1)?.__temp_key__,
currentField.at(position)?.__temp_key__,
1
);
draft.values = setIn(
state.values,
action.payload.field,
setIn(currentField, position.toString(), { ...action.payload.value, __temp_key__: key })
);
break;
}
case "MOVE_FIELD_ROW": {
const { field, fromIndex, toIndex } = action.payload;
const currentField = [...getIn$1(state.values, field, [])];
const currentRow = currentField[fromIndex];
const startKey = fromIndex > toIndex ? currentField[toIndex - 1]?.__temp_key__ : currentField[toIndex]?.__temp_key__;
const endKey = fromIndex > toIndex ? currentField[toIndex]?.__temp_key__ : currentField[toIndex + 1]?.__temp_key__;
const [newKey] = generateNKeysBetween(startKey, endKey, 1);
currentField.splice(fromIndex, 1);
currentField.splice(toIndex, 0, { ...currentRow, __temp_key__: newKey });
draft.values = setIn(state.values, field, currentField);
break;
}
case "REMOVE_FIELD_ROW": {
const currentField = getIn$1(state.values, action.payload.field, []);
let position = action.payload.removeAtIndex;
if (position === void 0) {
position = currentField.length - 1;
} else if (position < 0) {
position = 0;
}
const newValue = setIn(currentField, position.toString(), void 0).filter(
(val) => val
);
draft.values = setIn(
state.values,
action.payload.field,
newValue.length > 0 ? newValue : []
);
break;
}
case "SET_ERRORS":
if (!isEqual(state.errors, action.payload)) {
draft.errors = action.payload;
}
break;
case "SET_ISSUBMITTING":
draft.isSubmitting = action.payload;
break;
case "RESET_FORM":
draft.values = action.payload.values;
draft.errors = action.payload.errors;
draft.isSubmitting = action.payload.isSubmitting;
break;
}
});
const useField = (path) => {
const { formatMessage } = useIntl();
const initialValue = useForm(
"useField",
(state) => getIn$1(state.initialValues, path)
);
const value = useForm(
"useField",
(state) => getIn$1(state.values, path)
);
const handleChange = useForm("useField", (state) => state.onChange);
const rawError = useForm("useField", (state) => getIn$1(state.errors, path));
const error = useForm("useField", (state) => {
const error2 = getIn$1(state.errors, path);
if (isErrorMessageDescriptor(error2)) {
const { values, ...message } = error2;
return formatMessage(message, values);
}
return error2;
});
return {
initialValue,
/**
* Errors can be a string, or a MessageDescriptor, so we need to handle both cases.
* If it's anything else, we don't return it.
*/
rawError,
error: isErrorMessageDescriptor(error) ? formatMessage(
{
id: error.id,
defaultMessage: error.defaultMessage
},
error.values
) : typeof error === "string" ? error : void 0,
onChange: handleChange,
value
};
};
const isErrorMessageDescriptor = (object2) => {
return typeof object2 === "object" && object2 !== null && !Array.isArray(object2) && "id" in object2 && "defaultMessage" in object2;
};
const Blocker = ({ onProceed = () => {
}, onCancel = () => {
} }) => {
const { formatMessage } = useIntl();
const modified = useForm("Blocker", (state) => state.modified);
const isSubmitting = useForm("Blocker", (state) => state.isSubmitting);
const blocker = useBlocker(({ currentLocation, nextLocation }) => {
return !isSubmitting && modified && (currentLocation.pathname !== nextLocation.pathname || currentLocation.search !== nextLocation.search);
});
if (blocker.state === "blocked") {
const handleCancel = (isOpen) => {
if (!isOpen) {
onCancel();
blocker.reset();
}
};
return /* @__PURE__ */ jsx(Dialog.Root, { open: true, onOpenChange: handleCancel, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
/* @__PURE__ */ jsx(Dialog.Header, { children: formatMessage({
id: "app.components.ConfirmDialog.title",
defaultMessage: "Confirmation"
}) }),
/* @__PURE__ */ jsx(Dialog.Body, { icon: /* @__PURE__ */ jsx(ForwardRef$3$1, { width: "24px", height: "24px", fill: "danger600" }), children: formatMessage({
id: "global.prompt.unsaved",
defaultMessage: "You have unsaved changes, are you sure you want to leave?"
}) }),
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", children: formatMessage({
id: "app.components.Button.cancel",
defaultMessage: "Cancel"
}) }) }),
/* @__PURE__ */ jsx(
Button,
{
onClick: () => {
onProceed();
blocker.proceed();
},
variant: "danger",
children: formatMessage({
id: "app.components.Button.confirm",
defaultMessage: "Confirm"
})
}
)
] })
] }) });
}
return null;
};
const useFocusInputField = (name) => {
const { search: searchString } = useLocation();
const search = useMemo(() => new URLSearchParams(searchString), [searchString]);
const [field, setField] = useState(null);
useEffect(() => {
if (search.has("field") && search.get("field") === name && field) {
field.focus();
field.scrollIntoView({
block: "center"
});
}
}, [search, name, field]);
return setField;
};
const BooleanInput = forwardRef(
({ name, required, label, hint, labelAction, ...props }, ref) => {
const { formatMessage } = useIntl();
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, maxWidth: "320px", children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
Toggle,
{
ref: composedRefs,
checked: field.value === null ? null : field.value || false,
offLabel: formatMessage({
id: "app.components.ToggleCheckbox.off-label",
defaultMessage: "False"
}),
onLabel: formatMessage({
id: "app.components.ToggleCheckbox.on-label",
defaultMessage: "True"
}),
onChange: field.onChange,
...props
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedBooleanInput = memo(BooleanInput);
const CheckboxInput = forwardRef(
({ name, required, label, hint, type: _type, ...props }, ref) => {
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(
Checkbox,
{
onCheckedChange: (checked) => field.onChange(name, !!checked),
ref: composedRefs,
checked: field.value,
...props,
children: label || props["aria-label"]
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedCheckboxInput = memo(CheckboxInput);
const DateInput = forwardRef(
({ name, required, label, hint, labelAction, type: _type, ...props }, ref) => {
const { formatMessage } = useIntl();
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
const value = typeof field.value === "string" ? new Date(field.value) : field.value;
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
DatePicker,
{
ref: composedRefs,
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
onChange: (date2) => {
field.onChange(name, date2 ? convertLocalDateToUTCDate(date2).toISOString() : null);
},
onClear: () => field.onChange(name, null),
value: value ? convertLocalDateToUTCDate(value) : value,
...props
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const convertLocalDateToUTCDate = (date2) => {
const utcDateString = date2.toISOString();
const timeZone = $14e0f24ef4ac5c92$export$aa8b41735afcabd2();
const zonedDateTime = $fae977aafc393c5c$export$5adfdab05168c219(utcDateString, timeZone);
return $11d87f3f76e88657$export$93522d1a439f3617(zonedDateTime).toDate("UTC");
};
const MemoizedDateInput = memo(DateInput);
const DateTimeInput = forwardRef(
({ name, required, label, hint, labelAction, ...props }, ref) => {
const { formatMessage } = useIntl();
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
const value = typeof field.value === "string" ? new Date(field.value) : field.value;
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
DateTimePicker,
{
ref: composedRefs,
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
onChange: (date2) => {
field.onChange(name, date2 ? date2.toISOString() : null);
},
onClear: () => field.onChange(name, null),
value,
...props
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedDateTimeInput = memo(DateTimeInput);
const EmailInput = forwardRef(
({ name, required, label, hint, labelAction, ...props }, ref) => {
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
TextInput,
{
ref: composedRefs,
autoComplete: "email",
onChange: field.onChange,
value: field.value,
...props,
type: "email"
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedEmailInput = memo(EmailInput);
const EnumerationInput = forwardRef(
({ name, required, label, hint, labelAction, options = [], ...props }, ref) => {
const { formatMessage } = useIntl();
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsxs(
SingleSelect,
{
ref: composedRefs,
onChange: (value) => {
field.onChange(name, value);
},
value: field.value,
...props,
children: [
/* @__PURE__ */ jsx(SingleSelectOption, { value: "", disabled: required, hidden: required, children: formatMessage({
id: "components.InputSelect.option.placeholder",
defaultMessage: "Choose here"
}) }),
options.map(({ value, label: label2, disabled, hidden }) => {
return /* @__PURE__ */ jsx(SingleSelectOption, { value, disabled, hidden, children: label2 ?? value }, value);
})
]
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedEnumerationInput = memo(EnumerationInput);
const JsonInput = React.forwardRef(
({ name, required, label, hint, labelAction, ...props }, ref) => {
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
JSONInput,
{
ref: composedRefs,
value: typeof field.value == "object" ? JSON.stringify(field.value, null, 2) : field.value,
onChange: (json) => {
const value = required && !json.length ? null : json;
field.onChange(name, value);
},
minHeight: `25.2rem`,
maxHeight: `50.4rem`,
...props
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedJsonInput = React.memo(JsonInput);
const NumberInputImpl = forwardRef(
({ name, required, label, hint, labelAction, type, ...props }, ref) => {
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
NumberInput,
{
ref: composedRefs,
onValueChange: (value) => {
field.onChange(name, value);
},
step: type === "float" || type == "decimal" ? 0.01 : 1,
value: field.value,
...props
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedNumberInput = memo(NumberInputImpl);
const PasswordInput = forwardRef(
({ name, required, label, hint, labelAction, ...props }, ref) => {
const [showPassword, setShowPassword] = useState(false);
const { formatMessage } = useIntl();
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
TextInput,
{
ref: composedRefs,
autoComplete: "password",
endAction: /* @__PURE__ */ jsx(
Field.Action,
{
label: formatMessage({
id: "Auth.form.password.show-password",
defaultMessage: "Show password"
}),
onClick: () => {
setShowPassword((prev) => !prev);
},
children: showPassword ? /* @__PURE__ */ jsx(ForwardRef$3x, { fill: "neutral500" }) : /* @__PURE__ */ jsx(ForwardRef$3v, { fill: "neutral500" })
}
),
onChange: field.onChange,
value: field.value,
...props,
type: showPassword ? "text" : "password"
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedPasswordInput = memo(PasswordInput);
const StringInput = forwardRef(
({ name, required, label, hint, labelAction, ...props }, ref) => {
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
TextInput,
{
ref: composedRefs,
onChange: field.onChange,
value: field.value ?? "",
...props
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedStringInput = memo(StringInput);
const TextareaInput = forwardRef(
({ name, required, label, hint, labelAction, ...props }, ref) => {
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
Textarea,
{
ref: composedRefs,
onChange: field.onChange,
value: field.value ?? "",
...props
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedTextareaInput = memo(TextareaInput);
const TimeInput = forwardRef(
({ name, required, label, hint, labelAction, ...props }, ref) => {
const { formatMessage } = useIntl();
const field = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
TimePicker,
{
ref: composedRefs,
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
onChange: (time) => {
field.onChange(name, `${time}:00.000`);
},
onClear: () => field.onChange(name, void 0),
value: field.value ?? "",
...props
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedTimeInput = memo(TimeInput);
const InputRenderer = memo(
forwardRef((props, forwardRef2) => {
switch (props.type) {
case "biginteger":
case "timestamp":
case "string":
case "uid":
return /* @__PURE__ */ jsx(MemoizedStringInput, { ref: forwardRef2, ...props });
case "boolean":
return /* @__PURE__ */ jsx(MemoizedBooleanInput, { ref: forwardRef2, ...props });
case "checkbox":
return /* @__PURE__ */ jsx(MemoizedCheckboxInput, { ref: forwardRef2, ...props });
case "datetime":
return /* @__PURE__ */ jsx(MemoizedDateTimeInput, { ref: forwardRef2, ...props });
case "date":
return /* @__PURE__ */ jsx(MemoizedDateInput, { ref: forwardRef2, ...props });
case "decimal":
case "float":
case "integer":
return /* @__PURE__ */ jsx(MemoizedNumberInput, { ref: forwardRef2, ...props });
case "json":
return /* @__PURE__ */ jsx(MemoizedJsonInput, { ref: forwardRef2, ...props });
case "email":
return /* @__PURE__ */ jsx(MemoizedEmailInput, { ref: forwardRef2, ...props });
case "enumeration":
return /* @__PURE__ */ jsx(MemoizedEnumerationInput, { ref: forwardRef2, ...props });
case "password":
return /* @__PURE__ */ jsx(MemoizedPasswordInput, { ref: forwardRef2, ...props });
case "text":
return /* @__PURE__ */ jsx(MemoizedTextareaInput, { ref: forwardRef2, ...props });
case "time":
return /* @__PURE__ */ jsx(MemoizedTimeInput, { ref: forwardRef2, ...props });
default:
return /* @__PURE__ */ jsx(NotSupportedField, { ref: forwardRef2, ...props });
}
})
);
const NotSupportedField = forwardRef(
({ label, hint, name, required, type, labelAction }, ref) => {
const { error } = useField(name);
const fieldRef = useFocusInputField(name);
const composedRefs = useComposedRefs(ref, fieldRef);
return /* @__PURE__ */ jsxs(Field.Root, { error, name, hint, required, children: [
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
/* @__PURE__ */ jsx(
TextInput,
{
ref: composedRefs,
disabled: true,
placeholder: `Unsupported field type: ${type}`,
required,
type: "text",
value: ""
}
),
/* @__PURE__ */ jsx(Field.Hint, {}),
/* @__PURE__ */ jsx(Field.Error, {})
] });
}
);
const MemoizedInputRenderer = memo(InputRenderer);
styled$1.img`
height: 7.2rem;
`;
styled$1(Box)`
margin: 0 auto;
width: 552px;
`;
styled$1(Flex)`
flex-direction: column;
`;
const errorsTrads = {
email: {
id: "components.Input.error.validation.email",
defaultMessage: "This is not a valid email."
},
json: {
id: "components.Input.error.validation.json",
defaultMessage: "This doesn't match the JSON format"
},
lowercase: {
id: "components.Input.error.validation.lowercase",
defaultMessage: "The value must be a lowercase string"
},
max: {
id: "components.Input.error.validation.max",
defaultMessage: "The value is too high (max: {max})."
},
maxLength: {
id: "components.Input.error.validation.maxLength",
defaultMessage: "The value is too long (max: {max})."
},
min: {
id: "components.Input.error.validation.min",
defaultMessage: "The value is too low (min: {min})."
},
minLength: {
id: "components.Input.error.validation.minLength",
defaultMessage: "The value is too short (min: {min})."
},
regex: {
id: "components.Input.error.validation.regex",
defaultMessage: "The value does not match the regex."
},
required: {
id: "components.Input.error.validation.required",
defaultMessage: "This value is required."
},
string: {
id: "components.Input.error.validation.string",
defaultMessage: "This is not a valid string."
},
unique: {
id: "components.Input.error.validation.unique",
defaultMessage: "This value is already used."
},
integer: {
id: "component.Input.error.validation.integer",
defaultMessage: "The value must be an integer"
}
};
create$2().shape({
email: create$4().nullable().email({
id: errorsTrads.email.id,
defaultMessage: "Not a valid email"
}).required(errorsTrads.required),
password: create$4().required(errorsTrads.required).nullable(),
rememberMe: create$5().nullable()
});
styled$1(Field.Root)`
height: 3.2rem;
width: 3.2rem;
> label,
~ input {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
> label {
color: inherit;
cursor: pointer;
padding: ${({ theme }) => theme.spaces[2]};
text-align: center;
vertical-align: middle;
}
&:hover,
&:focus-within {
background-color: ${({ theme }) => theme.colors.neutral0};
}
&:active,
&.selected {
color: ${({ theme }) => theme.colors.primary700};
background-color: ${({ theme }) => theme.colors.neutral0};
border-color: ${({ theme }) => theme.colors.primary700};
}
`;
[...Array(11).keys()];
create$2().shape({
firstname: create$4().trim().required(errorsTrads.required).nullable(),
lastname: create$4().nullable(),
password: create$4().min(8, {
id: errorsTrads.minLength.id,
defaultMessage: "Password must be at least 8 characters",
values: { min: 8 }
}).matches(/[a-z]/, {
message: {
id: "components.Input.error.contain.lowercase",
defaultMessage: "Password must contain at least 1 lowercase letter"
}
}).matches(/[A-Z]/, {
message: {
id: "components.Input.error.contain.uppercase",
defaultMessage: "Password must contain at least 1 uppercase letter"
}
}).matches(/\d/, {
message: {
id: "components.Input.error.contain.number",
defaultMessage: "Password must contain at least 1 number"
}
}).required({
id: errorsTrads.required.id,
defaultMessage: "Password is required"
}).nullable(),
confirmPassword: create$4().required({
id: errorsTrads.required.id,
defaultMessage: "Confirm password is required"
}).oneOf([create$7("password"), null], {
id: "components.Input.error.password.noMatch",
defaultMessage: "Passwords must match"
}).nullable(),
registrationToken: create$4().required({
id: errorsTrads.required.id,
defaultMessage: "Registration token is required"
})
});
create$2().shape({
firstname: create$4().trim().required({
id: errorsTrads.required.id,
defaultMessage: "Firstname is required"
}).nullable(),
lastname: create$4().nullable(),
password: create$4().min(8, {
id: errorsTrads.minLength.id,
defaultMessage: "Password must be at least 8 characters",
values: { min: 8 }
}).matches(/[a-z]/, {
message: {
id: "components.Input.error.contain.lowercase",
defaultMessage: "Password must contain at least 1 lowercase letter"
}
}).matches(/[A-Z]/, {
message: {
id: "components.Input.error.contain.uppercase",
defaultMessage: "Password must contain at least 1 uppercase letter"
}
}).matches(/\d/, {
message: {
id: "components.Input.error.contain.number",
defaultMessage: "Password must contain at least 1 number"
}
}).required({
id: errorsTrads.required.id,
defaultMessage: "Password is required"
}).nullable(),
confirmPassword: create$4().required({
id: errorsTrads.required,
defaultMessage: "Confirm password is required"
}).nullable().oneOf([create$7("password"), null], {
id: "components.Input.error.password.noMatch",
defaultMessage: "Passwords must match"
}),
email: create$4().email({
id: errorsTrads.email.id,
defaultMessage: "Not a valid email"
}).strict().lowercase({
id: errorsTrads.lowercase.id,
defaultMessage: "Email must be lowercase"
}).required({
id: errorsTrads.required.id,
defaultMessage: "Email is required"
}).nullable()
});
styled$1.a`
color: ${({ theme }) => theme.colors.primary600};
`;
create$2().shape({
password: create$4().min(8, {
id: errorsTrads.minLength.id,
defaultMessage: "Password must be at least 8 characters",
values: { min: 8 }
}).matches(/[a-z]/, {
message: {
id: "components.Input.error.contain.lowercase",
defaultMessage: "Password must contain at least 1 lowercase letter"
}
}).matches(/[A-Z]/, {
message: {
id: "components.Input.error.contain.uppercase",
defaultMessage: "Password must contain at least 1 uppercase letter"
}
}).matches(/\d/, {
message: {
id: "components.Input.error.contain.number",
defaultMessage: "Password must contain at least 1 number"
}
}).required({
id: errorsTrads.required.id,
defaultMessage: "Password is required"
}).nullable(),
confirmPassword: create$4().required({
id: errorsTrads.required.id,
defaultMessage: "Confirm password is required"
}).oneOf([create$7("password"), null], {
id: "components.Input.error.password.noMatch",
defaultMessage: "Passwords must match"
}).nullable()
});
({
[adminApi.reducerPath]: adminApi.reducer,
admin_app: reducer$1$1
});
const ConfirmDialog = ({
children,
icon = /* @__PURE__ */ jsx(StyledWarning, {}),
onConfirm,
variant = "danger-light",
startAction,
endAction,
title
}) => {
const { formatMessage } = useIntl();
const [isConfirming, setIsConfirming] = React.useState(false);
const content = children || formatMessage({
id: "app.confirm.body",
defaultMessage: "Are you sure?"
});
const handleConfirm = async (e) => {
if (!onConfirm) {
return;
}
try {
setIsConfirming(true);
await onConfirm(e);
} finally {
setIsConfirming(false);
}
};
return /* @__PURE__ */ jsxs(Dialog.Content, { children: [
/* @__PURE__ */ jsx(Dialog.Header, { children: title || formatMessage({
id: "app.components.ConfirmDialog.title",
defaultMessage: "Confirmation"
}) }),
/* @__PURE__ */ jsx(Dialog.Body, { icon, children: content }),
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
startAction || /* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(
Button,
{
fullWidth: true,
variant: "tertiary",
onClick: (e) => {
e.stopPropagation();
},
children: formatMessage({
id: "app.components.Button.cancel",
defaultMessage: "Cancel"
})
}
) }),
endAction || /* @__PURE__ */ jsx(Dialog.Action, { children: /* @__PURE__ */ jsx(Button, { fullWidth: true, onClick: handleConfirm, variant, loading: isConfirming, children: formatMessage({
id: "app.components.Button.confirm",
defaultMessage: "Confirm"
}) }) })
] })
] });
};
const StyledWarning = styled$1(ForwardRef$3$1)`
width: 24px;
height: 24px;
path {
fill: ${({ theme }) => theme.colors.danger600};
}
`;
const useIsMounted = () => {
const isMounted = React.useRef(false);
React.useLayoutEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
};
const useForceUpdate = () => {
const [tick, update] = React.useState();
const isMounted = useIsMounted();
const forceUpdate = React.useCallback(() => {
if (isMounted.current) {
update(Math.random());
}
}, [isMounted, update]);
return [tick, forceUpdate];
};
const useThrottledCallback = (callback, wait, options) => {
const throttledCallback = useMemo(
() => throttle$1(callback, wait, options),
[callback, options, wait]
);
return throttledCallback;
};
const requestIdleCallbackShim = (callback) => {
const start = Date.now();
return setTimeout(() => {
callback({
didTimeout: false,
timeRemaining() {
return Math.max(0, Date.now() - start);
}
});
}, 1);
};
const _requestIdleCallback = typeof requestIdleCallback === "undefined" ? requestIdleCallbackShim : requestIdleCallback;
const cancelIdleCallbackShim = (handle) => {
return clearTimeout(handle);
};
const _cancelIdleCallback = typeof cancelIdleCallback === "undefined" ? cancelIdleCallbackShim : cancelIdleCallback;
const DescriptionComponentRenderer = ({
children,
props,
descriptions
}) => {
const statesRef = React.useRef({});
const [tick, forceUpdate] = useForceUpdate();
const requestHandle = React.useRef(null);
const requestUpdate = React.useCallback(() => {
if (requestHandle.current) {
_cancelIdleCallback(requestHandle.current);
}
requestHandle.current = _requestIdleCallback(() => {
requestHandle.current = null;
forceUpdate();
});
}, [forceUpdate]);
const throttledRequestUpdate = useThrottledCallback(requestUpdate, 60, { trailing: true });
const update = React.useCallback(
(id, description) => {
if (description === null) {
delete statesRef.current[id];
} else {
const current = statesRef.current[id];
statesRef.current[id] = { ...current, value: { ...description, id } };
}
throttledRequestUpdate();
},
[throttledRequestUpdate]
);
const ids2 = React.useMemo(
() => descriptions.map((description) => getCompId(description)),
[descriptions]
);
const states = React.useMemo(
() => ids2.map((id) => statesRef.current[id]?.value).filter((state) => state !== null && state !== void 0),
/**
* we leave tick in the deps to ensure the memo is recalculated when the `update` function is called.
* the `ids` will most likely be stable unless we get new actions, but we can't respond to the Description
* Component changing the ref data in any other way.
*/
// eslint-disable-next-line react-hooks/exhaustive-deps
[ids2, tick]
);
return /* @__PURE__ */ jsxs(Fragment, { children: [
descriptions.map((description) => {
const key = getCompId(description);
return /* @__PURE__ */ jsx(Description, { id: key, description, props, update }, key);
}),
children(states)
] });
};
const Description = React.memo(
({ description, id, props, update }) => {
const comp = description(props);
useShallowCompareEffect(() => {
update(id, comp);
return () => {
update(id, null);
};
}, comp);
return null;
},
(prev, next) => isEqual(prev.props, next.props)
);
const ids = /* @__PURE__ */ new WeakMap();
let counter = 0;
function getCompId(comp) {
const cachedId = ids.get(comp);
if (cachedId)
return cachedId;
const id = `${comp.name || comp.displayName || "<anonymous>"}-${counter++}`;
ids.set(comp, id);
return id;
}
const useShallowCompareMemoize = (value) => {
const ref = React.useRef(void 0);
if (!isEqual(value, ref.current)) {
ref.current = value;
}
return [ref.current];
};
const useShallowCompareEffect = (callback, dependencies) => {
React.useEffect(callback, useShallowCompareMemoize(dependencies));
};
const BASE_FILTERS = [
{
label: { id: "components.FilterOptions.FILTER_TYPES.$eq", defaultMessage: "is" },
value: "$eq"
},
{
label: { id: "components.FilterOptions.FILTER_TYPES.$ne", defaultMessage: "is not" },
value: "$ne"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$null",
defaultMessage: "is null"
},
value: "$null"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$notNull",
defaultMessage: "is not null"
},
value: "$notNull"
}
];
const NUMERIC_FILTERS = [
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$gt",
defaultMessage: "is greater than"
},
value: "$gt"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$gte",
defaultMessage: "is greater than or equal to"
},
value: "$gte"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$lt",
defaultMessage: "is less than"
},
value: "$lt"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$lte",
defaultMessage: "is less than or equal to"
},
value: "$lte"
}
];
const IS_SENSITIVE_FILTERS = [
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$eqi",
defaultMessage: "is (case insensitive)"
},
value: "$eqi"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$nei",
defaultMessage: "is not (case insensitive)"
},
value: "$nei"
}
];
const CONTAINS_FILTERS = [
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$contains",
defaultMessage: "contains"
},
value: "$contains"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$containsi",
defaultMessage: "contains (case insensitive)"
},
value: "$containsi"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$notContains",
defaultMessage: "not contains"
},
value: "$notContains"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$notContainsi",
defaultMessage: "not contains (case insensitive)"
},
value: "$notContainsi"
}
];
const STRING_PARSE_FILTERS = [
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$startsWith",
defaultMessage: "starts with"
},
value: "$startsWith"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$startsWithi",
defaultMessage: "starts with (case insensitive)"
},
value: "$startsWithi"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$endsWith",
defaultMessage: "ends with"
},
value: "$endsWith"
},
{
label: {
id: "components.FilterOptions.FILTER_TYPES.$endsWithi",
defaultMessage: "ends with (case insensitive)"
},
value: "$endsWithi"
}
];
const FILTERS_WITH_NO_VALUE = ["$null", "$notNull"];
function useControllableState({
prop,
defaultProp,
onChange = () => {
}
}) {
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
const isControlled = prop !== void 0;
const value = isControlled ? prop : uncontrolledProp;
const handleChange = useCallbackRef(onChange);
const setValue = React.useCallback(
(nextValue) => {
if (isControlled) {
const setter = nextValue;
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
if (value2 !== prop)
handleChange(value2);
} else {
setUncontrolledProp(nextValue);
}
},
[isControlled, prop, setUncontrolledProp, handleChange]
);
return [value, setValue];
}
function useUncontrolledState({
defaultProp,
onChange
}) {
const uncontrolledState = React.useState(defaultProp);
const [value] = uncontrolledState;
const prevValueRef = React.useRef(value);
const handleChange = useCallbackRef(onChange);
React.useEffect(() => {
if (prevValueRef.current !== value) {
handleChange(value);
prevValueRef.current = value;
}
}, [value, prevValueRef, handleChange]);
return uncontrolledState;
}
const [FiltersProvider, useFilters] = createContext("Filters");
const Root$2 = ({
children,
disabled = false,
onChange,
options = [],
onOpenChange,
open: openProp,
defaultOpen,
...restProps
}) => {
const handleChange = (data) => {
if (onChange) {
onChange(data);
}
};
const [open = false, setOpen] = useControllableState({
prop: openProp,
defaultProp: defaultOpen,
onChange: onOpenChange
});
return /* @__PURE__ */ jsx(Popover.Root, { open, onOpenChange: setOpen, ...restProps, children: /* @__PURE__ */ jsx(
FiltersProvider,
{
setOpen,
disabled,
onChange: handleChange,
options,
children
}
) });
};
const Trigger = React.forwardRef(
({ label }, forwardedRef) => {
const { formatMessage } = useIntl();
const disabled = useFilters("Trigger", ({ disabled: disabled2 }) => disabled2);
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
Button,
{
variant: "tertiary",
ref: forwardedRef,
startIcon: /* @__PURE__ */ jsx(ForwardRef$3d, {}),
size: "S",
disabled,
children: label || formatMessage({ id: "app.utils.filters", defaultMessage: "Filters" })
}
) });
}
);
const PopoverImpl = () => {
const [{ query }, setQuery] = useQueryParams();
const { formatMessage } = useIntl();
const options = useFilters("Popover", ({ options: options2 }) => options2);
const onChange = useFilters("Popover", ({ onChange: onChange2 }) => onChange2);
const setOpen = useFilters("Popover", ({ setOpen: setOpen2 }) => setOpen2);
if (options.length === 0) {
return null;
}
const handleSubmit = (data) => {
const value = FILTERS_WITH_NO_VALUE.includes(data.filter) ? "true" : encodeURIComponent(data.value ?? "");
if (!value) {
return;
}
if (onChange) {
onChange(data);
}
const fieldOptions = options.find((filter2) => filter2.name === data.name);
const operatorValuePairing = {
[data.filter]: value
};
const newFilterQuery = {
...query.filters,
$and: [
...query.filters?.$and ?? [],
{
[data.name]: fieldOptions.type === "relation" ? {
[fieldOptions.mainField?.name ?? "id"]: operatorValuePairing
} : operatorValuePairing
}
]
};
setQuery({ filters: newFilterQuery, page: 1 });
setOpen(false);
};
return /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsx(Box, { padding: 3, children: /* @__PURE__ */ jsx(
Form,
{
method: "POST",
initialValues: {
name: options[0]?.name,
filter: BASE_FILTERS[0].value
},
onSubmit: handleSubmit,
children: ({ values: formValues, modified, isSubmitting }) => {
const filter2 = options.find((filter22) => filter22.name === formValues.name);
const Input = filter2?.input || MemoizedInputRenderer;
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, style: { minWidth: 184 }, children: [
[
{
["aria-label"]: formatMessage({
id: "app.utils.select-field",
defaultMessage: "Select field"
}),
name: "name",
options: options.map((filter22) => ({
label: filter22.label,
value: filter22.name
})),
placholder: formatMessage({
id: "app.utils.select-field",
defaultMessage: "Select field"
}),
type: "enumeration"
},
{
["aria-label"]: formatMessage({
id: "app.utils.select-filter",
defaultMessage: "Select filter"
}),
name: "filter",
options: filter2?.operators || getFilterList(filter2).map((opt) => ({
label: formatMessage(opt.label),
value: opt.value
})),
placeholder: formatMessage({
id: "app.utils.select-filter",
defaultMessage: "Select filter"
}),
type: "enumeration"
}
].map((field) => /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field }, field.name)),
filter2 && formValues.filter && formValues.filter !== "$null" && formValues.filter !== "$notNull" ? /* @__PURE__ */ jsx(
Input,
{
...filter2,
label: null,
"aria-label": filter2.label,
name: "value",
type: filter2.mainField?.type ?? filter2.type
}
) : null,
/* @__PURE__ */ jsx(
Button,
{
disabled: !modified || isSubmitting,
size: "L",
variant: "secondary",
startIcon: /* @__PURE__ */ jsx(ForwardRef$1d, {}),
type: "submit",
fullWidth: true,
children: formatMessage({ id: "app.utils.add-filter", defaultMessage: "Add filter" })
}
)
] });
}
}
) }) });
};
const getFilterList = (filter2) => {
if (!filter2) {
return [];
}
const type = filter2.mainField?.type ? filter2.mainField.type : filter2.type;
switch (type) {
case "email":
case "text":
case "string": {
return [
...BASE_FILTERS,
...IS_SENSITIVE_FILTERS,
...CONTAINS_FILTERS,
...STRING_PARSE_FILTERS
];
}
case "float":
case "integer":
case "biginteger":
case "decimal": {
return [...BASE_FILTERS, ...NUMERIC_FILTERS];
}
case "time":
case "date": {
return [...BASE_FILTERS, ...NUMERIC_FILTERS, ...CONTAINS_FILTERS];
}
case "datetime": {
return [...BASE_FILTERS, ...NUMERIC_FILTERS];
}
case "enumeration": {
return BASE_FILTERS;
}
default:
return [...BASE_FILTERS, ...IS_SENSITIVE_FILTERS];
}
};
const List = () => {
const [{ query }, setQuery] = useQueryParams();
const options = useFilters("List", ({ options: options2 }) => options2);
const handleClick = (data) => {
const nextFilters = (query?.filters?.$and ?? []).filter((filter2) => {
const [attributeName] = Object.keys(filter2);
if (attributeName !== data.name) {
return true;
}
const { type, mainField } = options.find(({ name }) => name === attributeName);
if (type === "relation") {
const filterObj = filter2[attributeName][mainField?.name ?? "id"];
if (typeof filterObj === "object") {
const [operator] = Object.keys(filterObj);
const value = filterObj[operator];
return !(operator === data.filter && value === data.value);
}
return true;
} else {
const filterObj = filter2[attributeName];
const [operator] = Object.keys(filterObj);
const value = filterObj[operator];
return !(operator === data.filter && value === data.value);
}
});
setQuery({ filters: { $and: nextFilters }, page: 1 });
};
if (!query?.filters?.$and?.length) {
return null;
}
return /* @__PURE__ */ jsx(Fragment, { children: query?.filters?.$and?.map((queryFilter) => {
const [attributeName] = Object.keys(queryFilter);
const filter2 = options.find(({ name }) => name === attributeName);
const filterObj = queryFilter[attributeName];
if (!filter2 || typeof filterObj !== "object" || filterObj === null) {
return null;
}
if (filter2.type === "relation") {
const modelFilter = filterObj[filter2.mainField?.name ?? "id"];
if (typeof modelFilter === "object") {
const [operator] = Object.keys(modelFilter);
const value = modelFilter[operator];
return /* @__PURE__ */ jsx(
AttributeTag,
{
...filter2,
onClick: handleClick,
operator,
value
},
`${attributeName}-${operator}-${value}`
);
}
return null;
} else {
const [operator] = Object.keys(filterObj);
const value = filterObj[operator];
if (typeof value === "object") {
return null;
}
return /* @__PURE__ */ jsx(
AttributeTag,
{
...filter2,
onClick: handleClick,
operator,
value
},
`${attributeName}-${operator}-${value}`
);
}
}) });
};
const AttributeTag = ({
input,
label,
mainField,
name,
onClick,
operator,
options,
value,
...filter2
}) => {
const { formatMessage, formatDate, formatTime, formatNumber } = useIntl();
const handleClick = () => {
onClick({ name, value, filter: operator });
};
const type = mainField?.type ? mainField.type : filter2.type;
let formattedValue = value;
switch (type) {
case "date":
formattedValue = formatDate(value, { dateStyle: "full" });
break;
case "datetime":
formattedValue = formatDate(value, { dateStyle: "full", timeStyle: "short" });
break;
case "time":
const [hour, minute] = value.split(":");
const date2 = /* @__PURE__ */ new Date();
date2.setHours(Number(hour));
date2.setMinutes(Number(minute));
formattedValue = formatTime(date2, {
hour: "numeric",
minute: "numeric"
});
break;
case "float":
case "integer":
case "biginteger":
case "decimal":
formattedValue = formatNumber(Number(value));
break;
}
if (input && options) {
const selectedOption = options.find((option) => {
return (typeof option === "string" ? option : option.value) === value;
});
formattedValue = selectedOption ? typeof selectedOption === "string" ? selectedOption : selectedOption.label ?? selectedOption.value : value;
}
const content = `${label} ${formatMessage({
id: `components.FilterOptions.FILTER_TYPES.${operator}`,
defaultMessage: operator
})} ${operator !== "$null" && operator !== "$notNull" ? formattedValue : ""}`;
return /* @__PURE__ */ jsx(Tag, { padding: 1, onClick: handleClick, icon: /* @__PURE__ */ jsx(ForwardRef$3$, {}), children: content });
};
const Filters = {
List,
Popover: PopoverImpl,
Root: Root$2,
Trigger
};
const [PaginationProvider, usePagination] = createContext("Pagination");
const Root$1 = React.forwardRef(
({ children, defaultPageSize = 10, pageCount = 0, defaultPage = 1, onPageSizeChange, total = 0 }, forwardedRef) => {
const [{ query }, setQuery] = useQueryParams(
{
pageSize: defaultPageSize.toString(),
page: defaultPage.toString()
}
);
const setPageSize = (pageSize) => {
setQuery({ pageSize, page: "1" });
if (onPageSizeChange) {
onPageSizeChange(pageSize);
}
};
return /* @__PURE__ */ jsx(
Flex,
{
ref: forwardedRef,
paddingTop: 4,
paddingBottom: 4,
alignItems: "flex-end",
justifyContent: "space-between",
children: /* @__PURE__ */ jsx(
PaginationProvider,
{
currentQuery: query,
page: query.page,
pageSize: query.pageSize,
pageCount: pageCount.toString(),
setPageSize,
total,
children
}
)
}
);
}
);
const PageSize = ({ options = ["10", "20", "50", "100"] }) => {
const { formatMessage } = useIntl();
const pageSize = usePagination("PageSize", (state) => state.pageSize);
const totalCount = usePagination("PageSize", (state) => state.total);
const setPageSize = usePagination("PageSize", (state) => state.setPageSize);
const handleChange = (value) => {
setPageSize(value);
};
const minimumOption = parseInt(options[0], 10);
if (minimumOption >= totalCount) {
return null;
}
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
/* @__PURE__ */ jsx(
SingleSelect,
{
size: "S",
"aria-label": formatMessage({
id: "components.PageFooter.select",
defaultMessage: "Entries per page"
}),
onChange: handleChange,
value: pageSize,
children: options.map((option) => /* @__PURE__ */ jsx(SingleSelectOption, { value: option, children: option }, option))
}
),
/* @__PURE__ */ jsx(Typography, { textColor: "neutral600", tag: "span", children: formatMessage({
id: "components.PageFooter.select",
defaultMessage: "Entries per page"
}) })
] });
};
const Links = ({ boundaryCount = 1, siblingCount = 1 }) => {
const { formatMessage } = useIntl();
const query = usePagination("Links", (state) => state.currentQuery);
const currentPage = usePagination("Links", (state) => state.page);
const totalPages = usePagination("Links", (state) => state.pageCount);
const pageCount = parseInt(totalPages, 10);
const activePage = parseInt(currentPage, 10);
const range = (start, end) => {
const length = end - start + 1;
return Array.from({ length }, (_, i) => start + i);
};
const startPages = range(1, Math.min(boundaryCount, pageCount));
const endPages = range(Math.max(pageCount - boundaryCount + 1, boundaryCount + 1), pageCount);
const siblingsStart = Math.max(
Math.min(
// Natural start
activePage - siblingCount,
// Lower boundary when page is high
pageCount - boundaryCount - siblingCount * 2 - 1
),
// Greater than startPages
boundaryCount + 2
);
const siblingsEnd = Math.min(
Math.max(
// Natural end
activePage + siblingCount,
// Upper boundary when page is low
boundaryCount + siblingCount * 2 + 2
),
// Less than endPages
endPages.length > 0 ? endPages[0] - 2 : pageCount - 1
);
const items = [
...startPages,
// Start ellipsis
// eslint-disable-next-line no-nested-ternary
...siblingsStart > boundaryCount + 2 ? ["start-ellipsis"] : boundaryCount + 1 < pageCount - boundaryCount ? [boundaryCount + 1] : [],
// Sibling pages
...range(siblingsStart, siblingsEnd),
// End ellipsis
// eslint-disable-next-line no-nested-ternary
...siblingsEnd < pageCount - boundaryCount - 1 ? ["end-ellipsis"] : pageCount - boundaryCount > boundaryCount ? [pageCount - boundaryCount] : [],
...endPages
];
if (pageCount <= 1) {
return null;
}
return /* @__PURE__ */ jsxs(Pagination$1, { activePage, pageCount, children: [
/* @__PURE__ */ jsx(PreviousLink, { tag: Link$1, to: { search: stringify({ ...query, page: activePage - 1 }) }, children: formatMessage({
id: "components.pagination.go-to-previous",
defaultMessage: "Go to previous page"
}) }),
items.map((item) => {
if (typeof item === "number") {
return /* @__PURE__ */ jsx(
PageLink,
{
tag: Link$1,
number: item,
to: { search: stringify({ ...query, page: item }) },
children: formatMessage(
{ id: "components.pagination.go-to", defaultMessage: "Go to page {page}" },
{ page: item }
)
},
item
);
}
return /* @__PURE__ */ jsx(Dots, {}, item);
}),
/* @__PURE__ */ jsx(NextLink, { tag: Link$1, to: { search: stringify({ ...query, page: activePage + 1 }) }, children: formatMessage({
id: "components.pagination.go-to-next",
defaultMessage: "Go to next page"
}) })
] });
};
const Pagination = {
Root: Root$1,
Links,
PageSize
};
const SearchInput = ({
disabled,
label,
placeholder,
trackedEvent,
trackedEventDetails
}) => {
const inputRef = React.useRef(null);
const iconButtonRef = React.useRef(null);
const [{ query }, setQuery] = useQueryParams();
const [value, setValue] = React.useState(query?._q || "");
const [isOpen, setIsOpen] = React.useState(!!value);
const { formatMessage } = useIntl();
const { trackUsage } = useTracking();
const handleToggle = () => setIsOpen((prev) => !prev);
React.useLayoutEffect(() => {
if (isOpen && inputRef.current) {
inputRef.current.focus();
}
}, [isOpen]);
const handleClear = () => {
setValue("");
setQuery({ _q: "" }, "remove");
};
const handleSubmit = (e) => {
e.preventDefault();
if (value) {
if (trackedEvent) {
trackUsage(trackedEvent, trackedEventDetails);
}
setQuery({ _q: encodeURIComponent(value), page: 1 });
} else {
handleToggle();
setQuery({ _q: "" }, "remove");
}
};
if (isOpen) {
return /* @__PURE__ */ jsx(SearchForm, { onSubmit: handleSubmit, children: /* @__PURE__ */ jsx(
Searchbar,
{
ref: inputRef,
name: "search",
onChange: (e) => setValue(e.target.value),
value,
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
onClear: handleClear,
placeholder,
children: label
}
) });
}
return /* @__PURE__ */ jsx(
IconButton,
{
ref: iconButtonRef,
disabled,
label: formatMessage({ id: "global.search", defaultMessage: "Search" }),
onClick: handleToggle,
children: /* @__PURE__ */ jsx(ForwardRef$V$1, {})
}
);
};
const [TableProvider, useTable] = createContext("Table");
const Root = ({
children,
defaultSelectedRows,
footer,
headers = [],
isLoading = false,
onSelectedRowsChange,
rows = [],
selectedRows: selectedRowsProps
}) => {
const [selectedRows = [], setSelectedRows] = useControllableState({
prop: selectedRowsProps,
defaultProp: defaultSelectedRows,
onChange: onSelectedRowsChange
});
const [hasHeaderCheckbox, setHasHeaderCheckbox] = React.useState(false);
const rowCount = rows.length + 1;
const colCount = hasHeaderCheckbox ? headers.length + 1 : headers.length;
const selectRow = (row) => {
if (Array.isArray(row)) {
setSelectedRows(row);
} else {
setSelectedRows((prev = []) => {
const currentRowIndex = prev.findIndex((r) => r.id === row.id);
if (currentRowIndex > -1) {
return prev.toSpliced(currentRowIndex, 1);
}
return [...prev, row];
});
}
};
return /* @__PURE__ */ jsx(
TableProvider,
{
colCount,
hasHeaderCheckbox,
setHasHeaderCheckbox,
footer,
headers,
isLoading,
rowCount,
rows,
selectedRows,
selectRow,
children
}
);
};
const Content = ({ children }) => {
const rowCount = useTable("Content", (state) => state.rowCount);
const colCount = useTable("Content", (state) => state.colCount);
const footer = useTable("Content", (state) => state.footer);
return /* @__PURE__ */ jsx(Table$1, { rowCount, colCount, footer, children });
};
const Head = ({ children }) => {
return /* @__PURE__ */ jsx(Thead, { children: /* @__PURE__ */ jsx(Tr, { children }) });
};
const HeaderCell = ({ name, label, sortable }) => {
const [{ query }, setQuery] = useQueryParams();
const sort = query?.sort ?? "";
const [sortBy, sortOrder] = sort.split(":");
const { formatMessage } = useIntl();
const isSorted = sortBy === name;
const sortLabel = formatMessage(
{ id: "components.TableHeader.sort", defaultMessage: "Sort on {label}" },
{ label }
);
const handleClickSort = () => {
if (sortable) {
setQuery({
sort: `${name}:${isSorted && sortOrder === "ASC" ? "DESC" : "ASC"}`
});
}
};
return /* @__PURE__ */ jsx(
Th,
{
action: isSorted && sortable && /* @__PURE__ */ jsx(IconButton, { label: sortLabel, onClick: handleClickSort, variant: "ghost", children: /* @__PURE__ */ jsx(SortIcon, { $isUp: sortOrder === "ASC" }) }),
children: /* @__PURE__ */ jsx(Tooltip, { label: sortable ? sortLabel : label, children: /* @__PURE__ */ jsx(
Typography,
{
textColor: "neutral600",
tag: !isSorted && sortable ? "button" : "span",
onClick: handleClickSort,
variant: "sigma",
children: label
}
) })
}
);
};
const SortIcon = styled$1(ForwardRef$4L)`
transform: ${({ $isUp }) => `rotate(${$isUp ? "180" : "0"}deg)`};
`;
const ActionBar = ({ children }) => {
const { formatMessage } = useIntl();
const selectedRows = useTable("ActionBar", (state) => state.selectedRows);
if (selectedRows.length === 0)
return null;
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral500", children: formatMessage(
{
id: "content-manager.components.TableDelete.label",
defaultMessage: "{number, plural, one {# row} other {# rows}} selected"
},
{ number: selectedRows.length }
) }),
children
] });
};
const HeaderCheckboxCell = () => {
const rows = useTable("HeaderCheckboxCell", (state) => state.rows);
const selectedRows = useTable("HeaderCheckboxCell", (state) => state.selectedRows);
const selectRow = useTable("HeaderCheckboxCell", (state) => state.selectRow);
const setHasHeaderCheckbox = useTable(
"HeaderCheckboxCell",
(state) => state.setHasHeaderCheckbox
);
const { formatMessage } = useIntl();
const areAllEntriesSelected = selectedRows.length === rows.length && rows.length > 0;
const isIndeterminate = !areAllEntriesSelected && selectedRows.length > 0;
React.useEffect(() => {
setHasHeaderCheckbox(true);
return () => setHasHeaderCheckbox(false);
}, [setHasHeaderCheckbox]);
const handleSelectAll = () => {
if (!areAllEntriesSelected) {
selectRow(rows);
} else {
selectRow([]);
}
};
return /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(
Checkbox,
{
"aria-label": formatMessage({
id: "global.select-all-entries",
defaultMessage: "Select all entries"
}),
disabled: rows.length === 0,
checked: isIndeterminate ? "indeterminate" : areAllEntriesSelected,
onCheckedChange: handleSelectAll
}
) });
};
const Empty = (props) => {
const { formatMessage } = useIntl();
const rows = useTable("Empty", (state) => state.rows);
const isLoading = useTable("Empty", (state) => state.isLoading);
const colCount = useTable("Empty", (state) => state.colCount);
if (rows.length > 0 || isLoading) {
return null;
}
return /* @__PURE__ */ jsx(Tbody, { children: /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(Td, { colSpan: colCount, children: /* @__PURE__ */ jsx(
EmptyStateLayout,
{
content: formatMessage({
id: "app.components.EmptyStateLayout.content-document",
defaultMessage: "No content found"
}),
hasRadius: true,
icon: /* @__PURE__ */ jsx(ForwardRef$J, { width: "16rem" }),
...props
}
) }) }) });
};
const Loading = ({ children = "Loading content" }) => {
const isLoading = useTable("Loading", (state) => state.isLoading);
const colCount = useTable("Loading", (state) => state.colCount);
if (!isLoading) {
return null;
}
return /* @__PURE__ */ jsx(Tbody, { children: /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(Td, { colSpan: colCount, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", padding: 11, background: "neutral0", children: /* @__PURE__ */ jsx(Loader, { children }) }) }) }) });
};
const Body = ({ children }) => {
const isLoading = useTable("Body", (state) => state.isLoading);
const rows = useTable("Body", (state) => state.rows);
if (isLoading || rows.length === 0) {
return null;
}
return /* @__PURE__ */ jsx(Tbody, { children });
};
const Row = (props) => {
return /* @__PURE__ */ jsx(Tr, { ...props });
};
const Cell = (props) => {
return /* @__PURE__ */ jsx(Td, { ...props });
};
const CheckboxCell = ({ id, ...props }) => {
const rows = useTable("CheckboxCell", (state) => state.rows);
const selectedRows = useTable("CheckboxCell", (state) => state.selectedRows);
const selectRow = useTable("CheckboxCell", (state) => state.selectRow);
const { formatMessage } = useIntl();
const handleSelectRow = () => {
selectRow(rows.find((row) => row.id === id));
};
const isChecked = selectedRows.findIndex((row) => row.id === id) > -1;
return /* @__PURE__ */ jsx(Cell, { ...props, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
Checkbox,
{
"aria-label": formatMessage(
{
id: "app.component.table.select.one-entry",
defaultMessage: `Select {target}`
},
{ target: id }
),
disabled: rows.length === 0,
checked: isChecked,
onCheckedChange: handleSelectRow
}
) });
};
const Table = {
Root,
Content,
ActionBar,
Head,
HeaderCell,
HeaderCheckboxCell,
Body,
CheckboxCell,
Cell,
Row,
Loading,
Empty
};
styled$1(Flex)`
margin-right: ${({ theme }) => theme.spaces[6]};
svg {
width: 3.2rem;
height: 3.2rem;
}
`;
styled$1(Typography)`
color: ${({ theme }) => theme.colors.neutral800};
word-break: break-all;
`;
const usersService = adminApi.enhanceEndpoints({
addTagTypes: ["LicenseLimits", "User", "Role", "RolePermissions"]
}).injectEndpoints({
endpoints: (builder) => ({
/**
* users
*/
createUser: builder.mutation({
query: (body) => ({
url: "/admin/users",
method: "POST",
data: body
}),
transformResponse: (response) => response.data,
invalidatesTags: ["LicenseLimits", { type: "User", id: "LIST" }]
}),
updateUser: builder.mutation({
query: ({ id, ...body }) => ({
url: `/admin/users/${id}`,
method: "PUT",
data: body
}),
invalidatesTags: (_res, _err, { id }) => [
{ type: "User", id },
{ type: "User", id: "LIST" }
]
}),
getUsers: builder.query({
query: ({ id, ...params } = {}) => ({
url: `/admin/users/${id ?? ""}`,
method: "GET",
config: {
params
}
}),
transformResponse: (res) => {
let users = [];
if (res.data) {
if ("results" in res.data) {
if (Array.isArray(res.data.results)) {
users = res.data.results;
}
} else {
users = [res.data];
}
}
return {
users,
pagination: "pagination" in res.data ? res.data.pagination : null
};
},
providesTags: (res, _err, arg) => {
if (typeof arg === "object" && "id" in arg) {
return [{ type: "User", id: arg.id }];
} else {
return [
...res?.users.map(({ id }) => ({ type: "User", id })) ?? [],
{ type: "User", id: "LIST" }
];
}
}
}),
deleteManyUsers: builder.mutation({
query: (body) => ({
url: "/admin/users/batch-delete",
method: "POST",
data: body
}),
transformResponse: (res) => res.data,
invalidatesTags: ["LicenseLimits", { type: "User", id: "LIST" }]
}),
/**
* roles
*/
createRole: builder.mutation({
query: (body) => ({
url: "/admin/roles",
method: "POST",
data: body
}),
transformResponse: (res) => res.data,
invalidatesTags: [{ type: "Role", id: "LIST" }]
}),
getRoles: builder.query({
query: ({ id, ...params } = {}) => ({
url: `/admin/roles/${id ?? ""}`,
method: "GET",
config: {
params
}
}),
transformResponse: (res) => {
let roles = [];
if (res.data) {
if (Array.isArray(res.data)) {
roles = res.data;
} else {
roles = [res.data];
}
}
return roles;
},
providesTags: (res, _err, arg) => {
if (typeof arg === "object" && "id" in arg) {
return [{ type: "Role", id: arg.id }];
} else {
return [
...res?.map(({ id }) => ({ type: "Role", id })) ?? [],
{ type: "Role", id: "LIST" }
];
}
}
}),
updateRole: builder.mutation({
query: ({ id, ...body }) => ({
url: `/admin/roles/${id}`,
method: "PUT",
data: body
}),
transformResponse: (res) => res.data,
invalidatesTags: (_res, _err, { id }) => [{ type: "Role", id }]
}),
getRolePermissions: builder.query({
query: ({ id, ...params }) => ({
url: `/admin/roles/${id}/permissions`,
method: "GET",
config: {
params
}
}),
transformResponse: (res) => res.data,
providesTags: (_res, _err, { id }) => [{ type: "RolePermissions", id }]
}),
updateRolePermissions: builder.mutation({
query: ({ id, ...body }) => ({
url: `/admin/roles/${id}/permissions`,
method: "PUT",
data: body
}),
transformResponse: (res) => res.data,
invalidatesTags: (_res, _err, { id }) => [{ type: "RolePermissions", id }]
}),
/**
* Permissions
*/
getRolePermissionLayout: builder.query({
query: (params) => ({
url: "/admin/permissions",
method: "GET",
config: {
params
}
}),
transformResponse: (res) => res.data
})
}),
overrideExisting: false
});
const {
useCreateUserMutation,
useGetUsersQuery,
useUpdateUserMutation,
useDeleteManyUsersMutation,
useGetRolesQuery,
useCreateRoleMutation,
useUpdateRoleMutation,
useGetRolePermissionsQuery,
useGetRolePermissionLayoutQuery,
useUpdateRolePermissionsMutation
} = usersService;
const useAdminUsers = useGetUsersQuery;
function toInteger$1(dirtyNumber) {
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
return NaN;
}
var number2 = Number(dirtyNumber);
if (isNaN(number2)) {
return number2;
}
return number2 < 0 ? Math.ceil(number2) : Math.floor(number2);
}
function requiredArgs(required, args) {
if (args.length < required) {
throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
}
}
function toDate(argument) {
requiredArgs(1, arguments);
var argStr = Object.prototype.toString.call(argument);
if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
return new Date(argument.getTime());
} else if (typeof argument === "number" || argStr === "[object Number]") {
return new Date(argument);
} else {
if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
console.warn(new Error().stack);
}
return /* @__PURE__ */ new Date(NaN);
}
}
function addDays(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var date2 = toDate(dirtyDate);
var amount = toInteger$1(dirtyAmount);
if (isNaN(amount)) {
return /* @__PURE__ */ new Date(NaN);
}
if (!amount) {
return date2;
}
date2.setDate(date2.getDate() + amount);
return date2;
}
function addMonths(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var date2 = toDate(dirtyDate);
var amount = toInteger$1(dirtyAmount);
if (isNaN(amount)) {
return /* @__PURE__ */ new Date(NaN);
}
if (!amount) {
return date2;
}
var dayOfMonth = date2.getDate();
var endOfDesiredMonth = new Date(date2.getTime());
endOfDesiredMonth.setMonth(date2.getMonth() + amount + 1, 0);
var daysInMonth = endOfDesiredMonth.getDate();
if (dayOfMonth >= daysInMonth) {
return endOfDesiredMonth;
} else {
date2.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
return date2;
}
}
function add(dirtyDate, duration) {
requiredArgs(2, arguments);
if (!duration || _typeof(duration) !== "object") return /* @__PURE__ */ new Date(NaN);
var years = duration.years ? toInteger$1(duration.years) : 0;
var months = duration.months ? toInteger$1(duration.months) : 0;
var weeks = duration.weeks ? toInteger$1(duration.weeks) : 0;
var days = duration.days ? toInteger$1(duration.days) : 0;
var hours = duration.hours ? toInteger$1(duration.hours) : 0;
var minutes = duration.minutes ? toInteger$1(duration.minutes) : 0;
var seconds = duration.seconds ? toInteger$1(duration.seconds) : 0;
var date2 = toDate(dirtyDate);
var dateWithMonths = months || years ? addMonths(date2, months + years * 12) : date2;
var dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
var minutesToAdd = minutes + hours * 60;
var secondsToAdd = seconds + minutesToAdd * 60;
var msToAdd = secondsToAdd * 1e3;
var finalDate = new Date(dateWithDays.getTime() + msToAdd);
return finalDate;
}
function getTimezoneOffsetInMilliseconds(date2) {
var utcDate = new Date(Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate(), date2.getHours(), date2.getMinutes(), date2.getSeconds(), date2.getMilliseconds()));
utcDate.setUTCFullYear(date2.getFullYear());
return date2.getTime() - utcDate.getTime();
}
function startOfDay(dirtyDate) {
requiredArgs(1, arguments);
var date2 = toDate(dirtyDate);
date2.setHours(0, 0, 0, 0);
return date2;
}
var MILLISECONDS_IN_DAY = 864e5;
function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var startOfDayLeft = startOfDay(dirtyDateLeft);
var startOfDayRight = startOfDay(dirtyDateRight);
var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);
var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
}
function compareAsc(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var diff = dateLeft.getTime() - dateRight.getTime();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1;
} else {
return diff;
}
}
var millisecondsInMinute = 6e4;
var millisecondsInHour = 36e5;
function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
return yearDiff * 12 + monthDiff;
}
function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
return dateLeft.getFullYear() - dateRight.getFullYear();
}
function compareLocalAsc(dateLeft, dateRight) {
var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1;
} else {
return diff;
}
}
function differenceInDays(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign = compareLocalAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));
dateLeft.setDate(dateLeft.getDate() - sign * difference);
var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign);
var result = sign * (difference - isLastDayNotFull);
return result === 0 ? 0 : result;
}
function differenceInMilliseconds(dateLeft, dateRight) {
requiredArgs(2, arguments);
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
}
var roundingMap = {
ceil: Math.ceil,
round: Math.round,
floor: Math.floor,
trunc: function trunc(value) {
return value < 0 ? Math.ceil(value) : Math.floor(value);
}
// Math.trunc is not supported by IE
};
var defaultRoundingMethod = "trunc";
function getRoundingMethod(method) {
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
}
function differenceInHours(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
return getRoundingMethod(void 0)(diff);
}
function differenceInMinutes(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
return getRoundingMethod(void 0)(diff);
}
function endOfDay(dirtyDate) {
requiredArgs(1, arguments);
var date2 = toDate(dirtyDate);
date2.setHours(23, 59, 59, 999);
return date2;
}
function endOfMonth(dirtyDate) {
requiredArgs(1, arguments);
var date2 = toDate(dirtyDate);
var month = date2.getMonth();
date2.setFullYear(date2.getFullYear(), month + 1, 0);
date2.setHours(23, 59, 59, 999);
return date2;
}
function isLastDayOfMonth(dirtyDate) {
requiredArgs(1, arguments);
var date2 = toDate(dirtyDate);
return endOfDay(date2).getTime() === endOfMonth(date2).getTime();
}
function differenceInMonths(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign = compareAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));
var result;
if (difference < 1) {
result = 0;
} else {
if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
dateLeft.setDate(30);
}
dateLeft.setMonth(dateLeft.getMonth() - sign * difference);
var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;
if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {
isLastMonthNotFull = false;
}
result = sign * (difference - Number(isLastMonthNotFull));
}
return result === 0 ? 0 : result;
}
function differenceInSeconds(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / 1e3;
return getRoundingMethod(void 0)(diff);
}
function differenceInYears(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign = compareAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight));
dateLeft.setFullYear(1584);
dateRight.setFullYear(1584);
var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign;
var result = sign * (difference - Number(isLastYearNotFull));
return result === 0 ? 0 : result;
}
function intervalToDuration(interval) {
requiredArgs(1, arguments);
var start = toDate(interval.start);
var end = toDate(interval.end);
if (isNaN(start.getTime())) throw new RangeError("Start Date is invalid");
if (isNaN(end.getTime())) throw new RangeError("End Date is invalid");
var duration = {};
duration.years = Math.abs(differenceInYears(end, start));
var sign = compareAsc(end, start);
var remainingMonths = add(start, {
years: sign * duration.years
});
duration.months = Math.abs(differenceInMonths(end, remainingMonths));
var remainingDays = add(remainingMonths, {
months: sign * duration.months
});
duration.days = Math.abs(differenceInDays(end, remainingDays));
var remainingHours = add(remainingDays, {
days: sign * duration.days
});
duration.hours = Math.abs(differenceInHours(end, remainingHours));
var remainingMinutes = add(remainingHours, {
hours: sign * duration.hours
});
duration.minutes = Math.abs(differenceInMinutes(end, remainingMinutes));
var remainingSeconds = add(remainingMinutes, {
minutes: sign * duration.minutes
});
duration.seconds = Math.abs(differenceInSeconds(end, remainingSeconds));
return duration;
}
function isPast(dirtyDate) {
requiredArgs(1, arguments);
return toDate(dirtyDate).getTime() < Date.now();
}
const PLUGIN_ID = "content-manager";
const PERMISSIONS = [
"plugin::content-manager.explorer.create",
"plugin::content-manager.explorer.read",
"plugin::content-manager.explorer.update",
"plugin::content-manager.explorer.delete",
"plugin::content-manager.explorer.publish"
];
const InjectionZone = ({ area, ...props }) => {
const components = useInjectionZone(area);
return /* @__PURE__ */ jsx(Fragment, { children: components.map((component) => /* @__PURE__ */ jsx(component.Component, { ...props }, component.name)) });
};
const useInjectionZone = (area) => {
const getPlugin = useStrapiApp("useInjectionZone", (state) => state.getPlugin);
const contentManagerPlugin = getPlugin(PLUGIN_ID);
const [page, position] = area.split(".");
return contentManagerPlugin.getInjectedComponents(page, position);
};
const ID = "id";
const CREATED_BY_ATTRIBUTE_NAME = "createdBy";
const UPDATED_BY_ATTRIBUTE_NAME = "updatedBy";
const CREATOR_FIELDS = [CREATED_BY_ATTRIBUTE_NAME, UPDATED_BY_ATTRIBUTE_NAME];
const PUBLISHED_BY_ATTRIBUTE_NAME = "publishedBy";
const CREATED_AT_ATTRIBUTE_NAME = "createdAt";
const UPDATED_AT_ATTRIBUTE_NAME = "updatedAt";
const PUBLISHED_AT_ATTRIBUTE_NAME = "publishedAt";
const DOCUMENT_META_FIELDS = [
ID,
...CREATOR_FIELDS,
PUBLISHED_BY_ATTRIBUTE_NAME,
CREATED_AT_ATTRIBUTE_NAME,
UPDATED_AT_ATTRIBUTE_NAME,
PUBLISHED_AT_ATTRIBUTE_NAME
];
const ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD = [
"dynamiczone",
"json",
"text",
"relation",
"component",
"boolean",
"media",
"password",
"richtext",
"timestamp",
"blocks"
];
const SINGLE_TYPES = "single-types";
const COLLECTION_TYPES = "collection-types";
const [DocumentRBACProvider, useDocumentRBAC] = createContext(
"DocumentRBAC",
{
canCreate: false,
canCreateFields: [],
canDelete: false,
canPublish: false,
canRead: false,
canReadFields: [],
canUpdate: false,
canUpdateFields: [],
canUserAction: () => false,
isLoading: false
}
);
const DocumentRBAC = ({ children, permissions }) => {
const { slug } = useParams();
if (!slug) {
throw new Error("Cannot find the slug param in the URL");
}
const [{ rawQuery }] = useQueryParams();
const userPermissions = useAuth("DocumentRBAC", (state) => state.permissions);
const contentTypePermissions = React.useMemo(() => {
const contentTypePermissions2 = userPermissions.filter(
(permission) => permission.subject === slug
);
return contentTypePermissions2.reduce((acc, permission) => {
const [action] = permission.action.split(".").slice(-1);
return { ...acc, [action]: [permission] };
}, {});
}, [slug, userPermissions]);
const { isLoading, allowedActions } = useRBAC(
contentTypePermissions,
permissions ?? void 0,
// TODO: useRBAC context should be typed and built differently
// We are passing raw query as context to the hook so that it can
// rely on the locale provided from DocumentRBAC for its permission calculations.
rawQuery
);
const canCreateFields = !isLoading && allowedActions.canCreate ? extractAndDedupeFields(contentTypePermissions.create) : [];
const canReadFields = !isLoading && allowedActions.canRead ? extractAndDedupeFields(contentTypePermissions.read) : [];
const canUpdateFields = !isLoading && allowedActions.canUpdate ? extractAndDedupeFields(contentTypePermissions.update) : [];
const canUserAction = React.useCallback(
(fieldName, fieldsUserCanAction, fieldType) => {
const name = removeNumericalStrings(fieldName.split("."));
const componentFieldNames = fieldsUserCanAction.filter((field) => field.split(".").length > 1);
if (fieldType === "component") {
return componentFieldNames.some((field) => {
return field.includes(name.join("."));
});
}
if (name.length > 1) {
return componentFieldNames.includes(name.join("."));
}
return fieldsUserCanAction.includes(fieldName);
},
[]
);
if (isLoading) {
return /* @__PURE__ */ jsx(Page.Loading, {});
}
return /* @__PURE__ */ jsx(
DocumentRBACProvider,
{
isLoading,
canCreateFields,
canReadFields,
canUpdateFields,
canUserAction,
...allowedActions,
children
}
);
};
const extractAndDedupeFields = (permissions = []) => permissions.flatMap((permission) => permission.properties?.fields).filter(
(field, index2, arr) => arr.indexOf(field) === index2 && typeof field === "string"
);
const removeNumericalStrings = (arr) => arr.filter((item) => isNaN(Number(item)));
const contentManagerApi = adminApi.enhanceEndpoints({
addTagTypes: [
"ComponentConfiguration",
"ContentTypesConfiguration",
"ContentTypeSettings",
"Document",
"InitialData",
"HistoryVersion",
"Relations",
"UidAvailability"
]
});
const documentApi = contentManagerApi.injectEndpoints({
overrideExisting: true,
endpoints: (builder) => ({
autoCloneDocument: builder.mutation({
query: ({ model, sourceId, query }) => ({
url: `/content-manager/collection-types/${model}/auto-clone/${sourceId}`,
method: "POST",
config: {
params: query
}
}),
invalidatesTags: (_result, error, { model }) => {
if (error) {
return [];
}
return [{ type: "Document", id: `${model}_LIST` }];
}
}),
cloneDocument: builder.mutation({
query: ({ model, sourceId, data, params }) => ({
url: `/content-manager/collection-types/${model}/clone/${sourceId}`,
method: "POST",
data,
config: {
params
}
}),
invalidatesTags: (_result, _error, { model }) => [
{ type: "Document", id: `${model}_LIST` },
{ type: "UidAvailability", id: model }
]
}),
/**
* Creates a new collection-type document. This should ONLY be used for collection-types.
* single-types should always be using `updateDocument` since they always exist.
*/
createDocument: builder.mutation({
query: ({ model, data, params }) => ({
url: `/content-manager/collection-types/${model}`,
method: "POST",
data,
config: {
params
}
}),
invalidatesTags: (result, _error, { model }) => [
{ type: "Document", id: `${model}_LIST` },
"Relations",
{ type: "UidAvailability", id: model }
]
}),
deleteDocument: builder.mutation({
query: ({ collectionType, model, documentId, params }) => ({
url: `/content-manager/${collectionType}/${model}${collectionType !== SINGLE_TYPES && documentId ? `/${documentId}` : ""}`,
method: "DELETE",
config: {
params
}
}),
invalidatesTags: (_result, _error, { collectionType, model }) => [
{ type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model }
]
}),
deleteManyDocuments: builder.mutation({
query: ({ model, params, ...body }) => ({
url: `/content-manager/collection-types/${model}/actions/bulkDelete`,
method: "POST",
data: body,
config: {
params
}
}),
invalidatesTags: (_res, _error, { model }) => [{ type: "Document", id: `${model}_LIST` }]
}),
discardDocument: builder.mutation({
query: ({ collectionType, model, documentId, params }) => ({
url: documentId ? `/content-manager/${collectionType}/${model}/${documentId}/actions/discard` : `/content-manager/${collectionType}/${model}/actions/discard`,
method: "POST",
config: {
params
}
}),
invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {
return [
{
type: "Document",
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
},
{ type: "Document", id: `${model}_LIST` },
"Relations",
{ type: "UidAvailability", id: model }
];
}
}),
/**
* Gets all documents of a collection type or single type.
* By passing different params you can get different results e.g. only published documents or 'es' documents.
*/
getAllDocuments: builder.query({
query: ({ model, params }) => ({
url: `/content-manager/collection-types/${model}`,
method: "GET",
config: {
params: stringify(params, { encode: true })
}
}),
providesTags: (result, _error, arg) => {
return [
{ type: "Document", id: `ALL_LIST` },
{ type: "Document", id: `${arg.model}_LIST` },
...result?.results.map(({ documentId }) => ({
type: "Document",
id: `${arg.model}_${documentId}`
})) ?? []
];
}
}),
getDraftRelationCount: builder.query({
query: ({ collectionType, model, documentId, params }) => ({
url: documentId ? `/content-manager/${collectionType}/${model}/${documentId}/actions/countDraftRelations` : `/content-manager/${collectionType}/${model}/actions/countDraftRelations`,
method: "GET",
config: {
params
}
})
}),
getDocument: builder.query({
// @ts-expect-error – TODO: fix ts error where data unknown doesn't work with response via an assertion?
queryFn: async ({ collectionType, model, documentId, params }, _api, _extraOpts, baseQuery) => {
const res = await baseQuery({
url: `/content-manager/${collectionType}/${model}${documentId ? `/${documentId}` : ""}`,
method: "GET",
config: {
params
}
});
if (res.error && res.error.name === "NotFoundError" && collectionType === SINGLE_TYPES) {
return { data: { document: void 0 }, error: void 0 };
}
return res;
},
providesTags: (result, _error, { collectionType, model, documentId }) => {
return [
// we prefer the result's id because we don't fetch single-types with an ID.
{
type: "Document",
id: collectionType !== SINGLE_TYPES ? `${model}_${result && "documentId" in result ? result.documentId : documentId}` : model
},
// Make it easy to invalidate all individual documents queries for a model
{
type: "Document",
id: `${model}_ALL_ITEMS`
}
];
}
}),
getManyDraftRelationCount: builder.query({
query: ({ model, ...params }) => ({
url: `/content-manager/collection-types/${model}/actions/countManyEntriesDraftRelations`,
method: "GET",
config: {
params
}
}),
transformResponse: (response) => response.data
}),
/**
* This endpoint will either create or update documents at the same time as publishing.
*/
publishDocument: builder.mutation({
query: ({ collectionType, model, documentId, params, data }) => ({
url: documentId ? `/content-manager/${collectionType}/${model}/${documentId}/actions/publish` : `/content-manager/${collectionType}/${model}/actions/publish`,
method: "POST",
data,
config: {
params
}
}),
invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {
return [
{
type: "Document",
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
},
{ type: "Document", id: `${model}_LIST` },
"Relations"
];
}
}),
publishManyDocuments: builder.mutation({
query: ({ model, params, ...body }) => ({
url: `/content-manager/collection-types/${model}/actions/bulkPublish`,
method: "POST",
data: body,
config: {
params
}
}),
invalidatesTags: (_res, _error, { model, documentIds }) => documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` }))
}),
updateDocument: builder.mutation({
query: ({ collectionType, model, documentId, data, params }) => ({
url: `/content-manager/${collectionType}/${model}${documentId ? `/${documentId}` : ""}`,
method: "PUT",
data,
config: {
params
}
}),
invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {
return [
{
type: "Document",
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
},
"Relations",
{ type: "UidAvailability", id: model }
];
},
async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
const patchResult = dispatch(
documentApi.util.updateQueryData("getDocument", patch, (draft) => {
Object.assign(draft.data, data);
})
);
try {
await queryFulfilled;
} catch {
patchResult.undo();
}
}
}),
unpublishDocument: builder.mutation({
query: ({ collectionType, model, documentId, params, data }) => ({
url: documentId ? `/content-manager/${collectionType}/${model}/${documentId}/actions/unpublish` : `/content-manager/${collectionType}/${model}/actions/unpublish`,
method: "POST",
data,
config: {
params
}
}),
invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {
return [
{
type: "Document",
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
}
];
}
}),
unpublishManyDocuments: builder.mutation({
query: ({ model, params, ...body }) => ({
url: `/content-manager/collection-types/${model}/actions/bulkUnpublish`,
method: "POST",
data: body,
config: {
params
}
}),
invalidatesTags: (_res, _error, { model, documentIds }) => documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` }))
})
})
});
const {
useAutoCloneDocumentMutation,
useCloneDocumentMutation,
useCreateDocumentMutation,
useDeleteDocumentMutation,
useDeleteManyDocumentsMutation,
useDiscardDocumentMutation,
useGetAllDocumentsQuery,
useLazyGetDocumentQuery,
useGetDocumentQuery,
useLazyGetDraftRelationCountQuery,
useGetManyDraftRelationCountQuery,
usePublishDocumentMutation,
usePublishManyDocumentsMutation,
useUpdateDocumentMutation,
useUnpublishDocumentMutation,
useUnpublishManyDocumentsMutation
} = documentApi;
const buildValidParams = (query) => {
if (!query) return query;
const { plugins: _, ...validQueryParams } = {
...query,
...Object.values(query?.plugins ?? {}).reduce(
(acc, current) => Object.assign(acc, current),
{}
)
};
return validQueryParams;
};
const arrayValidator = (attribute, options) => ({
message: errorsTrads.required,
test(value) {
if (options.status === "draft") {
return true;
}
if (!attribute.required) {
return true;
}
if (!value) {
return false;
}
if (Array.isArray(value) && value.length === 0) {
return false;
}
return true;
}
});
const createYupSchema = (attributes = {}, components = {}, options = { status: null }) => {
const createModelSchema = (attributes2) => create$2().shape(
Object.entries(attributes2).reduce((acc, [name, attribute]) => {
if (DOCUMENT_META_FIELDS.includes(name)) {
return acc;
}
const validations = [
addNullableValidation,
addRequiredValidation,
addMinLengthValidation,
addMaxLengthValidation,
addMinValidation,
addMaxValidation,
addRegexValidation
].map((fn) => fn(attribute, options));
const transformSchema = pipe(...validations);
switch (attribute.type) {
case "component": {
const { attributes: attributes3 } = components[attribute.component];
if (attribute.repeatable) {
return {
...acc,
[name]: transformSchema(
create$1().of(createModelSchema(attributes3).nullable(false))
).test(arrayValidator(attribute, options))
};
} else {
return {
...acc,
[name]: transformSchema(createModelSchema(attributes3).nullable())
};
}
}
case "dynamiczone":
return {
...acc,
[name]: transformSchema(
create$1().of(
create(
(data) => {
const attributes3 = components?.[data?.__component]?.attributes;
const validation = create$2().shape({
__component: create$4().required().oneOf(Object.keys(components))
}).nullable(false);
if (!attributes3) {
return validation;
}
return validation.concat(createModelSchema(attributes3));
}
)
)
).test(arrayValidator(attribute, options))
};
case "relation":
return {
...acc,
[name]: transformSchema(
create((value) => {
if (!value) {
return create$6().nullable(true);
} else if (Array.isArray(value)) {
return create$1().of(
create$2().shape({
id: create$3().required()
})
);
} else if (typeof value === "object") {
return create$2();
} else {
return create$6().test(
"type-error",
"Relation values must be either null, an array of objects with {id} or an object.",
() => false
);
}
})
)
};
default:
return {
...acc,
[name]: transformSchema(createAttributeSchema(attribute))
};
}
}, {})
).default(null);
return createModelSchema(attributes);
};
const createAttributeSchema = (attribute) => {
switch (attribute.type) {
case "biginteger":
return create$4().matches(/^-?\d*$/);
case "boolean":
return create$5();
case "blocks":
return create$6().test("isBlocks", errorsTrads.json, (value) => {
if (!value || Array.isArray(value)) {
return true;
} else {
return false;
}
});
case "decimal":
case "float":
case "integer":
return create$3();
case "email":
return create$4().email(errorsTrads.email);
case "enumeration":
return create$4().oneOf([...attribute.enum, null]);
case "json":
return create$6().test("isJSON", errorsTrads.json, (value) => {
if (!value || typeof value === "string" && value.length === 0) {
return true;
}
if (typeof value === "object") {
try {
JSON.stringify(value);
return true;
} catch (err) {
return false;
}
}
try {
JSON.parse(value);
return true;
} catch (err) {
return false;
}
});
case "password":
case "richtext":
case "string":
case "text":
return create$4();
case "uid":
return create$4().matches(/^[A-Za-z0-9-_.~]*$/);
default:
return create$6();
}
};
const nullableSchema = (schema) => {
return schema?.nullable ? schema.nullable() : (
// In some cases '.nullable' will not be available on the schema.
// e.g. when the schema has been built using yup.lazy (e.g. for relations).
// In these cases we should just return the schema as it is.
schema
);
};
const addNullableValidation = () => (schema) => {
return nullableSchema(schema);
};
const addRequiredValidation = (attribute, options) => (schema) => {
if (options.status === "draft" || !attribute.required) {
return schema;
}
if (attribute.required && "required" in schema) {
return schema.required(errorsTrads.required);
}
return schema;
};
const addMinLengthValidation = (attribute, options) => (schema) => {
if (options.status === "draft") {
return schema;
}
if ("minLength" in attribute && attribute.minLength && Number.isInteger(attribute.minLength) && "min" in schema) {
return schema.min(attribute.minLength, {
...errorsTrads.minLength,
values: {
min: attribute.minLength
}
});
}
return schema;
};
const addMaxLengthValidation = (attribute) => (schema) => {
if ("maxLength" in attribute && attribute.maxLength && Number.isInteger(attribute.maxLength) && "max" in schema) {
return schema.max(attribute.maxLength, {
...errorsTrads.maxLength,
values: {
max: attribute.maxLength
}
});
}
return schema;
};
const addMinValidation = (attribute, options) => (schema) => {
if (options.status === "draft") {
return schema;
}
if ("min" in attribute && "min" in schema) {
const min = toInteger(attribute.min);
if (min) {
return schema.min(min, {
...errorsTrads.min,
values: {
min
}
});
}
}
return schema;
};
const addMaxValidation = (attribute) => (schema) => {
if ("max" in attribute) {
const max = toInteger(attribute.max);
if ("max" in schema && max) {
return schema.max(max, {
...errorsTrads.max,
values: {
max
}
});
}
}
return schema;
};
const toInteger = (val) => {
if (typeof val === "number" || val === void 0) {
return val;
} else {
const num = Number(val);
return isNaN(num) ? void 0 : num;
}
};
const addRegexValidation = (attribute) => (schema) => {
if ("regex" in attribute && attribute.regex && "matches" in schema) {
return schema.matches(new RegExp(attribute.regex), {
message: {
id: errorsTrads.regex.id,
defaultMessage: "The value does not match the defined pattern."
},
excludeEmptyString: !attribute.required
});
}
return schema;
};
const initApi = contentManagerApi.injectEndpoints({
endpoints: (builder) => ({
getInitialData: builder.query({
query: () => "/content-manager/init",
transformResponse: (response) => response.data,
providesTags: ["InitialData"]
})
})
});
const { useGetInitialDataQuery } = initApi;
const useContentTypeSchema = (model) => {
const { toggleNotification } = useNotification();
const { _unstableFormatAPIError: formatAPIError2 } = useAPIErrorHandler();
const { data, error, isLoading, isFetching } = useGetInitialDataQuery(void 0);
const { components, contentType, contentTypes } = React.useMemo(() => {
const contentType2 = data?.contentTypes.find((ct) => ct.uid === model);
const componentsByKey = data?.components.reduce((acc, component) => {
acc[component.uid] = component;
return acc;
}, {});
const components2 = extractContentTypeComponents(contentType2?.attributes, componentsByKey);
return {
components: Object.keys(components2).length === 0 ? void 0 : components2,
contentType: contentType2,
contentTypes: data?.contentTypes ?? []
};
}, [model, data]);
React.useEffect(() => {
if (error) {
toggleNotification({
type: "danger",
message: formatAPIError2(error)
});
}
}, [toggleNotification, error, formatAPIError2]);
return {
// This must be memoized to avoid inifiinite re-renders where the empty object is different everytime.
components: React.useMemo(() => components ?? {}, [components]),
schema: contentType,
schemas: contentTypes,
isLoading: isLoading || isFetching
};
};
const extractContentTypeComponents = (attributes = {}, allComponents = {}) => {
const getComponents = (attributes2) => {
return attributes2.reduce((acc, attribute) => {
if (attribute.type === "component") {
const componentAttributes = Object.values(
allComponents[attribute.component]?.attributes ?? {}
);
acc.push(attribute.component, ...getComponents(componentAttributes));
} else if (attribute.type === "dynamiczone") {
acc.push(
...attribute.components,
...attribute.components.flatMap((componentUid) => {
const componentAttributes = Object.values(
allComponents[componentUid]?.attributes ?? {}
);
return getComponents(componentAttributes);
})
);
}
return acc;
}, []);
};
const componentUids = getComponents(Object.values(attributes));
const uniqueComponentUids = [...new Set(componentUids)];
const componentsByKey = uniqueComponentUids.reduce((acc, uid) => {
acc[uid] = allComponents[uid];
return acc;
}, {});
return componentsByKey;
};
const HOOKS = {
/**
* Hook that allows to mutate the displayed headers of the list view table
* @constant
* @type {string}
*/
INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
/**
* Hook that allows to mutate the CM's collection types links pre-set filters
* @constant
* @type {string}
*/
MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
/**
* Hook that allows to mutate the CM's edit view layout
* @constant
* @type {string}
*/
MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
/**
* Hook that allows to mutate the CM's single types links pre-set filters
* @constant
* @type {string}
*/
MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
};
const contentTypesApi = contentManagerApi.injectEndpoints({
endpoints: (builder) => ({
getContentTypeConfiguration: builder.query({
query: (uid) => ({
url: `/content-manager/content-types/${uid}/configuration`,
method: "GET"
}),
transformResponse: (response) => response.data,
providesTags: (_result, _error, uid) => [
{ type: "ContentTypesConfiguration", id: uid },
{ type: "ContentTypeSettings", id: "LIST" }
]
}),
getAllContentTypeSettings: builder.query({
query: () => "/content-manager/content-types-settings",
transformResponse: (response) => response.data,
providesTags: [{ type: "ContentTypeSettings", id: "LIST" }]
}),
updateContentTypeConfiguration: builder.mutation({
query: ({ uid, ...body }) => ({
url: `/content-manager/content-types/${uid}/configuration`,
method: "PUT",
data: body
}),
transformResponse: (response) => response.data,
invalidatesTags: (_result, _error, { uid }) => [
{ type: "ContentTypesConfiguration", id: uid },
{ type: "ContentTypeSettings", id: "LIST" },
// Is this necessary?
{ type: "InitialData" }
]
})
})
});
const {
useGetContentTypeConfigurationQuery,
useGetAllContentTypeSettingsQuery,
useUpdateContentTypeConfigurationMutation
} = contentTypesApi;
const checkIfAttributeIsDisplayable = (attribute) => {
const { type } = attribute;
if (type === "relation") {
return !attribute.relation.toLowerCase().includes("morph");
}
return !["json", "dynamiczone", "richtext", "password", "blocks"].includes(type) && !!type;
};
const getMainField = (attribute, mainFieldName, { schemas, components }) => {
if (!mainFieldName) {
return void 0;
}
const mainFieldType = attribute.type === "component" ? components[attribute.component].attributes[mainFieldName].type : (
// @ts-expect-error – `targetModel` does exist on the attribute for a relation.
schemas.find((schema) => schema.uid === attribute.targetModel)?.attributes[mainFieldName].type
);
return {
name: mainFieldName,
type: mainFieldType ?? "string"
};
};
const DEFAULT_SETTINGS = {
bulkable: false,
filterable: false,
searchable: false,
pagination: false,
defaultSortBy: "",
defaultSortOrder: "asc",
mainField: "id",
pageSize: 10
};
const useDocumentLayout = (model) => {
const { schema, components } = useDocument({ model, collectionType: "" }, { skip: true });
const [{ query }] = useQueryParams();
const runHookWaterfall = useStrapiApp("useDocumentLayout", (state) => state.runHookWaterfall);
const { toggleNotification } = useNotification();
const { _unstableFormatAPIError: formatAPIError2 } = useAPIErrorHandler();
const { isLoading: isLoadingSchemas, schemas } = useContentTypeSchema();
const {
data,
isLoading: isLoadingConfigs,
error,
isFetching: isFetchingConfigs
} = useGetContentTypeConfigurationQuery(model);
const isLoading = isLoadingSchemas || isFetchingConfigs || isLoadingConfigs;
React.useEffect(() => {
if (error) {
toggleNotification({
type: "danger",
message: formatAPIError2(error)
});
}
}, [error, formatAPIError2, toggleNotification]);
const editLayout = React.useMemo(
() => data && !isLoading ? formatEditLayout(data, { schemas, schema, components }) : {
layout: [],
components: {},
metadatas: {},
options: {},
settings: DEFAULT_SETTINGS
},
[data, isLoading, schemas, schema, components]
);
const listLayout = React.useMemo(() => {
return data && !isLoading ? formatListLayout(data, { schemas, schema, components }) : {
layout: [],
metadatas: {},
options: {},
settings: DEFAULT_SETTINGS
};
}, [data, isLoading, schemas, schema, components]);
const { layout: edit } = React.useMemo(
() => runHookWaterfall(HOOKS.MUTATE_EDIT_VIEW_LAYOUT, {
layout: editLayout,
query
}),
[editLayout, query, runHookWaterfall]
);
return {
error,
isLoading,
edit,
list: listLayout
};
};
const useDocLayout = () => {
const { model } = useDoc();
return useDocumentLayout(model);
};
const formatEditLayout = (data, {
schemas,
schema,
components
}) => {
let currentPanelIndex = 0;
const panelledEditAttributes = convertEditLayoutToFieldLayouts(
data.contentType.layouts.edit,
schema?.attributes,
data.contentType.metadatas,
{ configurations: data.components, schemas: components },
schemas
).reduce((panels, row) => {
if (row.some((field) => field.type === "dynamiczone")) {
panels.push([row]);
currentPanelIndex += 2;
} else {
if (!panels[currentPanelIndex]) {
panels.push([row]);
} else {
panels[currentPanelIndex].push(row);
}
}
return panels;
}, []);
const componentEditAttributes = Object.entries(data.components).reduce(
(acc, [uid, configuration]) => {
acc[uid] = {
layout: convertEditLayoutToFieldLayouts(
configuration.layouts.edit,
components[uid].attributes,
configuration.metadatas,
{ configurations: data.components, schemas: components }
),
settings: {
...configuration.settings,
icon: components[uid].info.icon,
displayName: components[uid].info.displayName
}
};
return acc;
},
{}
);
const editMetadatas = Object.entries(data.contentType.metadatas).reduce(
(acc, [attribute, metadata]) => {
return {
...acc,
[attribute]: metadata.edit
};
},
{}
);
return {
layout: panelledEditAttributes,
components: componentEditAttributes,
metadatas: editMetadatas,
settings: {
...data.contentType.settings,
displayName: schema?.info.displayName
},
options: {
...schema?.options,
...schema?.pluginOptions,
...data.contentType.options
}
};
};
const convertEditLayoutToFieldLayouts = (rows, attributes = {}, metadatas, components, schemas = []) => {
return rows.map(
(row) => row.map((field) => {
const attribute = attributes[field.name];
if (!attribute) {
return null;
}
const { edit: metadata } = metadatas[field.name];
const settings = attribute.type === "component" && components ? components.configurations[attribute.component].settings : {};
return {
attribute,
disabled: !metadata.editable,
hint: metadata.description,
label: metadata.label ?? "",
name: field.name,
// @ts-expect-error – mainField does exist on the metadata for a relation.
mainField: getMainField(attribute, metadata.mainField || settings.mainField, {
schemas,
components: components?.schemas ?? {}
}),
placeholder: metadata.placeholder ?? "",
required: attribute.required ?? false,
size: field.size,
unique: "unique" in attribute ? attribute.unique : false,
visible: metadata.visible ?? true,
type: attribute.type
};
}).filter((field) => field !== null)
);
};
const formatListLayout = (data, {
schemas,
schema,
components
}) => {
const listMetadatas = Object.entries(data.contentType.metadatas).reduce(
(acc, [attribute, metadata]) => {
return {
...acc,
[attribute]: metadata.list
};
},
{}
);
const listAttributes = convertListLayoutToFieldLayouts(
data.contentType.layouts.list,
schema?.attributes,
listMetadatas,
{ configurations: data.components, schemas: components },
schemas
);
return {
layout: listAttributes,
settings: { ...data.contentType.settings, displayName: schema?.info.displayName },
metadatas: listMetadatas,
options: {
...schema?.options,
...schema?.pluginOptions,
...data.contentType.options
}
};
};
const convertListLayoutToFieldLayouts = (columns, attributes = {}, metadatas, components, schemas = []) => {
return columns.map((name) => {
const attribute = attributes[name];
if (!attribute) {
return null;
}
const metadata = metadatas[name];
const settings = attribute.type === "component" && components ? components.configurations[attribute.component].settings : {};
return {
attribute,
label: metadata.label ?? "",
mainField: getMainField(attribute, metadata.mainField || settings.mainField, {
schemas,
components: components?.schemas ?? {}
}),
name,
searchable: metadata.searchable ?? true,
sortable: metadata.sortable ?? true
};
}).filter((field) => field !== null);
};
const useDocument = (args, opts) => {
const { toggleNotification } = useNotification();
const { _unstableFormatAPIError: formatAPIError2 } = useAPIErrorHandler();
const {
currentData: data,
isLoading: isLoadingDocument,
isFetching: isFetchingDocument,
error
} = useGetDocumentQuery(args, {
...opts,
skip: !args.documentId && args.collectionType !== SINGLE_TYPES || opts?.skip
});
const {
components,
schema,
schemas,
isLoading: isLoadingSchema
} = useContentTypeSchema(args.model);
React.useEffect(() => {
if (error) {
toggleNotification({
type: "danger",
message: formatAPIError2(error)
});
}
}, [toggleNotification, error, formatAPIError2, args.collectionType]);
const validationSchema = React.useMemo(() => {
if (!schema) {
return null;
}
return createYupSchema(schema.attributes, components);
}, [schema, components]);
const validate = React.useCallback(
(document2) => {
if (!validationSchema) {
throw new Error(
"There is no validation schema generated, this is likely due to the schema not being loaded yet."
);
}
try {
validationSchema.validateSync(document2, { abortEarly: false, strict: true });
return null;
} catch (error2) {
if (error2 instanceof ValidationError) {
return getYupValidationErrors(error2);
}
throw error2;
}
},
[validationSchema]
);
const isLoading = isLoadingDocument || isFetchingDocument || isLoadingSchema;
const hasError = !!error;
return {
components,
document: data?.data,
meta: data?.meta,
isLoading,
hasError,
schema,
schemas,
validate
};
};
const useDoc = () => {
const { id, slug, collectionType, origin: origin2 } = useParams();
const [{ query }] = useQueryParams();
const params = React.useMemo(() => buildValidParams(query), [query]);
if (!collectionType) {
throw new Error("Could not find collectionType in url params");
}
if (!slug) {
throw new Error("Could not find model in url params");
}
const document2 = useDocument(
{ documentId: origin2 || id, model: slug, collectionType, params },
{
skip: id === "create" || !origin2 && !id && collectionType !== SINGLE_TYPES
}
);
const returnId = origin2 || id === "create" ? void 0 : id;
return {
collectionType,
model: slug,
id: returnId,
...document2
};
};
const getTranslation = (id) => `content-manager.${id}`;
React.lazy(
() => import("./History-C4X3jiQJ-hronsbVm.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
);
React.lazy(
() => import("./Preview-DwWET-X7-CpNCl-7B.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
);
lazy(
() => import("./EditViewPage-D2FPb5Mh-CMKTkRbn.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
);
lazy(
() => import("./ListViewPage-CvxfiNTc-BNHNQRqx.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
);
lazy(
() => import("./ListConfigurationPage-CwMU6tWQ-ChVutdE6.mjs").then((mod) => ({
default: mod.ProtectedListConfiguration
}))
);
lazy(
() => import("./EditConfigurationPage-DKtPyjs_-B4d-ytpw.mjs").then((mod) => ({
default: mod.ProtectedEditConfigurationPage
}))
);
lazy(
() => import("./ComponentConfigurationPage-viOAdZM6-CrRzLSIo.mjs").then((mod) => ({
default: mod.ProtectedComponentConfigurationPage
}))
);
lazy(
() => import("./NoPermissionsPage-DiW-TIzq-DNgGqsTn.mjs").then((mod) => ({ default: mod.NoPermissions }))
);
lazy(
() => import("./NoContentTypePage-Dy6sa9LT-DWZS6cyK.mjs").then((mod) => ({ default: mod.NoContentType }))
);
const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
const DocumentActions = ({ actions: actions2 }) => {
const { formatMessage } = useIntl();
const [primaryAction, secondaryAction, ...restActions] = actions2.filter((action) => {
if (action.position === void 0) {
return true;
}
const positions = Array.isArray(action.position) ? action.position : [action.position];
return positions.includes("panel");
});
if (!primaryAction) {
return null;
}
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, alignItems: "stretch", width: "100%", children: [
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
/* @__PURE__ */ jsx(DocumentActionButton, { ...primaryAction, variant: primaryAction.variant || "default" }),
restActions.length > 0 ? /* @__PURE__ */ jsx(
DocumentActionsMenu,
{
actions: restActions,
label: formatMessage({
id: "content-manager.containers.edit.panels.default.more-actions",
defaultMessage: "More document actions"
})
}
) : null
] }),
secondaryAction ? /* @__PURE__ */ jsx(
DocumentActionButton,
{
...secondaryAction,
variant: secondaryAction.variant || "secondary"
}
) : null
] });
};
const DocumentActionButton = (action) => {
const [dialogId, setDialogId] = React.useState(null);
const { toggleNotification } = useNotification();
const handleClick = (action2) => async (e) => {
const { onClick = () => false, dialog, id } = action2;
const muteDialog = await onClick(e);
if (dialog && !muteDialog) {
switch (dialog.type) {
case "notification":
toggleNotification({
title: dialog.title,
message: dialog.content,
type: dialog.status,
timeout: dialog.timeout,
onClose: dialog.onClose
});
break;
case "dialog":
case "modal":
e.preventDefault();
setDialogId(id);
}
}
};
const handleClose = () => {
setDialogId(null);
};
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(
Button,
{
flex: "auto",
startIcon: action.icon,
disabled: action.disabled,
onClick: handleClick(action),
justifyContent: "center",
variant: action.variant || "default",
paddingTop: "7px",
paddingBottom: "7px",
children: action.label
}
),
action.dialog?.type === "dialog" ? /* @__PURE__ */ jsx(
DocumentActionConfirmDialog,
{
...action.dialog,
variant: action.dialog?.variant ?? action.variant,
isOpen: dialogId === action.id,
onClose: handleClose
}
) : null,
action.dialog?.type === "modal" ? /* @__PURE__ */ jsx(
DocumentActionModal,
{
...action.dialog,
onModalClose: handleClose,
isOpen: dialogId === action.id
}
) : null
] });
};
const MenuItem = styled$1(Menu.Item)`
&:hover {
background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
}
`;
const DocumentActionsMenu = ({
actions: actions2,
children,
label,
variant = "tertiary"
}) => {
const [isOpen, setIsOpen] = React.useState(false);
const [dialogId, setDialogId] = React.useState(null);
const { formatMessage } = useIntl();
const { toggleNotification } = useNotification();
const isDisabled = actions2.every((action) => action.disabled) || actions2.length === 0;
const handleClick = (action) => async (e) => {
const { onClick = () => false, dialog, id } = action;
const muteDialog = await onClick(e);
if (dialog && !muteDialog) {
switch (dialog.type) {
case "notification":
toggleNotification({
title: dialog.title,
message: dialog.content,
type: dialog.status,
timeout: dialog.timeout,
onClose: dialog.onClose
});
break;
case "dialog":
case "modal":
setDialogId(id);
}
}
};
const handleClose = () => {
setDialogId(null);
setIsOpen(false);
};
return /* @__PURE__ */ jsxs(Menu.Root, { open: isOpen, onOpenChange: setIsOpen, children: [
/* @__PURE__ */ jsxs(
Menu.Trigger,
{
disabled: isDisabled,
size: "S",
endIcon: null,
paddingTop: "4px",
paddingLeft: "7px",
paddingRight: "7px",
variant,
children: [
/* @__PURE__ */ jsx(ForwardRef$1R, { "aria-hidden": true, focusable: false }),
/* @__PURE__ */ jsx(VisuallyHidden, { tag: "span", children: label || formatMessage({
id: "content-manager.containers.edit.panels.default.more-actions",
defaultMessage: "More document actions"
}) })
]
}
),
/* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
actions2.map((action) => {
return /* @__PURE__ */ jsx(
MenuItem,
{
disabled: action.disabled,
onSelect: handleClick(action),
display: "block",
isVariantDanger: action.variant === "danger",
isDisabled: action.disabled,
children: /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxs(
Flex,
{
color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
gap: 2,
tag: "span",
children: [
/* @__PURE__ */ jsx(
Flex,
{
tag: "span",
color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
children: action.icon
}
),
action.label
]
}
) })
},
action.id
);
}),
children
] }),
actions2.map((action) => {
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
action.dialog?.type === "dialog" ? /* @__PURE__ */ jsx(
DocumentActionConfirmDialog,
{
...action.dialog,
variant: action.variant,
isOpen: dialogId === action.id,
onClose: handleClose
}
) : null,
action.dialog?.type === "modal" ? /* @__PURE__ */ jsx(
DocumentActionModal,
{
...action.dialog,
onModalClose: handleClose,
isOpen: dialogId === action.id
}
) : null
] }, action.id);
})
] });
};
const convertActionVariantToColor = (variant = "secondary") => {
switch (variant) {
case "danger":
return "danger600";
case "secondary":
return void 0;
case "success":
return "success600";
default:
return "primary600";
}
};
const convertActionVariantToIconColor = (variant = "secondary") => {
switch (variant) {
case "danger":
return "danger600";
case "secondary":
return "neutral500";
case "success":
return "success600";
default:
return "primary600";
}
};
const DocumentActionConfirmDialog = ({
onClose,
onCancel,
onConfirm,
title,
content,
isOpen,
variant = "secondary"
}) => {
const { formatMessage } = useIntl();
const handleClose = async () => {
if (onCancel) {
await onCancel();
}
onClose();
};
const handleConfirm = async () => {
if (onConfirm) {
await onConfirm();
}
onClose();
};
return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
/* @__PURE__ */ jsx(Dialog.Header, { children: title }),
/* @__PURE__ */ jsx(Dialog.Body, { children: content }),
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", fullWidth: true, children: formatMessage({
id: "app.components.Button.cancel",
defaultMessage: "Cancel"
}) }) }),
/* @__PURE__ */ jsx(Button, { onClick: handleConfirm, variant, fullWidth: true, children: formatMessage({
id: "app.components.Button.confirm",
defaultMessage: "Confirm"
}) })
] })
] }) });
};
const DocumentActionModal = ({
isOpen,
title,
onClose,
footer: Footer,
content: Content2,
onModalClose
}) => {
const handleClose = () => {
if (onClose) {
onClose();
}
onModalClose();
};
return /* @__PURE__ */ jsx(Modal.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
/* @__PURE__ */ jsx(Modal.Header, { children: /* @__PURE__ */ jsx(Modal.Title, { children: title }) }),
typeof Content2 === "function" ? /* @__PURE__ */ jsx(Content2, { onClose: handleClose }) : /* @__PURE__ */ jsx(Modal.Body, { children: Content2 }),
typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
] }) });
};
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
const RelativeTime = React.forwardRef(
({ timestamp, customIntervals = [], ...restProps }, forwardedRef) => {
const { formatRelativeTime, formatDate, formatTime } = useIntl();
const interval = intervalToDuration({
start: timestamp,
end: Date.now()
// see https://github.com/date-fns/date-fns/issues/2891 – No idea why it's all partial it returns it every time.
});
const unit = intervals.find((intervalUnit) => {
return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
}) ?? "seconds";
const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
const customInterval = customIntervals.find(
(custom) => interval[custom.unit] < custom.threshold
);
const displayText = customInterval ? customInterval.text : formatRelativeTime(relativeTime, unit, { numeric: "auto" });
return /* @__PURE__ */ jsx(
"time",
{
ref: forwardedRef,
dateTime: timestamp.toISOString(),
role: "time",
title: `${formatDate(timestamp)} ${formatTime(timestamp)}`,
...restProps,
children: displayText
}
);
}
);
const getDisplayName = ({
firstname,
lastname,
username,
email
} = {}) => {
if (username) {
return username;
}
if (firstname) {
return `${firstname} ${lastname ?? ""}`.trim();
}
return email ?? "";
};
const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
const { formatMessage } = useIntl();
return /* @__PURE__ */ jsx(Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
id: `content-manager.containers.List.${status}`,
defaultMessage: capitalise(status)
}) }) });
};
const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
const { formatMessage } = useIntl();
const isCloning = useMatch(CLONE_PATH) !== null;
const params = useParams();
const title = isCreating ? formatMessage({
id: "content-manager.containers.edit.title.new",
defaultMessage: "Create an entry"
}) : documentTitle;
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
/* @__PURE__ */ jsx(
BackButton,
{
fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
}
),
/* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
/* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
/* @__PURE__ */ jsx(HeaderToolbar, {})
] }),
status ? /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(DocumentStatus, { status: isCloning ? "draft" : status }) }) : null
] });
};
const HeaderToolbar = () => {
const { formatMessage } = useIntl();
const isCloning = useMatch(CLONE_PATH) !== null;
const [
{
query: { status = "draft" }
}
] = useQueryParams();
const { model, id, document: document2, meta, collectionType } = useDoc();
const plugins = useStrapiApp("HeaderToolbar", (state) => state.plugins);
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
/* @__PURE__ */ jsx(
DescriptionComponentRenderer,
{
props: {
activeTab: status,
model,
documentId: id,
document: isCloning ? void 0 : document2,
meta: isCloning ? void 0 : meta,
collectionType
},
descriptions: plugins["content-manager"].apis.getHeaderActions(),
children: (actions2) => {
if (actions2.length > 0) {
return /* @__PURE__ */ jsx(HeaderActions, { actions: actions2 });
} else {
return null;
}
}
}
),
/* @__PURE__ */ jsx(
DescriptionComponentRenderer,
{
props: {
activeTab: status,
model,
documentId: id,
document: isCloning ? void 0 : document2,
meta: isCloning ? void 0 : meta,
collectionType
},
descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
children: (actions2) => {
const headerActions = actions2.filter((action) => {
const positions = Array.isArray(action.position) ? action.position : [action.position];
return positions.includes("header");
});
return /* @__PURE__ */ jsx(
DocumentActionsMenu,
{
actions: headerActions,
label: formatMessage({
id: "content-manager.containers.edit.header.more-actions",
defaultMessage: "More actions"
}),
children: /* @__PURE__ */ jsx(Information, { activeTab: status })
}
);
}
}
)
] });
};
const Information = ({ activeTab }) => {
const { formatMessage } = useIntl();
const { document: document2, meta } = useDoc();
if (!document2 || !document2.id) {
return null;
}
const createAndUpdateDocument = activeTab === "draft" ? document2 : meta?.availableStatus.find((status) => status.publishedAt === null);
const publishDocument = activeTab === "published" ? document2 : meta?.availableStatus.find((status) => status.publishedAt !== null);
const creator = createAndUpdateDocument?.[CREATED_BY_ATTRIBUTE_NAME] ? getDisplayName(createAndUpdateDocument[CREATED_BY_ATTRIBUTE_NAME]) : null;
const updator = createAndUpdateDocument?.[UPDATED_BY_ATTRIBUTE_NAME] ? getDisplayName(createAndUpdateDocument[UPDATED_BY_ATTRIBUTE_NAME]) : null;
const information = [
{
isDisplayed: !!publishDocument?.[PUBLISHED_AT_ATTRIBUTE_NAME],
label: formatMessage({
id: "content-manager.containers.edit.information.last-published.label",
defaultMessage: "Published"
}),
value: formatMessage(
{
id: "content-manager.containers.edit.information.last-published.value",
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
},
{
time: /* @__PURE__ */ jsx(RelativeTime, { timestamp: new Date(publishDocument?.[PUBLISHED_AT_ATTRIBUTE_NAME]) }),
isAnonymous: !publishDocument?.[PUBLISHED_BY_ATTRIBUTE_NAME],
author: publishDocument?.[PUBLISHED_BY_ATTRIBUTE_NAME] ? getDisplayName(publishDocument?.[PUBLISHED_BY_ATTRIBUTE_NAME]) : null
}
)
},
{
isDisplayed: !!createAndUpdateDocument?.[UPDATED_AT_ATTRIBUTE_NAME],
label: formatMessage({
id: "content-manager.containers.edit.information.last-draft.label",
defaultMessage: "Updated"
}),
value: formatMessage(
{
id: "content-manager.containers.edit.information.last-draft.value",
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
},
{
time: /* @__PURE__ */ jsx(
RelativeTime,
{
timestamp: new Date(createAndUpdateDocument?.[UPDATED_AT_ATTRIBUTE_NAME])
}
),
isAnonymous: !updator,
author: updator
}
)
},
{
isDisplayed: !!createAndUpdateDocument?.[CREATED_AT_ATTRIBUTE_NAME],
label: formatMessage({
id: "content-manager.containers.edit.information.document.label",
defaultMessage: "Created"
}),
value: formatMessage(
{
id: "content-manager.containers.edit.information.document.value",
defaultMessage: `{time}{isAnonymous, select, true {} other { by {author}}}`
},
{
time: /* @__PURE__ */ jsx(
RelativeTime,
{
timestamp: new Date(createAndUpdateDocument?.[CREATED_AT_ATTRIBUTE_NAME])
}
),
isAnonymous: !creator,
author: creator
}
)
}
].filter((info) => info.isDisplayed);
return /* @__PURE__ */ jsx(
Flex,
{
borderWidth: "1px 0 0 0",
borderStyle: "solid",
borderColor: "neutral150",
direction: "column",
marginTop: 2,
tag: "dl",
padding: 5,
gap: 3,
alignItems: "flex-start",
marginLeft: "-0.4rem",
marginRight: "-0.4rem",
width: "calc(100% + 8px)",
children: information.map((info) => /* @__PURE__ */ jsxs(Flex, { gap: 1, direction: "column", alignItems: "flex-start", children: [
/* @__PURE__ */ jsx(Typography, { tag: "dt", variant: "pi", fontWeight: "bold", children: info.label }),
/* @__PURE__ */ jsx(Typography, { tag: "dd", variant: "pi", textColor: "neutral600", children: info.value })
] }, info.label))
}
);
};
const HeaderActions = ({ actions: actions2 }) => {
const [dialogId, setDialogId] = React.useState(null);
const handleClick = (action) => async (e) => {
if (!("options" in action)) {
const { onClick = () => false, dialog, id } = action;
const muteDialog = await onClick(e);
if (dialog && !muteDialog) {
e.preventDefault();
setDialogId(id);
}
}
};
const handleClose = () => {
setDialogId(null);
};
return /* @__PURE__ */ jsx(Flex, { gap: 1, children: actions2.map((action) => {
if (action.options) {
return /* @__PURE__ */ jsx(
SingleSelect,
{
size: "S",
onChange: action.onSelect,
"aria-label": action.label,
...action,
children: action.options.map(({ label, ...option }) => /* @__PURE__ */ jsx(SingleSelectOption, { ...option, children: label }, option.value))
},
action.id
);
} else {
if (action.type === "icon") {
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
/* @__PURE__ */ jsx(
IconButton,
{
disabled: action.disabled,
label: action.label,
size: "S",
onClick: handleClick(action),
children: action.icon
}
),
action.dialog ? /* @__PURE__ */ jsx(
HeaderActionDialog,
{
...action.dialog,
isOpen: dialogId === action.id,
onClose: handleClose
}
) : null
] }, action.id);
}
}
}) });
};
const HeaderActionDialog = ({
onClose,
onCancel,
title,
content: Content2,
isOpen
}) => {
const handleClose = async () => {
if (onCancel) {
await onCancel();
}
onClose();
};
return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
/* @__PURE__ */ jsx(Dialog.Header, { children: title }),
typeof Content2 === "function" ? /* @__PURE__ */ jsx(Content2, { onClose: handleClose }) : Content2
] }) });
};
const Panels = () => {
const isCloning = useMatch(CLONE_PATH) !== null;
const [
{
query: { status }
}
] = useQueryParams({
status: "draft"
});
const { model, id, document: document2, meta, collectionType } = useDoc();
const plugins = useStrapiApp("Panels", (state) => state.plugins);
const props = {
activeTab: status,
model,
documentId: id,
document: isCloning ? void 0 : document2,
meta: isCloning ? void 0 : meta,
collectionType
};
return /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: /* @__PURE__ */ jsx(
DescriptionComponentRenderer,
{
props,
descriptions: plugins["content-manager"].apis.getEditViewSidePanels(),
children: (panels) => panels.map(({ content, id: id2, ...description }) => /* @__PURE__ */ jsx(Panel, { ...description, children: content }, id2))
}
) });
};
const ActionsPanel = () => {
const { formatMessage } = useIntl();
return {
title: formatMessage({
id: "content-manager.containers.edit.panels.default.title",
defaultMessage: "Entry"
}),
content: /* @__PURE__ */ jsx(ActionsPanelContent, {})
};
};
ActionsPanel.type = "actions";
const ActionsPanelContent = () => {
const isCloning = useMatch(CLONE_PATH) !== null;
const [
{
query: { status = "draft" }
}
] = useQueryParams();
const { model, id, document: document2, meta, collectionType } = useDoc();
const plugins = useStrapiApp("ActionsPanel", (state) => state.plugins);
const props = {
activeTab: status,
model,
documentId: id,
document: isCloning ? void 0 : document2,
meta: isCloning ? void 0 : meta,
collectionType
};
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, width: "100%", children: [
/* @__PURE__ */ jsx(
DescriptionComponentRenderer,
{
props,
descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
children: (actions2) => /* @__PURE__ */ jsx(DocumentActions, { actions: actions2 })
}
),
/* @__PURE__ */ jsx(InjectionZone, { area: "editView.right-links", slug: model })
] });
};
const Panel = React.forwardRef(({ children, title }, ref) => {
return /* @__PURE__ */ jsxs(
Flex,
{
ref,
tag: "aside",
"aria-labelledby": "additional-information",
background: "neutral0",
borderColor: "neutral150",
hasRadius: true,
paddingBottom: 4,
paddingLeft: 4,
paddingRight: 4,
paddingTop: 4,
shadow: "tableShadow",
gap: 3,
direction: "column",
justifyContent: "stretch",
alignItems: "flex-start",
children: [
/* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", textColor: "neutral600", children: title }),
children
]
}
);
});
styled$1(Typography)`
max-width: 300px;
`;
const BulkActionsRenderer = () => {
const plugins = useStrapiApp("BulkActionsRenderer", (state) => state.plugins);
const { model, collectionType } = useDoc();
const { selectedRows } = useTable("BulkActionsRenderer", (state) => state);
return /* @__PURE__ */ jsx(Flex, { gap: 2, children: /* @__PURE__ */ jsx(
DescriptionComponentRenderer,
{
props: {
model,
collectionType,
documents: selectedRows
},
descriptions: plugins["content-manager"].apis.getBulkActions(),
children: (actions2) => actions2.map((action) => /* @__PURE__ */ jsx(DocumentActionButton, { ...action }, action.id))
}
) });
};
const TableActions = ({ document: document2 }) => {
const { formatMessage } = useIntl();
const { model, collectionType } = useDoc();
const plugins = useStrapiApp("TableActions", (state) => state.plugins);
const props = {
activeTab: null,
model,
documentId: document2.documentId,
collectionType,
document: document2
};
return /* @__PURE__ */ jsx(
DescriptionComponentRenderer,
{
props,
descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
children: (actions2) => {
const tableRowActions = actions2.filter((action) => {
const positions = Array.isArray(action.position) ? action.position : [action.position];
return positions.includes("table-row");
});
return /* @__PURE__ */ jsx(
DocumentActionsMenu,
{
actions: tableRowActions,
label: formatMessage({
id: "content-manager.containers.list.table.row-actions",
defaultMessage: "Row action"
}),
variant: "ghost"
}
);
}
}
);
};
styled$1(ForwardRef$1r)`
path {
fill: currentColor;
}
`;
styled$1(ForwardRef$3L)`
path {
fill: currentColor;
}
`;
const initialState$1 = {
collectionTypeLinks: [],
components: [],
fieldSizes: {},
models: [],
singleTypeLinks: [],
isLoading: true
};
const appSlice = createSlice({
name: "app",
initialState: initialState$1,
reducers: {
setInitialData(state, action) {
const {
authorizedCollectionTypeLinks,
authorizedSingleTypeLinks,
components,
contentTypeSchemas,
fieldSizes
} = action.payload;
state.collectionTypeLinks = authorizedCollectionTypeLinks.filter(
({ isDisplayed }) => isDisplayed
);
state.singleTypeLinks = authorizedSingleTypeLinks.filter(({ isDisplayed }) => isDisplayed);
state.components = components;
state.models = contentTypeSchemas;
state.fieldSizes = fieldSizes;
state.isLoading = false;
}
}
});
const { actions, reducer: reducer$1 } = appSlice;
combineReducers({
app: reducer$1
});
const previewApi = contentManagerApi.injectEndpoints({
endpoints: (builder) => ({
getPreviewUrl: builder.query({
query({ query, params }) {
return {
url: `/content-manager/preview/url/${params.contentType}`,
method: "GET",
config: {
params: query
}
};
}
})
})
});
const { useGetPreviewUrlQuery } = previewApi;
const usePluginConfig = () => {
const { formatAPIError: formatAPIError2 } = useAPIErrorHandler$1();
const dispatch = useDispatch();
const fetchClient = useFetchClient();
const { toggleNotification } = useNotification$1();
const { config, isLoading } = useSelector((state) => state[`${PLUGIN_ID$1}_config`]);
useEffect(() => {
if (!isLoading && !!config) {
return;
}
fetchClient.get(`/${PLUGIN_ID$1}/config`).then(({ data }) => {
dispatch({
type: ACTION_RESOLVE_CONFIG,
data
});
}).catch((err) => {
if ("code" in err && err?.code === "ERR_CANCELED") {
return;
}
toggleNotification({
type: "warning",
message: formatAPIError2(err)
});
});
}, [isLoading, config, dispatch, fetchClient, formatAPIError2, toggleNotification]);
return {
data: config,
isLoading
};
};
const usePreviewButton = (uid, data) => {
const runHookWaterfall = useStrapiApp$1(PLUGIN_ID$1, (value) => value.runHookWaterfall);
const { data: config, isLoading } = usePluginConfig();
const [draft, setDraft] = useState(null);
const [published, setPublished] = useState(null);
const uidConfig = config?.contentTypes?.find((type) => type.uid === uid);
const isSupported = !!uid && !!uidConfig;
const compileWithHooks = useCallback(async () => {
if (!isSupported) {
return;
}
const result = await runHookWaterfall(HOOK_BEFORE_BUILD_URL, {
data,
draft: uidConfig.draft,
published: uidConfig.published,
uid
});
const draftConfig = getPublishStateConfig(result?.draft, data);
const publishedConfig = getPublishStateConfig(
result?.published,
data
);
setDraft(draftConfig);
setPublished(publishedConfig);
}, [data, uidConfig, setDraft, setPublished, runHookWaterfall]);
useEffect(() => {
if (isLoading || !isSupported) {
return;
}
compileWithHooks();
}, [isLoading, isSupported, compileWithHooks]);
return {
isLoading,
isSupported,
draft,
published
};
};
const LinkButtonStyled = styled(LinkButton)`
width: 100%;
// Fix visited state color for the icon.
&:visited {
color: ${({ theme }) => theme.colors.primary700};
}
`;
const PreviewButton = ({ isDraft: isDraft2, openTarget, url }) => {
const { formatMessage } = useIntl();
const handleClick = useCallback(
(event) => {
event.preventDefault();
if (!url) {
return;
}
window.open(url, openTarget);
},
[url, openTarget]
);
return /* @__PURE__ */ jsx(
LinkButtonStyled,
{
disabled: !url,
href: url,
onClick: handleClick,
size: "S",
startIcon: /* @__PURE__ */ jsx(ForwardRef$3z, {}),
target: "_blank",
variant: "secondary",
children: formatMessage(
isDraft2 ? {
id: getTrad("form.button.draft"),
defaultMessage: "Open draft preview"
} : {
id: getTrad("form.button.published"),
defaultMessage: "Open live view"
}
)
}
);
};
const PreviewButton$1 = memo(PreviewButton);
const PreviewButtonGroup = ({ data, isDraft: isDraft2 }) => {
const { url, copy, openTarget } = data;
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(PreviewButton$1, { isDraft: isDraft2, url, openTarget }),
copy !== false && /* @__PURE__ */ jsx(CopyLinkButton$1, { isDraft: isDraft2, url })
] });
};
const PreviewButtonGroup$1 = memo(PreviewButtonGroup);
const EditViewRightLinks = () => {
const { collectionType = "", id: documentId, slug: model = "" } = useParams();
const isSingleType = collectionType === "single-types";
if (!isSingleType && !documentId || documentId === "create") {
return null;
}
const [searchParams] = useSearchParams();
const params = {};
const locale = searchParams.get("plugins[i18n][locale]");
if (locale) {
params.locale = locale;
}
const { document: document2, schema } = useDocument({ collectionType, documentId, model, params });
const uid = schema?.uid;
const { isLoading, isSupported, draft, published } = usePreviewButton(uid, document2);
if (!document2?.id || !uid || !isSupported || isLoading) {
return null;
}
const hasDraftAndPublish = schema?.options?.draftAndPublish === true;
const isDraft2 = hasDraftAndPublish && searchParams.get("status") !== "published";
const showPublished = !!published && !isDraft2;
const showDraft = hasDraftAndPublish && !!draft && (isDraft2 || draft?.alwaysVisible);
return /* @__PURE__ */ jsxs(Fragment, { children: [
showPublished && /* @__PURE__ */ jsx(PreviewButtonGroup$1, { data: published, isDraft: false }),
showDraft && /* @__PURE__ */ jsx(PreviewButtonGroup$1, { data: draft, isDraft: true })
] });
};
const ListViewColumn = ({ data, layout, model }) => {
const { formatMessage } = useIntl();
const { toggleNotification } = useNotification$1();
const hasDraftAndPublish = layout.options.draftAndPublish === true;
const isDraft2 = hasDraftAndPublish && data.status === "draft";
const { isLoading, draft, published } = usePreviewButton(model, data);
const config = useMemo(() => {
if (isDraft2) {
return draft;
}
return published;
}, [isDraft2, draft, published]);
const url = get(config, "url", "");
const copy = get(config, "copy");
const openTarget = get(config, "openTarget", PREVIEW_WINDOW_NAME);
const handleOpenLink = useCallback(
(event) => {
event.preventDefault();
event.stopPropagation();
if (!url) {
return;
}
window.open(url, openTarget);
},
[url, openTarget]
);
const handleCopy = useCallback(() => {
toggleNotification({
type: "success",
message: formatMessage({
id: "notification.success.link-copied",
defaultMessage: "Link copied to the clipboard"
})
});
}, [formatMessage, toggleNotification]);
if (isLoading) {
return /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(Loader, { small: true }) });
}
return /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
/* @__PURE__ */ jsx(
IconButton,
{
onClick: handleOpenLink,
label: formatMessage(
isDraft2 ? {
id: getTrad("form.button.draft"),
defaultMessage: "Open draft preview"
} : {
id: getTrad("form.button.published"),
defaultMessage: "Open live view"
}
),
noBorder: true,
children: /* @__PURE__ */ jsx(ForwardRef$3z, {})
}
),
copy && /* @__PURE__ */ jsx(CopyToClipboard, { text: url, onCopy: handleCopy, children: /* @__PURE__ */ jsx(
IconButton,
{
onClick: (event) => {
event.preventDefault();
event.stopPropagation();
},
label: formatMessage(
isDraft2 ? {
id: getTrad("form.button.copy-link.draft"),
defaultMessage: "Copy preview link"
} : {
id: getTrad("form.button.copy-link"),
defaultMessage: "Copy link"
}
),
noBorder: true,
children: /* @__PURE__ */ jsx(ForwardRef$2l, {})
}
) })
] });
};
const addPreviewColumn = ({ displayedHeaders, layout }) => {
const isSupported = get(layout, ["options", PLUGIN_ID$1, "listViewColumn"], false) === true;
if (!isSupported) {
return {
displayedHeaders,
layout
};
}
return {
displayedHeaders: [
...displayedHeaders,
{
label: {
id: getTrad("list-view.column-header"),
defaultMessage: "Preview"
},
name: "preview",
searchable: false,
sortable: false,
cellFormatter: (data, _, { model }) => /* @__PURE__ */ jsx(ListViewColumn, { data, layout, model })
}
],
layout
};
};
const initialState = {
contentTypes: null
};
const configReducer = produce((previousState, action) => {
const state = previousState ?? initialState;
switch (action.type) {
case ACTION_RESOLVE_CONFIG:
state.isLoading = false;
state.config = action.data.config;
break;
default:
return state;
}
return state;
});
const reducers = {
[`${PLUGIN_ID$1}_config`]: configReducer
};
const index = {
register(app) {
app.addReducers(reducers);
app.createHook(HOOK_BEFORE_BUILD_URL);
app.registerHook("Admin/CM/pages/ListView/inject-column-in-table", addPreviewColumn);
app.registerPlugin({
id: PLUGIN_ID$1,
name: PLUGIN_NAME
});
},
bootstrap(app) {
app.getPlugin("content-manager").injectComponent("editView", "right-links", {
name: PLUGIN_ID$1,
Component: EditViewRightLinks
});
},
async registerTrads({ locales }) {
const importedTrads = await Promise.all(
locales.map((locale) => {
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-D6wmzOMm.mjs"), "./translations/es.json": () => import("./es-BKpoFP9p.mjs"), "./translations/fr.json": () => import("./fr--UJgrysP.mjs"), "./translations/ja.json": () => import("./ja-CajqqiZD.mjs"), "./translations/ru.json": () => import("./ru-C8r42Usr.mjs"), "./translations/tr.json": () => import("./tr-uRAGsXNl.mjs") }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
return {
data: prefixPluginTranslations(data),
locale
};
}).catch(() => {
return {
data: {},
locale
};
});
})
);
return Promise.resolve(importedTrads);
}
};
export {
ForwardRef$2f as $,
createYupSchema as A,
getTranslation as B,
COLLECTION_TYPES as C,
DocumentRBAC as D,
Panels as E,
Form as F,
Blocker as G,
Header as H,
_extends$5 as I,
ForwardRef$59 as J,
useFocusInputField as K,
Layouts as L,
MemoizedInputRenderer as M,
ForwardRef$3N as N,
generateNKeysBetween as O,
PERMISSIONS as P,
getDefaultExportFromCjs as Q,
RelativeTime as R,
SINGLE_TYPES as S,
commonjsGlobal as T,
getAugmentedNamespace as U,
ForwardRef$3B as V,
ForwardRef$1b as W,
CLONE_PATH as X,
useAPIErrorHandler as Y,
ForwardRef$4v as Z,
_inheritsLoose as _,
createContext as a,
ForwardRef$53 as a$,
ForwardRef$45 as a0,
ForwardRef$4X as a1,
ForwardRef$2v as a2,
ForwardRef$f as a3,
ForwardRef$v as a4,
ForwardRef$4d as a5,
ForwardRef$j$1 as a6,
ForwardRef$1R as a7,
ForwardRef$4R as a8,
ForwardRef$1L as a9,
useAuth as aA,
useContentTypeSchema as aB,
useAdminUsers as aC,
CREATOR_FIELDS as aD,
getMainField as aE,
Filters as aF,
ForwardRef$47 as aG,
ForwardRef$2h as aH,
checkIfAttributeIsDisplayable as aI,
HOOKS as aJ,
convertListLayoutToFieldLayouts as aK,
ForwardRef$1r as aL,
create$2 as aM,
create$4 as aN,
create$5 as aO,
useUpdateContentTypeConfigurationMutation as aP,
capitalise as aQ,
useGetInitialDataQuery as aR,
extractContentTypeComponents as aS,
DEFAULT_SETTINGS as aT,
convertEditLayoutToFieldLayouts as aU,
create$3 as aV,
ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD as aW,
ForwardRef$5d as aX,
ForwardRef$31 as aY,
ForwardRef$5b as aZ,
ForwardRef$57 as a_,
ForwardRef$2F as aa,
ForwardRef$11$1 as ab,
DOCUMENT_META_FIELDS as ac,
ForwardRef$4b as ad,
ForwardRef$2T as ae,
ForwardRef$2N as af,
ForwardRef$2P as ag,
ForwardRef$2V as ah,
ForwardRef$2X as ai,
ForwardRef$2R as aj,
ForwardRef$1t as ak,
ForwardRef$1d as al,
ForwardRef$3v as am,
requiredArgs as an,
toInteger$1 as ao,
millisecondsInHour as ap,
millisecondsInMinute as aq,
useGetAllDocumentsQuery as ar,
BackButton as as,
InjectionZone as at,
SearchInput as au,
Table as av,
TableActions as aw,
Pagination as ax,
useTable as ay,
BulkActionsRenderer as az,
Page as b,
ForwardRef$1H as b$,
ForwardRef$51 as b0,
ForwardRef$1v as b1,
ForwardRef$4Z as b2,
ForwardRef$4V as b3,
ForwardRef$4T as b4,
ForwardRef$1D as b5,
ForwardRef$4P as b6,
ForwardRef$4N as b7,
ForwardRef$4H as b8,
ForwardRef$4D as b9,
ForwardRef$3b as bA,
ForwardRef$4F as bB,
ForwardRef$39 as bC,
ForwardRef$37 as bD,
ForwardRef$33 as bE,
ForwardRef$2$ as bF,
ForwardRef$2Z as bG,
ForwardRef$2L as bH,
ForwardRef$2J as bI,
ForwardRef$2H as bJ,
ForwardRef$2x as bK,
ForwardRef$2t as bL,
ForwardRef$2D as bM,
ForwardRef$2r as bN,
ForwardRef$2p as bO,
ForwardRef$2d as bP,
ForwardRef$2b as bQ,
ForwardRef$27 as bR,
ForwardRef$25 as bS,
ForwardRef$23 as bT,
ForwardRef$l as bU,
ForwardRef$21 as bV,
ForwardRef$1$ as bW,
ForwardRef$1V as bX,
ForwardRef$1T as bY,
ForwardRef$1N as bZ,
ForwardRef$1J as b_,
ForwardRef$4B as ba,
ForwardRef$4z as bb,
ForwardRef$4x as bc,
ForwardRef$4l as bd,
ForwardRef$4h as be,
ForwardRef$43 as bf,
ForwardRef$3t as bg,
ForwardRef$41 as bh,
ForwardRef$3X as bi,
ForwardRef$49 as bj,
ForwardRef$3V as bk,
ForwardRef$F as bl,
ForwardRef$3T as bm,
ForwardRef$3R as bn,
ForwardRef$z as bo,
ForwardRef$3J as bp,
ForwardRef$3F as bq,
ForwardRef$3D as br,
ForwardRef$29 as bs,
ForwardRef$L as bt,
ForwardRef$3x as bu,
ForwardRef$3r as bv,
ForwardRef$3p as bw,
ForwardRef$3l as bx,
ForwardRef$3j as by,
ForwardRef$3d as bz,
contentManagerApi as c,
ForwardRef$1F as c0,
ForwardRef$1x as c1,
ForwardRef$1p as c2,
ForwardRef$1n as c3,
ForwardRef$1l as c4,
ForwardRef$1j as c5,
ForwardRef$1f as c6,
ForwardRef$17 as c7,
ForwardRef$15 as c8,
ForwardRef$13$1 as c9,
ForwardRef$j as cA,
ForwardRef$11 as cB,
ForwardRef$V as cC,
ForwardRef$N as cD,
ForwardRef$D as cE,
ForwardRef$n as cF,
ForwardRef$h as cG,
ForwardRef$b as cH,
ForwardRef$5 as cI,
ForwardRef$r as cJ,
ForwardRef$3 as cK,
ForwardRef$X as cL,
ForwardRef$P as cM,
ForwardRef$13 as cN,
ForwardRef$J as cO,
index as cP,
ForwardRef$$ as ca,
ForwardRef$Z as cb,
ForwardRef$4$ as cc,
ForwardRef$X$1 as cd,
ForwardRef$V$1 as ce,
ForwardRef$1h as cf,
ForwardRef$T as cg,
ForwardRef$R as ch,
ForwardRef$P$1 as ci,
ForwardRef$N$1 as cj,
ForwardRef$19 as ck,
ForwardRef$D$1 as cl,
ForwardRef$B as cm,
ForwardRef$x as cn,
ForwardRef$t as co,
ForwardRef$r$1 as cp,
ForwardRef$p as cq,
ForwardRef$n$1 as cr,
ForwardRef$l$1 as cs,
ForwardRef$1 as ct,
ForwardRef$h$1 as cu,
ForwardRef$b$1 as cv,
ForwardRef$9 as cw,
ForwardRef$7 as cx,
ForwardRef$5$1 as cy,
ForwardRef$1$1 as cz,
useDocument as d,
useDocumentLayout as e,
useGetContentTypeConfigurationQuery as f,
useQueryParams as g,
buildValidParams as h,
useDoc as i,
useTracking as j,
useNotification as k,
ForwardRef$55 as l,
ConfirmDialog as m,
ForwardRef$3$1 as n,
getDisplayName as o,
DocumentStatus as p,
useForm as q,
useDocumentRBAC as r,
useStrapiApp as s,
useDocLayout as t,
useRBAC as u,
useField as v,
useGetPreviewUrlQuery as w,
useClipboard as x,
ForwardRef$2l as y,
ForwardRef$3$ as z
};