intlayer-editor 7.0.9-canary.0 → 7.0.9-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/assets/{CodeBlockShiki-BDvE9sug.js → CodeBlockShiki-DnZQYzr7.js} +3 -3
- package/client/dist/assets/{bundle-web-CHQzjO7d.js → bundle-web-DkwBW04f.js} +1 -1
- package/client/dist/assets/{index-yUZ4ks9F.css → index-BVgTO6SK.css} +602 -288
- package/client/dist/assets/{index-Cot71srz.js → index-e-HKwUP8.js} +1956 -623
- package/client/dist/index.html +2 -2
- package/package.json +36 -33
|
@@ -13552,6 +13552,11 @@ var defaultValues_exports = /* @__PURE__ */ __export$1({
|
|
|
13552
13552
|
Log: () => log_exports,
|
|
13553
13553
|
Routing: () => routing_exports
|
|
13554
13554
|
});
|
|
13555
|
+
const camelCaseToSentence = (value) => {
|
|
13556
|
+
if (!value) return "";
|
|
13557
|
+
const withSpaces = value.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
|
|
13558
|
+
return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();
|
|
13559
|
+
};
|
|
13555
13560
|
const createCookieEntry = (options) => {
|
|
13556
13561
|
const { name, path, expires, domain, secure, sameSite, httpOnly } = options ?? {};
|
|
13557
13562
|
return {
|
|
@@ -14871,35 +14876,28 @@ const getPathWithoutLocale = (inputUrl, locales = configuration?.internationaliz
|
|
|
14871
14876
|
if (isAbsoluteUrl) return url.toString();
|
|
14872
14877
|
return url.toString().replace("http://example.com", "");
|
|
14873
14878
|
};
|
|
14874
|
-
const
|
|
14879
|
+
const getLocalizedUrl = (url, currentLocale, options = {}) => {
|
|
14880
|
+
const { locales = configuration?.internationalization?.locales ?? defaultValues_exports.Internationalization.LOCALES, defaultLocale = configuration?.internationalization?.defaultLocale ?? defaultValues_exports.Internationalization.DEFAULT_LOCALE, mode = configuration?.routing?.mode ?? defaultValues_exports.Routing.ROUTING_MODE } = options;
|
|
14875
14881
|
const urlWithoutLocale = getPathWithoutLocale(url, locales);
|
|
14882
|
+
if (mode === "no-prefix") return urlWithoutLocale;
|
|
14876
14883
|
const isAbsoluteUrl = checkIsURLAbsolute(urlWithoutLocale);
|
|
14877
14884
|
const parsedUrl = isAbsoluteUrl ? new URL(urlWithoutLocale) : new URL(urlWithoutLocale, "http://example.com");
|
|
14878
14885
|
let pathname = parsedUrl.pathname;
|
|
14879
14886
|
if (!pathname.startsWith("/")) pathname = `/${pathname}`;
|
|
14880
14887
|
const baseUrl = isAbsoluteUrl ? `${parsedUrl.protocol}//${parsedUrl.host}` : "";
|
|
14881
|
-
|
|
14882
|
-
|
|
14883
|
-
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
if (localizedPath.length > 1 && localizedPath.endsWith("/")) localizedPath = localizedPath.slice(0, -1);
|
|
14895
|
-
localizedUrl = isAbsoluteUrl ? `${baseUrl}${localizedPath}${parsedUrl.search}${parsedUrl.hash}` : `${localizedPath}${parsedUrl.search}${parsedUrl.hash}`;
|
|
14896
|
-
}
|
|
14897
|
-
acc[locale] = localizedUrl;
|
|
14898
|
-
return acc;
|
|
14899
|
-
}, {});
|
|
14900
|
-
};
|
|
14901
|
-
const getLocalizedUrl = (url, currentLocale, locales = configuration?.internationalization?.locales, defaultLocale = configuration?.internationalization?.defaultLocale, mode = configuration?.routing?.mode) => {
|
|
14902
|
-
return getMultilingualUrls(url, locales, defaultLocale, mode)[currentLocale] ?? url;
|
|
14888
|
+
if (mode === "search-params") {
|
|
14889
|
+
const searchParams = new URLSearchParams(parsedUrl.search);
|
|
14890
|
+
searchParams.set("locale", currentLocale.toString());
|
|
14891
|
+
const queryString = searchParams.toString();
|
|
14892
|
+
const pathWithQuery = queryString ? `${pathname}?${queryString}` : pathname;
|
|
14893
|
+
if (isAbsoluteUrl) return `${baseUrl}${pathWithQuery}${parsedUrl.hash}`;
|
|
14894
|
+
return `${pathWithQuery}${parsedUrl.hash}`;
|
|
14895
|
+
}
|
|
14896
|
+
const isDefaultLocale = currentLocale?.toString() === defaultLocale?.toString();
|
|
14897
|
+
let localizedPath = mode === "prefix-all" || mode === "prefix-no-default" && !isDefaultLocale ? `/${currentLocale}${pathname}` : pathname;
|
|
14898
|
+
if (localizedPath.length > 1 && localizedPath.endsWith("/")) localizedPath = localizedPath.slice(0, -1);
|
|
14899
|
+
if (isAbsoluteUrl) return `${baseUrl}${localizedPath}${parsedUrl.search}${parsedUrl.hash}`;
|
|
14900
|
+
return `${localizedPath}${parsedUrl.search}${parsedUrl.hash}`;
|
|
14903
14901
|
};
|
|
14904
14902
|
const isSameKeyPath = (keyPath1, keyPath2) => keyPath1.every((element, index2) => keyPath2[index2] && keyPath2[index2].key === element.key && keyPath2[index2].type === element.type);
|
|
14905
14903
|
const localeInStorage = getLocaleFromStorage(localeStorageOptions);
|
|
@@ -14907,42 +14905,7 @@ const setLocaleInStorage = (locale, isCookieEnabled) => setLocaleInStorage$1(loc
|
|
|
14907
14905
|
...localeStorageOptions,
|
|
14908
14906
|
isCookieEnabled
|
|
14909
14907
|
});
|
|
14910
|
-
const
|
|
14911
|
-
for (let i2 = 0; i2 < 256; ++i2) {
|
|
14912
|
-
byteToHex.push((i2 + 256).toString(16).slice(1));
|
|
14913
|
-
}
|
|
14914
|
-
function unsafeStringify(arr, offset2 = 0) {
|
|
14915
|
-
return (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase();
|
|
14916
|
-
}
|
|
14917
|
-
let getRandomValues;
|
|
14918
|
-
const rnds8 = new Uint8Array(16);
|
|
14919
|
-
function rng() {
|
|
14920
|
-
if (!getRandomValues) {
|
|
14921
|
-
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
14922
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
14923
|
-
}
|
|
14924
|
-
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
14925
|
-
}
|
|
14926
|
-
return getRandomValues(rnds8);
|
|
14927
|
-
}
|
|
14928
|
-
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
14929
|
-
const native = { randomUUID };
|
|
14930
|
-
function _v4(options, buf, offset2) {
|
|
14931
|
-
options = options || {};
|
|
14932
|
-
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
14933
|
-
if (rnds.length < 16) {
|
|
14934
|
-
throw new Error("Random bytes length must be >= 16");
|
|
14935
|
-
}
|
|
14936
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
14937
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
14938
|
-
return unsafeStringify(rnds);
|
|
14939
|
-
}
|
|
14940
|
-
function v4(options, buf, offset2) {
|
|
14941
|
-
if (native.randomUUID && true && !options) {
|
|
14942
|
-
return native.randomUUID();
|
|
14943
|
-
}
|
|
14944
|
-
return _v4(options);
|
|
14945
|
-
}
|
|
14908
|
+
const randomUUID = () => Math.random().toString(36).slice(2);
|
|
14946
14909
|
const { editor } = configuration ?? {};
|
|
14947
14910
|
const CommunicatorContext = reactExports.createContext({
|
|
14948
14911
|
postMessage: () => null,
|
|
@@ -14954,7 +14917,7 @@ const CommunicatorContext = reactExports.createContext({
|
|
|
14954
14917
|
senderId: ""
|
|
14955
14918
|
});
|
|
14956
14919
|
const CommunicatorProvider = ({ children, allowedOrigins, postMessage }) => {
|
|
14957
|
-
const senderIdRef = reactExports.useRef(
|
|
14920
|
+
const senderIdRef = reactExports.useRef(randomUUID());
|
|
14958
14921
|
const value = reactExports.useMemo(() => ({
|
|
14959
14922
|
postMessage,
|
|
14960
14923
|
allowedOrigins,
|
|
@@ -20830,7 +20793,144 @@ const getDefaultConfig = () => {
|
|
|
20830
20793
|
};
|
|
20831
20794
|
};
|
|
20832
20795
|
const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
20833
|
-
const cn$
|
|
20796
|
+
const cn$2 = (...inputs) => twMerge(clsx(inputs));
|
|
20797
|
+
const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
20798
|
+
const cx$1 = clsx;
|
|
20799
|
+
const cva = (base, config2) => (props) => {
|
|
20800
|
+
var _config_compoundVariants;
|
|
20801
|
+
if ((config2 === null || config2 === void 0 ? void 0 : config2.variants) == null) return cx$1(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
20802
|
+
const { variants, defaultVariants } = config2;
|
|
20803
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
20804
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
20805
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
20806
|
+
if (variantProp === null) return null;
|
|
20807
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
20808
|
+
return variants[variant][variantKey];
|
|
20809
|
+
});
|
|
20810
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
20811
|
+
let [key2, value] = param;
|
|
20812
|
+
if (value === void 0) {
|
|
20813
|
+
return acc;
|
|
20814
|
+
}
|
|
20815
|
+
acc[key2] = value;
|
|
20816
|
+
return acc;
|
|
20817
|
+
}, {});
|
|
20818
|
+
const getCompoundVariantClassNames = config2 === null || config2 === void 0 ? void 0 : (_config_compoundVariants = config2.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
20819
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
20820
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
20821
|
+
let [key2, value] = param2;
|
|
20822
|
+
return Array.isArray(value) ? value.includes({
|
|
20823
|
+
...defaultVariants,
|
|
20824
|
+
...propsWithoutUndefined
|
|
20825
|
+
}[key2]) : {
|
|
20826
|
+
...defaultVariants,
|
|
20827
|
+
...propsWithoutUndefined
|
|
20828
|
+
}[key2] === value;
|
|
20829
|
+
}) ? [
|
|
20830
|
+
...acc,
|
|
20831
|
+
cvClass,
|
|
20832
|
+
cvClassName
|
|
20833
|
+
] : acc;
|
|
20834
|
+
}, []);
|
|
20835
|
+
return cx$1(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
20836
|
+
};
|
|
20837
|
+
const containerVariants$1 = cva("flex flex-col text-text backdrop-blur", {
|
|
20838
|
+
variants: {
|
|
20839
|
+
roundedSize: {
|
|
20840
|
+
none: "rounded-none",
|
|
20841
|
+
sm: "rounded-sm [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-md",
|
|
20842
|
+
md: "rounded-md [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-lg",
|
|
20843
|
+
lg: "rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl",
|
|
20844
|
+
xl: "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl",
|
|
20845
|
+
"2xl": "rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
20846
|
+
"3xl": "rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl",
|
|
20847
|
+
full: "rounded-full [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-full"
|
|
20848
|
+
},
|
|
20849
|
+
transparency: {
|
|
20850
|
+
none: "bg-card",
|
|
20851
|
+
sm: "bg-card/95",
|
|
20852
|
+
md: "bg-card/70",
|
|
20853
|
+
lg: "bg-card/40",
|
|
20854
|
+
xl: "bg-card/20",
|
|
20855
|
+
full: ""
|
|
20856
|
+
},
|
|
20857
|
+
padding: {
|
|
20858
|
+
none: "p-0",
|
|
20859
|
+
sm: "px-2 py-4",
|
|
20860
|
+
md: "px-4 py-6",
|
|
20861
|
+
lg: "px-6 py-8",
|
|
20862
|
+
xl: "px-8 py-10",
|
|
20863
|
+
"2xl": "px-10 py-12"
|
|
20864
|
+
},
|
|
20865
|
+
separator: {
|
|
20866
|
+
without: "",
|
|
20867
|
+
x: "divide-x divide-dashed divide-text/20",
|
|
20868
|
+
y: "divide-y divide-dashed divide-text/20",
|
|
20869
|
+
both: "divide-x divide-y divide-dashed divide-text/20"
|
|
20870
|
+
},
|
|
20871
|
+
border: {
|
|
20872
|
+
none: "",
|
|
20873
|
+
with: "border-[1.5px]"
|
|
20874
|
+
},
|
|
20875
|
+
borderColor: {
|
|
20876
|
+
primary: "border-primary",
|
|
20877
|
+
secondary: "border-secondary",
|
|
20878
|
+
neutral: "border-neutral",
|
|
20879
|
+
text: "border-text",
|
|
20880
|
+
error: "border-error",
|
|
20881
|
+
warning: "border-warning",
|
|
20882
|
+
success: "border-success"
|
|
20883
|
+
},
|
|
20884
|
+
background: {
|
|
20885
|
+
none: "bg-inherit",
|
|
20886
|
+
hoverable: "bg-opacity-5! backdrop-blur-0 hover:bg-opacity-10! hover:backdrop-blur focus:bg-opacity-10! focus:backdrop-blur aria-selected:bg-opacity-15! aria-selected:backdrop-blur",
|
|
20887
|
+
with: ""
|
|
20888
|
+
},
|
|
20889
|
+
gap: {
|
|
20890
|
+
none: "gap-0",
|
|
20891
|
+
sm: "gap-1",
|
|
20892
|
+
md: "gap-3",
|
|
20893
|
+
lg: "gap-5",
|
|
20894
|
+
xl: "gap-8",
|
|
20895
|
+
"2xl": "gap-10"
|
|
20896
|
+
}
|
|
20897
|
+
},
|
|
20898
|
+
defaultVariants: {
|
|
20899
|
+
roundedSize: "md",
|
|
20900
|
+
border: "none",
|
|
20901
|
+
borderColor: "text",
|
|
20902
|
+
transparency: "md",
|
|
20903
|
+
padding: "none",
|
|
20904
|
+
separator: "without",
|
|
20905
|
+
gap: "none"
|
|
20906
|
+
}
|
|
20907
|
+
});
|
|
20908
|
+
let ContainerRoundedSize = /* @__PURE__ */ (function(ContainerRoundedSize$1) {
|
|
20909
|
+
ContainerRoundedSize$1["NONE"] = "none";
|
|
20910
|
+
ContainerRoundedSize$1["SM"] = "sm";
|
|
20911
|
+
ContainerRoundedSize$1["MD"] = "md";
|
|
20912
|
+
ContainerRoundedSize$1["LG"] = "lg";
|
|
20913
|
+
ContainerRoundedSize$1["XL"] = "xl";
|
|
20914
|
+
ContainerRoundedSize$1["TWO_XL"] = "2xl";
|
|
20915
|
+
ContainerRoundedSize$1["THREE_XL"] = "3xl";
|
|
20916
|
+
ContainerRoundedSize$1["FULL"] = "full";
|
|
20917
|
+
return ContainerRoundedSize$1;
|
|
20918
|
+
})({});
|
|
20919
|
+
const Container = ({ children, roundedSize, padding, transparency, separator, className, border, borderColor, background, gap, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
20920
|
+
className: cn$2(containerVariants$1({
|
|
20921
|
+
roundedSize,
|
|
20922
|
+
transparency,
|
|
20923
|
+
padding,
|
|
20924
|
+
separator,
|
|
20925
|
+
border: typeof border === "boolean" ? border ? "with" : "none" : void 0,
|
|
20926
|
+
background,
|
|
20927
|
+
borderColor,
|
|
20928
|
+
gap,
|
|
20929
|
+
className
|
|
20930
|
+
})),
|
|
20931
|
+
...props,
|
|
20932
|
+
children
|
|
20933
|
+
});
|
|
20834
20934
|
const Spinner = ({ className, strokeWidth = 4 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("svg", {
|
|
20835
20935
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20836
20936
|
width: "44",
|
|
@@ -20839,7 +20939,7 @@ const Spinner = ({ className, strokeWidth = 4 }) => /* @__PURE__ */ jsxRuntimeEx
|
|
|
20839
20939
|
stroke: "currentColor",
|
|
20840
20940
|
role: "img",
|
|
20841
20941
|
"aria-label": "Spinner",
|
|
20842
|
-
className: cn$
|
|
20942
|
+
className: cn$2("size-full", className),
|
|
20843
20943
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("g", {
|
|
20844
20944
|
fill: "none",
|
|
20845
20945
|
fillRule: "evenodd",
|
|
@@ -20896,59 +20996,19 @@ const Spinner = ({ className, strokeWidth = 4 }) => /* @__PURE__ */ jsxRuntimeEx
|
|
|
20896
20996
|
const Loader = ({ children, isLoading = true, keepChildren = false, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isLoading && keepChildren ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
20897
20997
|
className: "relative size-full",
|
|
20898
20998
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
20899
|
-
className: cn$
|
|
20999
|
+
className: cn$2("absolute top-0 left-0 flex size-full max-h-screen max-w-[100vw] flex-1 items-center justify-center", className),
|
|
20900
21000
|
role: "status",
|
|
20901
21001
|
"aria-label": "Animated icon, meaning that the website is processing",
|
|
20902
21002
|
...props,
|
|
20903
21003
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, { className: "size-10 max-h-full max-w-full" })
|
|
20904
21004
|
}), children]
|
|
20905
21005
|
}) : isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
20906
|
-
className: cn$
|
|
21006
|
+
className: cn$2("flex size-full max-h-screen max-w-[100vw] flex-1 items-center justify-center", className),
|
|
20907
21007
|
role: "status",
|
|
20908
21008
|
"aria-label": "Animated icon, meaning that the website is processing",
|
|
20909
21009
|
...props,
|
|
20910
21010
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, { className: "size-10 max-h-full max-w-full" })
|
|
20911
21011
|
}) : children ?? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}) });
|
|
20912
|
-
const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
20913
|
-
const cx$1 = clsx;
|
|
20914
|
-
const cva = (base, config2) => (props) => {
|
|
20915
|
-
var _config_compoundVariants;
|
|
20916
|
-
if ((config2 === null || config2 === void 0 ? void 0 : config2.variants) == null) return cx$1(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
20917
|
-
const { variants, defaultVariants } = config2;
|
|
20918
|
-
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
20919
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
20920
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
20921
|
-
if (variantProp === null) return null;
|
|
20922
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
20923
|
-
return variants[variant][variantKey];
|
|
20924
|
-
});
|
|
20925
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
20926
|
-
let [key2, value] = param;
|
|
20927
|
-
if (value === void 0) {
|
|
20928
|
-
return acc;
|
|
20929
|
-
}
|
|
20930
|
-
acc[key2] = value;
|
|
20931
|
-
return acc;
|
|
20932
|
-
}, {});
|
|
20933
|
-
const getCompoundVariantClassNames = config2 === null || config2 === void 0 ? void 0 : (_config_compoundVariants = config2.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
20934
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
20935
|
-
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
20936
|
-
let [key2, value] = param2;
|
|
20937
|
-
return Array.isArray(value) ? value.includes({
|
|
20938
|
-
...defaultVariants,
|
|
20939
|
-
...propsWithoutUndefined
|
|
20940
|
-
}[key2]) : {
|
|
20941
|
-
...defaultVariants,
|
|
20942
|
-
...propsWithoutUndefined
|
|
20943
|
-
}[key2] === value;
|
|
20944
|
-
}) ? [
|
|
20945
|
-
...acc,
|
|
20946
|
-
cvClass,
|
|
20947
|
-
cvClassName
|
|
20948
|
-
] : acc;
|
|
20949
|
-
}, []);
|
|
20950
|
-
return cx$1(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
20951
|
-
};
|
|
20952
21012
|
let ButtonSize = /* @__PURE__ */ (function(ButtonSize$1) {
|
|
20953
21013
|
ButtonSize$1["SM"] = "sm";
|
|
20954
21014
|
ButtonSize$1["MD"] = "md";
|
|
@@ -20960,28 +21020,17 @@ let ButtonSize = /* @__PURE__ */ (function(ButtonSize$1) {
|
|
|
20960
21020
|
ButtonSize$1["ICON_XL"] = "icon-xl";
|
|
20961
21021
|
return ButtonSize$1;
|
|
20962
21022
|
})({});
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20972
|
-
|
|
20973
|
-
|
|
20974
|
-
[`${ButtonSize.XL}`]: "-translate-y-1/2 absolute top-1/2 size-6",
|
|
20975
|
-
[`${ButtonSize.ICON_SM}`]: "size-3",
|
|
20976
|
-
[`${ButtonSize.ICON_MD}`]: "size-4",
|
|
20977
|
-
[`${ButtonSize.ICON_LG}`]: "size-5",
|
|
20978
|
-
[`${ButtonSize.ICON_XL}`]: "size-6"
|
|
20979
|
-
},
|
|
20980
|
-
position: {
|
|
20981
|
-
[`${ButtonIconPosition.LEFT}`]: "left-3",
|
|
20982
|
-
[`${ButtonIconPosition.RIGHT}`]: "right-3"
|
|
20983
|
-
}
|
|
20984
|
-
},
|
|
21023
|
+
const buttonIconVariants = cva("flex-none shrink-0", {
|
|
21024
|
+
variants: { size: {
|
|
21025
|
+
[`${ButtonSize.SM}`]: "size-3",
|
|
21026
|
+
[`${ButtonSize.MD}`]: "size-4",
|
|
21027
|
+
[`${ButtonSize.LG}`]: "size-5",
|
|
21028
|
+
[`${ButtonSize.XL}`]: "size-6",
|
|
21029
|
+
[`${ButtonSize.ICON_SM}`]: "size-3",
|
|
21030
|
+
[`${ButtonSize.ICON_MD}`]: "size-4",
|
|
21031
|
+
[`${ButtonSize.ICON_LG}`]: "size-4",
|
|
21032
|
+
[`${ButtonSize.ICON_XL}`]: "size-5"
|
|
21033
|
+
} },
|
|
20985
21034
|
defaultVariants: { size: ButtonSize.MD }
|
|
20986
21035
|
});
|
|
20987
21036
|
let ButtonVariant = /* @__PURE__ */ (function(ButtonVariant$1) {
|
|
@@ -21017,7 +21066,7 @@ let ButtonTextAlign = /* @__PURE__ */ (function(ButtonTextAlign$1) {
|
|
|
21017
21066
|
ButtonTextAlign$1["RIGHT"] = "right";
|
|
21018
21067
|
return ButtonTextAlign$1;
|
|
21019
21068
|
})({});
|
|
21020
|
-
const buttonVariants = cva("relative cursor-pointer
|
|
21069
|
+
const buttonVariants = cva("relative inline-flex cursor-pointer items-center justify-center font-medium ring-0 transition-all duration-300 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", {
|
|
21021
21070
|
variants: {
|
|
21022
21071
|
size: {
|
|
21023
21072
|
[`${ButtonSize.SM}`]: "min-h-7 px-3 text-xs max-md:py-1",
|
|
@@ -21030,68 +21079,88 @@ const buttonVariants = cva("relative cursor-pointer truncate whitespace-nowrap f
|
|
|
21030
21079
|
[`${ButtonSize.ICON_XL}`]: "p-3"
|
|
21031
21080
|
},
|
|
21032
21081
|
color: {
|
|
21033
|
-
[`${ButtonColor.PRIMARY}`]: "
|
|
21034
|
-
[`${ButtonColor.SECONDARY}`]: "
|
|
21035
|
-
[`${ButtonColor.DESTRUCTIVE}`]: "
|
|
21036
|
-
[`${ButtonColor.NEUTRAL}`]: "
|
|
21037
|
-
[`${ButtonColor.CARD}`]: "
|
|
21038
|
-
[`${ButtonColor.LIGHT}`]: "
|
|
21039
|
-
[`${ButtonColor.DARK}`]: "
|
|
21040
|
-
[`${ButtonColor.TEXT}`]: "
|
|
21041
|
-
[`${ButtonColor.CURRENT}`]: "
|
|
21042
|
-
[`${ButtonColor.TEXT_INVERSE}`]: "
|
|
21043
|
-
[`${ButtonColor.ERROR}`]: "
|
|
21044
|
-
[`${ButtonColor.SUCCESS}`]: "
|
|
21045
|
-
[`${ButtonColor.CUSTOM}`]: "
|
|
21082
|
+
[`${ButtonColor.PRIMARY}`]: "hover-primary-500/20 text-primary ring-primary-500/20 *:text-text-light",
|
|
21083
|
+
[`${ButtonColor.SECONDARY}`]: "hover-secondary-500/20 text-secondary ring-secondary-500/20 *:text-text-light",
|
|
21084
|
+
[`${ButtonColor.DESTRUCTIVE}`]: "hover-destructive-500/20 text-destructive ring-destructive-500/20 *:text-text-light",
|
|
21085
|
+
[`${ButtonColor.NEUTRAL}`]: "hover-neutral-500/20 text-neutral ring-neutral-500/20 *:text-text-light",
|
|
21086
|
+
[`${ButtonColor.CARD}`]: "hover-card-500/20 text-card ring-card-500/20 *:text-text-light",
|
|
21087
|
+
[`${ButtonColor.LIGHT}`]: "hover-white-500/20 text-white ring-white/20 *:text-text-light",
|
|
21088
|
+
[`${ButtonColor.DARK}`]: "hover-neutral-500/20 text-neutral-800 ring-neutral-800/50 *:text-text-light",
|
|
21089
|
+
[`${ButtonColor.TEXT}`]: "hover-neutral-500/20 text-text ring-neutral-500/20 *:text-text-opposite",
|
|
21090
|
+
[`${ButtonColor.CURRENT}`]: "hover-current-500/20 text-current ring-current/20 *:text-text-light",
|
|
21091
|
+
[`${ButtonColor.TEXT_INVERSE}`]: "hover-neutral-500/20 text-text-opposite ring-neutral-500/20 *:text-text",
|
|
21092
|
+
[`${ButtonColor.ERROR}`]: "hover-error-500/20 text-error ring-error/20 *:text-text-light",
|
|
21093
|
+
[`${ButtonColor.SUCCESS}`]: "hover-success-500/20 text-success ring-success/20 *:text-text-light",
|
|
21094
|
+
[`${ButtonColor.CUSTOM}`]: ""
|
|
21095
|
+
},
|
|
21096
|
+
roundedSize: {
|
|
21097
|
+
[`${ContainerRoundedSize.NONE}`]: "rounded-none",
|
|
21098
|
+
[`${ContainerRoundedSize.SM}`]: "rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl",
|
|
21099
|
+
[`${ContainerRoundedSize.MD}`]: "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl",
|
|
21100
|
+
[`${ContainerRoundedSize.LG}`]: "rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
21101
|
+
[`${ContainerRoundedSize.XL}`]: "rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl"
|
|
21046
21102
|
},
|
|
21047
21103
|
variant: {
|
|
21048
|
-
[`${ButtonVariant.DEFAULT}`]:
|
|
21104
|
+
[`${ButtonVariant.DEFAULT}`]: [
|
|
21105
|
+
"bg-current",
|
|
21106
|
+
"hover:bg-current/90",
|
|
21107
|
+
"hover:ring-6",
|
|
21108
|
+
"aria-selected:ring-6"
|
|
21109
|
+
],
|
|
21110
|
+
[`${ButtonVariant.OUTLINE}`]: [
|
|
21111
|
+
"rounded-2xl border-[1.5px] border-current bg-current/0 *:text-current!",
|
|
21112
|
+
"hover:bg-current/10",
|
|
21113
|
+
"hover:ring-6",
|
|
21114
|
+
"aria-selected:ring-6"
|
|
21115
|
+
],
|
|
21049
21116
|
[`${ButtonVariant.NONE}`]: "border-none bg-current/0 text-inherit hover:bg-current/0",
|
|
21050
|
-
[`${ButtonVariant.
|
|
21051
|
-
[`${ButtonVariant.
|
|
21052
|
-
[`${ButtonVariant.
|
|
21053
|
-
[`${ButtonVariant.
|
|
21054
|
-
[`${ButtonVariant.FADE}`]: "*:!text-current rounded-lg border-none bg-current/10 transition hover:bg-current/20 aria-[current]:bg-current/5",
|
|
21117
|
+
[`${ButtonVariant.LINK}`]: "h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent hover:underline",
|
|
21118
|
+
[`${ButtonVariant.INVISIBLE_LINK}`]: "h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent",
|
|
21119
|
+
[`${ButtonVariant.HOVERABLE}`]: "rounded-lg border-none bg-current/0 transition *:text-current! hover:bg-current/10 aria-[current]:bg-current/5",
|
|
21120
|
+
[`${ButtonVariant.FADE}`]: "rounded-lg border-none bg-current/10 transition *:text-current! hover:bg-current/20 aria-[current]:bg-current/5",
|
|
21055
21121
|
[`${ButtonVariant.INPUT}`]: [
|
|
21056
|
-
"
|
|
21057
|
-
"
|
|
21058
|
-
"
|
|
21059
|
-
"
|
|
21122
|
+
"text-text",
|
|
21123
|
+
"w-full select-text resize-none rounded-2xl text-base shadow-none outline-none supports-[corner-shape:squircle]:rounded-4xl",
|
|
21124
|
+
"transition-shadow duration-100 md:text-sm",
|
|
21125
|
+
"ring-0",
|
|
21126
|
+
"disabled:opacity-50",
|
|
21127
|
+
"text-text",
|
|
21128
|
+
"bg-neutral-50 dark:bg-neutral-950",
|
|
21129
|
+
"hover:bg-neutral-100/90 dark:hover:bg-neutral-900/90",
|
|
21130
|
+
"ring-neutral-100 dark:ring-neutral-700",
|
|
21131
|
+
"hover:ring-3",
|
|
21132
|
+
"aria-selected:ring-4",
|
|
21133
|
+
"focus-visible:ring-2",
|
|
21134
|
+
"disabled:ring-0",
|
|
21135
|
+
"focus-visible:outline-none",
|
|
21136
|
+
"[box-shadow:none] focus:[box-shadow:none]",
|
|
21137
|
+
"aria-invalid:border-error"
|
|
21060
21138
|
]
|
|
21061
21139
|
},
|
|
21062
21140
|
textAlign: {
|
|
21063
|
-
[`${ButtonTextAlign.LEFT}`]: "text-left",
|
|
21064
|
-
[`${ButtonTextAlign.CENTER}`]: "text-center",
|
|
21065
|
-
[`${ButtonTextAlign.RIGHT}`]: "text-right"
|
|
21141
|
+
[`${ButtonTextAlign.LEFT}`]: "justify-start text-left",
|
|
21142
|
+
[`${ButtonTextAlign.CENTER}`]: "justify-center text-center",
|
|
21143
|
+
[`${ButtonTextAlign.RIGHT}`]: "justify-end text-right"
|
|
21066
21144
|
},
|
|
21067
21145
|
isFullWidth: {
|
|
21068
21146
|
true: "w-full",
|
|
21069
21147
|
false: ""
|
|
21070
|
-
},
|
|
21071
|
-
hasIconLeft: {
|
|
21072
|
-
true: "px-12",
|
|
21073
|
-
false: ""
|
|
21074
|
-
},
|
|
21075
|
-
hasIconRight: {
|
|
21076
|
-
true: "pr-8",
|
|
21077
|
-
false: ""
|
|
21078
21148
|
}
|
|
21079
21149
|
},
|
|
21080
21150
|
defaultVariants: {
|
|
21081
|
-
variant: ButtonVariant.DEFAULT
|
|
21082
|
-
size: ButtonSize.MD
|
|
21083
|
-
color: ButtonColor.CUSTOM
|
|
21084
|
-
|
|
21085
|
-
|
|
21086
|
-
|
|
21087
|
-
hasIconLeft: false
|
|
21151
|
+
variant: `${ButtonVariant.DEFAULT}`,
|
|
21152
|
+
size: `${ButtonSize.MD}`,
|
|
21153
|
+
color: `${ButtonColor.CUSTOM}`,
|
|
21154
|
+
roundedSize: `${ContainerRoundedSize.MD}`,
|
|
21155
|
+
textAlign: `${ButtonTextAlign.CENTER}`,
|
|
21156
|
+
isFullWidth: false
|
|
21088
21157
|
}
|
|
21089
21158
|
});
|
|
21090
|
-
const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, IconRight, iconClassName, isLoading = false, isActive = false, isSelected = false, isFullWidth = false, textAlign, disabled, label, className, type = "button", "aria-describedby": ariaDescribedBy, "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, "aria-pressed": ariaPressed, ...props }) => {
|
|
21091
|
-
const isLink = variant === ButtonVariant.LINK || variant === ButtonVariant.INVISIBLE_LINK
|
|
21159
|
+
const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, IconRight, iconClassName, isLoading = false, isActive = false, isSelected = false, isFullWidth = false, roundedSize, textAlign, disabled, label, className, type = "button", "aria-describedby": ariaDescribedBy, "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, "aria-pressed": ariaPressed, ...props }) => {
|
|
21160
|
+
const isLink = variant === `${ButtonVariant.LINK}` || variant === `${ButtonVariant.INVISIBLE_LINK}`;
|
|
21092
21161
|
const isIconOnly = !children && (Icon2 || IconRight);
|
|
21093
21162
|
const accessibilityProps = {
|
|
21094
|
-
"aria-label": isIconOnly ? label : void 0,
|
|
21163
|
+
"aria-label": isIconOnly ? label ?? void 0 : void 0,
|
|
21095
21164
|
"aria-labelledby": !isIconOnly ? void 0 : void 0,
|
|
21096
21165
|
"aria-describedby": ariaDescribedBy,
|
|
21097
21166
|
"aria-expanded": ariaExpanded,
|
|
@@ -21102,6 +21171,7 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21102
21171
|
"aria-disabled": disabled || isLoading,
|
|
21103
21172
|
"aria-selected": isSelected
|
|
21104
21173
|
};
|
|
21174
|
+
const isSquareButton = size2 === ButtonSize.ICON_SM || size2 === ButtonSize.ICON_MD || size2 === ButtonSize.ICON_LG || size2 === ButtonSize.ICON_XL;
|
|
21105
21175
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("button", {
|
|
21106
21176
|
disabled: isLoading || disabled,
|
|
21107
21177
|
role: isLink ? "link" : "button",
|
|
@@ -21111,9 +21181,8 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21111
21181
|
size: size2,
|
|
21112
21182
|
color: color2,
|
|
21113
21183
|
isFullWidth,
|
|
21184
|
+
roundedSize,
|
|
21114
21185
|
textAlign: textAlign ?? (IconRight ? ButtonTextAlign.LEFT : ButtonTextAlign.CENTER),
|
|
21115
|
-
hasIconLeft: Boolean(typeof children !== "undefined" && (typeof Icon2 !== "undefined" || isLoading)),
|
|
21116
|
-
hasIconRight: Boolean(typeof children !== "undefined" && typeof IconRight !== "undefined"),
|
|
21117
21186
|
className
|
|
21118
21187
|
}),
|
|
21119
21188
|
...accessibilityProps,
|
|
@@ -21122,22 +21191,26 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21122
21191
|
Icon2 && !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, {
|
|
21123
21192
|
className: buttonIconVariants({
|
|
21124
21193
|
size: size2,
|
|
21125
|
-
className: iconClassName
|
|
21126
|
-
position: ButtonIconPosition.LEFT
|
|
21194
|
+
className: cn$2(!isSquareButton && "mr-3", iconClassName)
|
|
21127
21195
|
}),
|
|
21128
21196
|
"aria-hidden": "true"
|
|
21129
21197
|
}),
|
|
21130
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21131
|
-
className:
|
|
21132
|
-
|
|
21133
|
-
className:
|
|
21134
|
-
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21198
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
21199
|
+
className: cn$2("flex w-0 items-center justify-center transition-[width] duration-300", isLoading && size2 === ButtonSize.SM && "w-3", isLoading && size2 === ButtonSize.MD && "w-4", isLoading && size2 === ButtonSize.LG && "w-5", isLoading && size2 === ButtonSize.XL && "w-6"),
|
|
21200
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, {
|
|
21201
|
+
className: buttonIconVariants({
|
|
21202
|
+
size: size2,
|
|
21203
|
+
className: cn$2(!isSquareButton && "mr-3", iconClassName)
|
|
21204
|
+
}),
|
|
21205
|
+
isLoading,
|
|
21206
|
+
"aria-hidden": "true",
|
|
21207
|
+
"data-testid": "loader"
|
|
21208
|
+
})
|
|
21209
|
+
}),
|
|
21210
|
+
children && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
21211
|
+
className: "flex-1 truncate whitespace-nowrap",
|
|
21212
|
+
children
|
|
21139
21213
|
}),
|
|
21140
|
-
children && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children }),
|
|
21141
21214
|
!children && isIconOnly && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
21142
21215
|
className: "sr-only",
|
|
21143
21216
|
children: label
|
|
@@ -21145,8 +21218,7 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21145
21218
|
IconRight && /* @__PURE__ */ jsxRuntimeExports.jsx(IconRight, {
|
|
21146
21219
|
className: buttonIconVariants({
|
|
21147
21220
|
size: size2,
|
|
21148
|
-
className: iconClassName
|
|
21149
|
-
position: ButtonIconPosition.RIGHT
|
|
21221
|
+
className: cn$2(!isSquareButton && "ml-3", iconClassName)
|
|
21150
21222
|
}),
|
|
21151
21223
|
"aria-hidden": "true"
|
|
21152
21224
|
})
|
|
@@ -21157,11 +21229,11 @@ const MaxHeightSmoother = ({ children, isHidden: isHidden2, className = "", isOv
|
|
|
21157
21229
|
"aria-hidden": isFocusable ? isHidden2 : void 0,
|
|
21158
21230
|
tabIndex: isFocusable ? 0 : void 0,
|
|
21159
21231
|
role: isFocusable ? "button" : "none",
|
|
21160
|
-
className: cn$
|
|
21232
|
+
className: cn$2("group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out", typeof isHidden2 !== "undefined" && !isHidden2 && "grid-rows-[1fr] overflow-x-auto", isOverable && "hover:grid-rows-[1fr] hover:overflow-x-auto", isFocusable && "focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto", className),
|
|
21161
21233
|
...props,
|
|
21162
21234
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
21163
21235
|
style: { minHeight: `${minHeight}px` },
|
|
21164
|
-
className: cn$
|
|
21236
|
+
className: cn$2(isOverable && "group-hover/height-smoother:visible", isFocusable && "group-focus/height-smoother:visible", className),
|
|
21165
21237
|
children
|
|
21166
21238
|
})
|
|
21167
21239
|
});
|
|
@@ -21240,56 +21312,56 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
21240
21312
|
Component.displayName = toPascalCase(iconName);
|
|
21241
21313
|
return Component;
|
|
21242
21314
|
};
|
|
21243
|
-
const __iconNode$
|
|
21315
|
+
const __iconNode$q = [
|
|
21244
21316
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
21245
21317
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
21246
21318
|
];
|
|
21247
|
-
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$
|
|
21248
|
-
const __iconNode$
|
|
21319
|
+
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$q);
|
|
21320
|
+
const __iconNode$p = [
|
|
21249
21321
|
["path", { d: "m18 9-6-6-6 6", key: "kcunyi" }],
|
|
21250
21322
|
["path", { d: "M12 3v14", key: "7cf3v8" }],
|
|
21251
21323
|
["path", { d: "M5 21h14", key: "11awu3" }]
|
|
21252
21324
|
];
|
|
21253
|
-
const ArrowUpFromLine = createLucideIcon("arrow-up-from-line", __iconNode$
|
|
21254
|
-
const __iconNode$
|
|
21255
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
21256
|
-
const __iconNode$
|
|
21257
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
21258
|
-
const __iconNode$
|
|
21259
|
-
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$
|
|
21260
|
-
const __iconNode$
|
|
21261
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
21262
|
-
const __iconNode$
|
|
21263
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$
|
|
21264
|
-
const __iconNode$
|
|
21325
|
+
const ArrowUpFromLine = createLucideIcon("arrow-up-from-line", __iconNode$p);
|
|
21326
|
+
const __iconNode$o = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
21327
|
+
const Check = createLucideIcon("check", __iconNode$o);
|
|
21328
|
+
const __iconNode$n = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
21329
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$n);
|
|
21330
|
+
const __iconNode$m = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
21331
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$m);
|
|
21332
|
+
const __iconNode$l = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
21333
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$l);
|
|
21334
|
+
const __iconNode$k = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
21335
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$k);
|
|
21336
|
+
const __iconNode$j = [
|
|
21265
21337
|
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
21266
21338
|
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
21267
21339
|
];
|
|
21268
|
-
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$
|
|
21269
|
-
const __iconNode$
|
|
21340
|
+
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$j);
|
|
21341
|
+
const __iconNode$i = [
|
|
21270
21342
|
["path", { d: "m12 15 2 2 4-4", key: "2c609p" }],
|
|
21271
21343
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
21272
21344
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
21273
21345
|
];
|
|
21274
|
-
const CopyCheck = createLucideIcon("copy-check", __iconNode$
|
|
21275
|
-
const __iconNode$
|
|
21346
|
+
const CopyCheck = createLucideIcon("copy-check", __iconNode$i);
|
|
21347
|
+
const __iconNode$h = [
|
|
21276
21348
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
21277
21349
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
21278
21350
|
];
|
|
21279
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
21280
|
-
const __iconNode$
|
|
21351
|
+
const Copy = createLucideIcon("copy", __iconNode$h);
|
|
21352
|
+
const __iconNode$g = [
|
|
21281
21353
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
21282
21354
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
21283
21355
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
21284
21356
|
];
|
|
21285
|
-
const Download = createLucideIcon("download", __iconNode$
|
|
21286
|
-
const __iconNode$
|
|
21357
|
+
const Download = createLucideIcon("download", __iconNode$g);
|
|
21358
|
+
const __iconNode$f = [
|
|
21287
21359
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
21288
21360
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
21289
21361
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
21290
21362
|
];
|
|
21291
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
21292
|
-
const __iconNode$
|
|
21363
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$f);
|
|
21364
|
+
const __iconNode$e = [
|
|
21293
21365
|
[
|
|
21294
21366
|
"path",
|
|
21295
21367
|
{
|
|
@@ -21307,8 +21379,8 @@ const __iconNode$d = [
|
|
|
21307
21379
|
],
|
|
21308
21380
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
21309
21381
|
];
|
|
21310
|
-
const EyeOff = createLucideIcon("eye-off", __iconNode$
|
|
21311
|
-
const __iconNode$
|
|
21382
|
+
const EyeOff = createLucideIcon("eye-off", __iconNode$e);
|
|
21383
|
+
const __iconNode$d = [
|
|
21312
21384
|
[
|
|
21313
21385
|
"path",
|
|
21314
21386
|
{
|
|
@@ -21318,13 +21390,15 @@ const __iconNode$c = [
|
|
|
21318
21390
|
],
|
|
21319
21391
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
21320
21392
|
];
|
|
21321
|
-
const Eye = createLucideIcon("eye", __iconNode$
|
|
21322
|
-
const __iconNode$
|
|
21393
|
+
const Eye = createLucideIcon("eye", __iconNode$d);
|
|
21394
|
+
const __iconNode$c = [
|
|
21323
21395
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
21324
21396
|
["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
|
|
21325
21397
|
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
21326
21398
|
];
|
|
21327
|
-
const Globe = createLucideIcon("globe", __iconNode$
|
|
21399
|
+
const Globe = createLucideIcon("globe", __iconNode$c);
|
|
21400
|
+
const __iconNode$b = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
21401
|
+
const Minus = createLucideIcon("minus", __iconNode$b);
|
|
21328
21402
|
const __iconNode$a = [
|
|
21329
21403
|
["path", { d: "M11 19H5v-6", key: "8awifj" }],
|
|
21330
21404
|
["path", { d: "M13 5h6v6", key: "7voy1q" }],
|
|
@@ -21437,9 +21511,9 @@ const Accordion = ({ children, header, isOpen, defaultIsOpen = false, onToggle,
|
|
|
21437
21511
|
onKeyDown: handleKeyDown,
|
|
21438
21512
|
disabled,
|
|
21439
21513
|
isFullWidth: true,
|
|
21440
|
-
className: cn$
|
|
21514
|
+
className: cn$2("flex items-center justify-between gap-2", headerClassName),
|
|
21441
21515
|
IconRight: ChevronDown,
|
|
21442
|
-
iconClassName: cn$
|
|
21516
|
+
iconClassName: cn$2("transform transition-transform duration-500 ease-in-out", isExpandedState ? "rotate-0" : "-rotate-180"),
|
|
21443
21517
|
"aria-expanded": isExpandedState,
|
|
21444
21518
|
"aria-controls": generatedContentId,
|
|
21445
21519
|
"aria-label": ariaLabel,
|
|
@@ -21528,7 +21602,7 @@ const Badge = ({ className, variant = BadgeVariant.DEFAULT, color: color2 = Badg
|
|
|
21528
21602
|
onDismiss?.();
|
|
21529
21603
|
};
|
|
21530
21604
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Component, {
|
|
21531
|
-
className: cn$
|
|
21605
|
+
className: cn$2(badgeVariants({
|
|
21532
21606
|
variant,
|
|
21533
21607
|
color: color2,
|
|
21534
21608
|
size: size2
|
|
@@ -21637,7 +21711,7 @@ const Link = (props) => {
|
|
|
21637
21711
|
rel,
|
|
21638
21712
|
target,
|
|
21639
21713
|
"aria-current": isActive ? "page" : void 0,
|
|
21640
|
-
className: cn$
|
|
21714
|
+
className: cn$2(linkVariants({
|
|
21641
21715
|
variant,
|
|
21642
21716
|
color: color2,
|
|
21643
21717
|
underlined,
|
|
@@ -21712,7 +21786,7 @@ const ButtonLink = ({ children: text, onClick, color: color2, position, classNam
|
|
|
21712
21786
|
};
|
|
21713
21787
|
const Span = ({ children, position, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
21714
21788
|
itemProp: "item",
|
|
21715
|
-
className: cn$
|
|
21789
|
+
className: cn$2("inline-flex items-center", "font-medium text-neutral-700", "transition-colors duration-200", className),
|
|
21716
21790
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
21717
21791
|
itemProp: "name",
|
|
21718
21792
|
...props,
|
|
@@ -21731,7 +21805,7 @@ const Breadcrumb = ({ links, className, color: color2 = LinkColor.TEXT, locale,
|
|
|
21731
21805
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("nav", {
|
|
21732
21806
|
"aria-label": ariaLabel,
|
|
21733
21807
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("ol", {
|
|
21734
|
-
className: cn$
|
|
21808
|
+
className: cn$2(breadcrumbVariants({
|
|
21735
21809
|
size: size2,
|
|
21736
21810
|
spacing
|
|
21737
21811
|
}), className),
|
|
@@ -21763,7 +21837,7 @@ const Breadcrumb = ({ links, className, color: color2 = LinkColor.TEXT, locale,
|
|
|
21763
21837
|
let section = /* @__PURE__ */ jsxRuntimeExports.jsx(Span, {
|
|
21764
21838
|
position: index2 + 1,
|
|
21765
21839
|
"aria-current": ariaCurrent,
|
|
21766
|
-
className: cn$
|
|
21840
|
+
className: cn$2("transition-colors duration-200", isActive && "text-neutral-900"),
|
|
21767
21841
|
children: text
|
|
21768
21842
|
}, text);
|
|
21769
21843
|
if (isLink) section = /* @__PURE__ */ jsxRuntimeExports.jsx(LinkLink, {
|
|
@@ -21772,7 +21846,7 @@ const Breadcrumb = ({ links, className, color: color2 = LinkColor.TEXT, locale,
|
|
|
21772
21846
|
position: index2 + 1,
|
|
21773
21847
|
locale,
|
|
21774
21848
|
"aria-current": ariaCurrent,
|
|
21775
|
-
className: cn$
|
|
21849
|
+
className: cn$2(isActive && "cursor-default text-neutral-900"),
|
|
21776
21850
|
children: text
|
|
21777
21851
|
}, text);
|
|
21778
21852
|
else if (isButton) section = /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonLink, {
|
|
@@ -21780,7 +21854,7 @@ const Breadcrumb = ({ links, className, color: color2 = LinkColor.TEXT, locale,
|
|
|
21780
21854
|
color: color2,
|
|
21781
21855
|
position: index2 + 1,
|
|
21782
21856
|
"aria-current": ariaCurrent,
|
|
21783
|
-
className: cn$
|
|
21857
|
+
className: cn$2(isActive && "cursor-default text-neutral-900"),
|
|
21784
21858
|
children: text
|
|
21785
21859
|
}, text);
|
|
21786
21860
|
const listElement = /* @__PURE__ */ reactExports.createElement("li", {
|
|
@@ -24066,19 +24140,19 @@ function B({ asChild: r2, children: o2 }, n2) {
|
|
|
24066
24140
|
}
|
|
24067
24141
|
var Te = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
24068
24142
|
const CommandRoot = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e, {
|
|
24069
|
-
className: cn$
|
|
24143
|
+
className: cn$2("flex size-full flex-col overflow-hidden rounded-md", className),
|
|
24070
24144
|
...props
|
|
24071
24145
|
});
|
|
24072
24146
|
const CommandInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
24073
24147
|
className: "flex w-full items-center",
|
|
24074
24148
|
"cmdk-input-wrapper": "",
|
|
24075
24149
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "mr-2 size-4 shrink-0 opacity-50" }), /* @__PURE__ */ jsxRuntimeExports.jsx(_e.Input, {
|
|
24076
|
-
className: cn$
|
|
24150
|
+
className: cn$2("flex w-full rounded-md bg-transparent text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
24077
24151
|
...props
|
|
24078
24152
|
})]
|
|
24079
24153
|
});
|
|
24080
24154
|
const CommandList = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e.List, {
|
|
24081
|
-
className: cn$
|
|
24155
|
+
className: cn$2("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
24082
24156
|
...props
|
|
24083
24157
|
});
|
|
24084
24158
|
const CommandEmpty = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e.Empty, {
|
|
@@ -24086,7 +24160,7 @@ const CommandEmpty = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e.Empty,
|
|
|
24086
24160
|
...props
|
|
24087
24161
|
});
|
|
24088
24162
|
const CommandItem = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e.Item, {
|
|
24089
|
-
className: cn$
|
|
24163
|
+
className: cn$2("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50", className),
|
|
24090
24164
|
...props
|
|
24091
24165
|
});
|
|
24092
24166
|
const Command = {
|
|
@@ -24096,91 +24170,6 @@ const Command = {
|
|
|
24096
24170
|
Empty: CommandEmpty,
|
|
24097
24171
|
Item: CommandItem
|
|
24098
24172
|
};
|
|
24099
|
-
const containerVariants$1 = cva("flex flex-col text-text backdrop-blur", {
|
|
24100
|
-
variants: {
|
|
24101
|
-
roundedSize: {
|
|
24102
|
-
none: "rounded-none",
|
|
24103
|
-
sm: "rounded-sm",
|
|
24104
|
-
md: "rounded-md",
|
|
24105
|
-
lg: "rounded-lg",
|
|
24106
|
-
xl: "rounded-xl",
|
|
24107
|
-
"2xl": "rounded-2xl",
|
|
24108
|
-
"3xl": "rounded-3xl",
|
|
24109
|
-
full: "rounded-full"
|
|
24110
|
-
},
|
|
24111
|
-
transparency: {
|
|
24112
|
-
none: "bg-card",
|
|
24113
|
-
sm: "bg-card/95",
|
|
24114
|
-
md: "bg-card/70",
|
|
24115
|
-
lg: "bg-card/40",
|
|
24116
|
-
xl: "bg-card/20",
|
|
24117
|
-
full: ""
|
|
24118
|
-
},
|
|
24119
|
-
padding: {
|
|
24120
|
-
none: "p-0",
|
|
24121
|
-
sm: "p-1",
|
|
24122
|
-
md: "p-2",
|
|
24123
|
-
lg: "p-3",
|
|
24124
|
-
xl: "p-4"
|
|
24125
|
-
},
|
|
24126
|
-
separator: {
|
|
24127
|
-
without: "",
|
|
24128
|
-
x: "divide-x divide-dashed divide-text/20",
|
|
24129
|
-
y: "divide-y divide-dashed divide-text/20",
|
|
24130
|
-
both: "divide-x divide-y divide-dashed divide-text/20"
|
|
24131
|
-
},
|
|
24132
|
-
border: {
|
|
24133
|
-
none: "",
|
|
24134
|
-
with: "border-[1.5px]"
|
|
24135
|
-
},
|
|
24136
|
-
borderColor: {
|
|
24137
|
-
primary: "border-primary",
|
|
24138
|
-
secondary: "border-secondary",
|
|
24139
|
-
neutral: "border-neutral",
|
|
24140
|
-
text: "border-text",
|
|
24141
|
-
error: "border-error",
|
|
24142
|
-
warning: "border-warning",
|
|
24143
|
-
success: "border-success"
|
|
24144
|
-
},
|
|
24145
|
-
background: {
|
|
24146
|
-
none: "bg-inherit",
|
|
24147
|
-
hoverable: "!bg-opacity-5 hover:!bg-opacity-10 focus:!bg-opacity-10 aria-selected:!bg-opacity-15 backdrop-blur-0 hover:backdrop-blur focus:backdrop-blur aria-selected:backdrop-blur",
|
|
24148
|
-
with: ""
|
|
24149
|
-
},
|
|
24150
|
-
gap: {
|
|
24151
|
-
none: "gap-0",
|
|
24152
|
-
sm: "gap-1",
|
|
24153
|
-
md: "gap-3",
|
|
24154
|
-
lg: "gap-5",
|
|
24155
|
-
xl: "gap-8",
|
|
24156
|
-
"2xl": "gap-10"
|
|
24157
|
-
}
|
|
24158
|
-
},
|
|
24159
|
-
defaultVariants: {
|
|
24160
|
-
roundedSize: "md",
|
|
24161
|
-
border: "none",
|
|
24162
|
-
borderColor: "text",
|
|
24163
|
-
transparency: "md",
|
|
24164
|
-
padding: "none",
|
|
24165
|
-
separator: "without",
|
|
24166
|
-
gap: "none"
|
|
24167
|
-
}
|
|
24168
|
-
});
|
|
24169
|
-
const Container = ({ children, roundedSize, padding, transparency, separator, className, border, borderColor, background, gap, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
24170
|
-
className: cn$1(containerVariants$1({
|
|
24171
|
-
roundedSize,
|
|
24172
|
-
transparency,
|
|
24173
|
-
padding,
|
|
24174
|
-
separator,
|
|
24175
|
-
border: typeof border === "boolean" ? border ? "with" : "none" : void 0,
|
|
24176
|
-
background,
|
|
24177
|
-
borderColor,
|
|
24178
|
-
gap,
|
|
24179
|
-
className
|
|
24180
|
-
})),
|
|
24181
|
-
...props,
|
|
24182
|
-
children
|
|
24183
|
-
});
|
|
24184
24173
|
const CopyButton = ({ content: content2, ...props }) => {
|
|
24185
24174
|
const [copied, setCopied] = reactExports.useState(false);
|
|
24186
24175
|
const [error, setError] = reactExports.useState(false);
|
|
@@ -24225,27 +24214,27 @@ const CopyButton = ({ content: content2, ...props }) => {
|
|
|
24225
24214
|
const styledHeading = `relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`;
|
|
24226
24215
|
const styledAfter = `after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100`;
|
|
24227
24216
|
const StyledH1 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h1", {
|
|
24228
|
-
className: cn$
|
|
24217
|
+
className: cn$2("font-bold text-2xl", className),
|
|
24229
24218
|
...props
|
|
24230
24219
|
});
|
|
24231
24220
|
const StyledH2 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h2", {
|
|
24232
|
-
className: cn$
|
|
24221
|
+
className: cn$2("mb-2 font-bold text-2xl", styledHeading, className),
|
|
24233
24222
|
...props
|
|
24234
24223
|
});
|
|
24235
24224
|
const StyledH3 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h3", {
|
|
24236
|
-
className: cn$
|
|
24225
|
+
className: cn$2("mb-2 font-bold text-xl", styledHeading, className),
|
|
24237
24226
|
...props
|
|
24238
24227
|
});
|
|
24239
24228
|
const StyledH4 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h4", {
|
|
24240
|
-
className: cn$
|
|
24229
|
+
className: cn$2("font-bold text-lg", styledHeading, className),
|
|
24241
24230
|
...props
|
|
24242
24231
|
});
|
|
24243
24232
|
const StyledH5 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h5", {
|
|
24244
|
-
className: cn$
|
|
24233
|
+
className: cn$2("font-bold text-base", styledHeading, className),
|
|
24245
24234
|
...props
|
|
24246
24235
|
});
|
|
24247
24236
|
const StyledH6 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h6", {
|
|
24248
|
-
className: cn$
|
|
24237
|
+
className: cn$2("ml-3 font-bold text-base", styledHeading, className),
|
|
24249
24238
|
...props
|
|
24250
24239
|
});
|
|
24251
24240
|
const getId = (children) => String(children).normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "-").toLowerCase();
|
|
@@ -24282,7 +24271,7 @@ const HeadingWrapper = ({ H: H7, children, className, isClickable, ...props }) =
|
|
|
24282
24271
|
id: id2,
|
|
24283
24272
|
onClick: isClickable ? onClick : void 0,
|
|
24284
24273
|
"aria-label": isClickable ? `Click to scroll to section ${id2} and copy the link to the clipboard` : void 0,
|
|
24285
|
-
className: cn$
|
|
24274
|
+
className: cn$2(isClickable && styledAfter, className),
|
|
24286
24275
|
...props,
|
|
24287
24276
|
children
|
|
24288
24277
|
});
|
|
@@ -24421,7 +24410,7 @@ function requireWithSelector_production() {
|
|
|
24421
24410
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
24422
24411
|
}
|
|
24423
24412
|
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React2.useRef, useEffect = React2.useEffect, useMemo = React2.useMemo, useDebugValue2 = React2.useDebugValue;
|
|
24424
|
-
withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot,
|
|
24413
|
+
withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector2, isEqual) {
|
|
24425
24414
|
var instRef = useRef2(null);
|
|
24426
24415
|
if (null === instRef.current) {
|
|
24427
24416
|
var inst = { hasValue: false, value: null };
|
|
@@ -24433,7 +24422,7 @@ function requireWithSelector_production() {
|
|
|
24433
24422
|
if (!hasMemo) {
|
|
24434
24423
|
hasMemo = true;
|
|
24435
24424
|
memoizedSnapshot = nextSnapshot;
|
|
24436
|
-
nextSnapshot =
|
|
24425
|
+
nextSnapshot = selector2(nextSnapshot);
|
|
24437
24426
|
if (void 0 !== isEqual && inst.hasValue) {
|
|
24438
24427
|
var currentSelection = inst.value;
|
|
24439
24428
|
if (isEqual(currentSelection, nextSnapshot))
|
|
@@ -24443,7 +24432,7 @@ function requireWithSelector_production() {
|
|
|
24443
24432
|
}
|
|
24444
24433
|
currentSelection = memoizedSelection;
|
|
24445
24434
|
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
24446
|
-
var nextSelection =
|
|
24435
|
+
var nextSelection = selector2(nextSnapshot);
|
|
24447
24436
|
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
24448
24437
|
return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
24449
24438
|
memoizedSnapshot = nextSnapshot;
|
|
@@ -24459,7 +24448,7 @@ function requireWithSelector_production() {
|
|
|
24459
24448
|
}
|
|
24460
24449
|
];
|
|
24461
24450
|
},
|
|
24462
|
-
[getSnapshot, getServerSnapshot,
|
|
24451
|
+
[getSnapshot, getServerSnapshot, selector2, isEqual]
|
|
24463
24452
|
);
|
|
24464
24453
|
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
24465
24454
|
useEffect(
|
|
@@ -24490,7 +24479,7 @@ const { useDebugValue } = We;
|
|
|
24490
24479
|
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
|
24491
24480
|
let didWarnAboutEqualityFn = false;
|
|
24492
24481
|
const identity = (arg) => arg;
|
|
24493
|
-
function useStore(api,
|
|
24482
|
+
function useStore(api, selector2 = identity, equalityFn) {
|
|
24494
24483
|
if ((__vite_import_meta_env__ ? "production" : void 0) !== "production" && equalityFn && !didWarnAboutEqualityFn) {
|
|
24495
24484
|
console.warn(
|
|
24496
24485
|
"[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"
|
|
@@ -24501,7 +24490,7 @@ function useStore(api, selector = identity, equalityFn) {
|
|
|
24501
24490
|
api.subscribe,
|
|
24502
24491
|
api.getState,
|
|
24503
24492
|
api.getServerState || api.getInitialState,
|
|
24504
|
-
|
|
24493
|
+
selector2,
|
|
24505
24494
|
equalityFn
|
|
24506
24495
|
);
|
|
24507
24496
|
useDebugValue(slice);
|
|
@@ -24514,7 +24503,7 @@ const createImpl = (createState2) => {
|
|
|
24514
24503
|
);
|
|
24515
24504
|
}
|
|
24516
24505
|
const api = typeof createState2 === "function" ? createStore(createState2) : createState2;
|
|
24517
|
-
const useBoundStore = (
|
|
24506
|
+
const useBoundStore = (selector2, equalityFn) => useStore(api, selector2, equalityFn);
|
|
24518
24507
|
Object.assign(useBoundStore, api);
|
|
24519
24508
|
return useBoundStore;
|
|
24520
24509
|
};
|
|
@@ -24590,10 +24579,10 @@ function shallow(objA, objB) {
|
|
|
24590
24579
|
return true;
|
|
24591
24580
|
}
|
|
24592
24581
|
const { useRef } = We;
|
|
24593
|
-
function useShallow(
|
|
24582
|
+
function useShallow(selector2) {
|
|
24594
24583
|
const prev = useRef();
|
|
24595
24584
|
return (state) => {
|
|
24596
|
-
const next =
|
|
24585
|
+
const next = selector2(state);
|
|
24597
24586
|
return shallow(prev.current, next) ? prev.current : prev.current = next;
|
|
24598
24587
|
};
|
|
24599
24588
|
}
|
|
@@ -31787,7 +31776,7 @@ let ModalSize = /* @__PURE__ */ (function(ModalSize$1) {
|
|
|
31787
31776
|
ModalSize$1["UNSET"] = "unset";
|
|
31788
31777
|
return ModalSize$1;
|
|
31789
31778
|
})({});
|
|
31790
|
-
const modalVariants = cva("cursor-default justify-center overflow-auto
|
|
31779
|
+
const modalVariants = cva("cursor-default justify-center overflow-auto p-3 shadow-sm", {
|
|
31791
31780
|
variants: { size: {
|
|
31792
31781
|
sm: "h-auto max-h-[30vh] w-[95vw] max-w-xl",
|
|
31793
31782
|
md: "h-auto max-h-[50vh] w-[95vw] max-w-xl",
|
|
@@ -31804,6 +31793,15 @@ const Modal = ({ children, isOpen, container, disableScroll = true, onClose, has
|
|
|
31804
31793
|
key: "modal",
|
|
31805
31794
|
disableScroll: isOpen && disableScroll
|
|
31806
31795
|
});
|
|
31796
|
+
reactExports.useEffect(() => {
|
|
31797
|
+
const handleEscape = (event) => {
|
|
31798
|
+
if (event.key === "Escape" && isOpen && onClose) onClose();
|
|
31799
|
+
};
|
|
31800
|
+
document.addEventListener("keydown", handleEscape);
|
|
31801
|
+
return () => {
|
|
31802
|
+
document.removeEventListener("keydown", handleEscape);
|
|
31803
|
+
};
|
|
31804
|
+
}, [isOpen, onClose]);
|
|
31807
31805
|
if (!containerElement) return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
31808
31806
|
const hasTitle = typeof title === "string";
|
|
31809
31807
|
return reactDomExports.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(motion.div, {
|
|
@@ -31832,58 +31830,63 @@ const Modal = ({ children, isOpen, container, disableScroll = true, onClose, has
|
|
|
31832
31830
|
onClose?.();
|
|
31833
31831
|
},
|
|
31834
31832
|
"aria-hidden": !isOpen,
|
|
31835
|
-
children: /* @__PURE__ */ jsxRuntimeExports.
|
|
31836
|
-
|
|
31837
|
-
|
|
31838
|
-
|
|
31839
|
-
|
|
31840
|
-
|
|
31841
|
-
|
|
31842
|
-
className
|
|
31843
|
-
|
|
31844
|
-
|
|
31845
|
-
|
|
31846
|
-
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.
|
|
31851
|
-
className:
|
|
31852
|
-
children:
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31858
|
-
|
|
31859
|
-
|
|
31860
|
-
|
|
31861
|
-
|
|
31862
|
-
|
|
31863
|
-
|
|
31864
|
-
Icon: X$1,
|
|
31865
|
-
size: ButtonSize.ICON_MD
|
|
31866
|
-
})]
|
|
31867
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
31868
|
-
className: "flex flex-1 flex-col items-center overflow-auto",
|
|
31869
|
-
children
|
|
31833
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(MotionModal, {
|
|
31834
|
+
onClick: (e) => e.stopPropagation(),
|
|
31835
|
+
initial: { scale: isOpen ? 0.5 : 1 },
|
|
31836
|
+
animate: { scale: isOpen ? 1 : 0.5 },
|
|
31837
|
+
transition: { duration: 0.3 },
|
|
31838
|
+
className: modalVariants({
|
|
31839
|
+
size: size2,
|
|
31840
|
+
className
|
|
31841
|
+
}),
|
|
31842
|
+
role: "dialog",
|
|
31843
|
+
"aria-modal": true,
|
|
31844
|
+
roundedSize: "2xl",
|
|
31845
|
+
...props,
|
|
31846
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
31847
|
+
className: cn$2("cursor-default", hasCloseButton && hasTitle ? `flex items-start` : hasCloseButton ? `flex justify-end` : hasTitle ? `items-center` : `hidden`),
|
|
31848
|
+
children: [hasTitle && /* @__PURE__ */ jsxRuntimeExports.jsx(H3, {
|
|
31849
|
+
className: "mt-2 mb-4 ml-4 flex items-center justify-center font-bold text-lg",
|
|
31850
|
+
children: title
|
|
31851
|
+
}), hasCloseButton && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
31852
|
+
variant: ButtonVariant.HOVERABLE,
|
|
31853
|
+
color: ButtonColor.TEXT,
|
|
31854
|
+
label: "Close modal",
|
|
31855
|
+
className: "ml-auto",
|
|
31856
|
+
onClick: (e) => {
|
|
31857
|
+
e.stopPropagation();
|
|
31858
|
+
onClose?.();
|
|
31859
|
+
},
|
|
31860
|
+
Icon: X$1,
|
|
31861
|
+
size: ButtonSize.ICON_MD
|
|
31870
31862
|
})]
|
|
31871
|
-
})
|
|
31863
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
31864
|
+
className: "flex flex-1 flex-col items-center",
|
|
31865
|
+
children
|
|
31866
|
+
})]
|
|
31872
31867
|
})
|
|
31873
31868
|
}), containerElement);
|
|
31874
31869
|
};
|
|
31875
|
-
const checkboxVariants = cva(
|
|
31870
|
+
const checkboxVariants = cva([
|
|
31871
|
+
"appearance-none",
|
|
31872
|
+
"pointer relative border-2",
|
|
31873
|
+
"focus:outline-0",
|
|
31874
|
+
"checked:border-current checked:bg-current checked:hover:bg-current/80",
|
|
31875
|
+
"ring-current/20 ring-offset-current",
|
|
31876
|
+
"hover:bg-current/20",
|
|
31877
|
+
"disabled:opacity-50",
|
|
31878
|
+
"ring-0 transition-all duration-300 ease-in-out hover:ring-4 focus-visible:ring-6",
|
|
31879
|
+
"checked:before:absolute checked:before:inset-0 checked:before:content-['✓']",
|
|
31880
|
+
"checked:before:flex checked:before:items-center checked:before:justify-center",
|
|
31881
|
+
"checked:before:text-text-opposite/80",
|
|
31882
|
+
"rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl"
|
|
31883
|
+
].join(" "), {
|
|
31876
31884
|
variants: {
|
|
31877
|
-
variant: { default:
|
|
31878
|
-
"pointer rounded border-2 bg-input-background text-input-text shadow-none outline-0 transition-all",
|
|
31879
|
-
"border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]",
|
|
31880
|
-
"checked:border-checkbox-checked-border checked:bg-checkbox-checked",
|
|
31881
|
-
"disabled:opacity-50"
|
|
31882
|
-
] },
|
|
31885
|
+
variant: { default: "" },
|
|
31883
31886
|
size: {
|
|
31884
|
-
sm: "size-4",
|
|
31885
|
-
md: "size-5",
|
|
31886
|
-
lg: "size-6"
|
|
31887
|
+
sm: "size-4 rounded-md",
|
|
31888
|
+
md: "size-5 rounded-lg",
|
|
31889
|
+
lg: "size-6 rounded-xl"
|
|
31887
31890
|
},
|
|
31888
31891
|
color: {
|
|
31889
31892
|
primary: "accent-primary",
|
|
@@ -31911,20 +31914,19 @@ const checkboxVariants = cva("", {
|
|
|
31911
31914
|
});
|
|
31912
31915
|
const Input$1 = ({ validationStyleEnabled = false, label, size: size2, color: color2, name, variant, className, labelClassName, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("input", {
|
|
31913
31916
|
type: "checkbox",
|
|
31914
|
-
className: checkboxVariants({
|
|
31917
|
+
className: cn$2(checkboxVariants({
|
|
31915
31918
|
variant,
|
|
31916
31919
|
size: size2,
|
|
31917
31920
|
color: color2,
|
|
31918
|
-
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled"
|
|
31919
|
-
|
|
31920
|
-
}),
|
|
31921
|
+
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled"
|
|
31922
|
+
}), className),
|
|
31921
31923
|
...props
|
|
31922
31924
|
});
|
|
31923
31925
|
const Checkbox = (props) => {
|
|
31924
31926
|
const { label, name, id: id2 } = props;
|
|
31925
31927
|
return label ? /* @__PURE__ */ jsxRuntimeExports.jsxs("label", {
|
|
31926
31928
|
htmlFor: id2 ?? name,
|
|
31927
|
-
className: cn$
|
|
31929
|
+
className: cn$2("flex w-full cursor-pointer items-center gap-x-4 font-medium text-sm", props.labelClassName),
|
|
31928
31930
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Input$1, {
|
|
31929
31931
|
id: id2 ?? name,
|
|
31930
31932
|
...props
|
|
@@ -31934,20 +31936,32 @@ const Checkbox = (props) => {
|
|
|
31934
31936
|
...props
|
|
31935
31937
|
});
|
|
31936
31938
|
};
|
|
31937
|
-
const
|
|
31939
|
+
const cn$1 = (...classes) => classes.filter(Boolean).join(" ");
|
|
31940
|
+
const inputVariants = cva([
|
|
31941
|
+
"w-full select-text resize-none text-base shadow-none outline-none",
|
|
31942
|
+
"transition-shadow duration-100 md:text-sm",
|
|
31943
|
+
"ring-0",
|
|
31944
|
+
"disabled:opacity-50",
|
|
31945
|
+
"rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl"
|
|
31946
|
+
].join(" "), {
|
|
31938
31947
|
variants: {
|
|
31939
31948
|
variant: {
|
|
31940
31949
|
default: [
|
|
31941
|
-
"
|
|
31942
|
-
"
|
|
31943
|
-
"
|
|
31944
|
-
"
|
|
31945
|
-
|
|
31946
|
-
|
|
31950
|
+
"text-text",
|
|
31951
|
+
"bg-neutral-50 dark:bg-neutral-950",
|
|
31952
|
+
"ring-neutral-100 dark:ring-neutral-700",
|
|
31953
|
+
"ring-offset-neutral-100 dark:ring-offset-neutral-700",
|
|
31954
|
+
"focus-visible:outline-none",
|
|
31955
|
+
"disabled:ring-0",
|
|
31956
|
+
"focus-visible:ring-3",
|
|
31957
|
+
"[box-shadow:none] focus:[box-shadow:none]",
|
|
31958
|
+
"aria-invalid:border-error"
|
|
31959
|
+
].join(" "),
|
|
31960
|
+
invisible: ["border-none bg-inherit text-inherit outline-none ring-0"].join(" ")
|
|
31947
31961
|
},
|
|
31948
31962
|
size: {
|
|
31949
|
-
md: "px-2 py-3 md:py-
|
|
31950
|
-
lg: "p-4
|
|
31963
|
+
md: "px-2 py-3 md:py-2",
|
|
31964
|
+
lg: "p-4"
|
|
31951
31965
|
},
|
|
31952
31966
|
validationStyleEnabled: {
|
|
31953
31967
|
disabled: "",
|
|
@@ -31966,12 +31980,11 @@ let InputVariant = /* @__PURE__ */ (function(InputVariant$1) {
|
|
|
31966
31980
|
return InputVariant$1;
|
|
31967
31981
|
})({});
|
|
31968
31982
|
const Input = ({ validationStyleEnabled = false, variant, size: size2, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("input", {
|
|
31969
|
-
className: inputVariants({
|
|
31983
|
+
className: cn$1(inputVariants({
|
|
31970
31984
|
variant,
|
|
31971
31985
|
size: size2,
|
|
31972
|
-
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled"
|
|
31973
|
-
|
|
31974
|
-
}),
|
|
31986
|
+
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled"
|
|
31987
|
+
}), className),
|
|
31975
31988
|
...props
|
|
31976
31989
|
});
|
|
31977
31990
|
const InputPassword = (props) => {
|
|
@@ -31994,18 +32007,477 @@ const InputPassword = (props) => {
|
|
|
31994
32007
|
onClick: handlePasswordReveal,
|
|
31995
32008
|
"aria-label": isPasswordRevealed ? "Hide password" : "Show password",
|
|
31996
32009
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(EyeIconComponent, {
|
|
31997
|
-
className: "mr-2 inline-block text-neutral",
|
|
32010
|
+
className: "mr-2 inline-block cursor-pointer text-neutral",
|
|
31998
32011
|
size: 20
|
|
31999
32012
|
})
|
|
32000
32013
|
})]
|
|
32001
32014
|
});
|
|
32002
32015
|
};
|
|
32016
|
+
const syncTimeouts = (cb) => {
|
|
32017
|
+
return [
|
|
32018
|
+
setTimeout(cb, 0),
|
|
32019
|
+
setTimeout(cb, 10),
|
|
32020
|
+
setTimeout(cb, 50)
|
|
32021
|
+
];
|
|
32022
|
+
};
|
|
32023
|
+
const safeInsertRule = (sheet, rule) => {
|
|
32024
|
+
try {
|
|
32025
|
+
sheet.insertRule(rule);
|
|
32026
|
+
} catch {
|
|
32027
|
+
console.error("input-otp could not insert CSS rule:", rule);
|
|
32028
|
+
}
|
|
32029
|
+
};
|
|
32030
|
+
const NOSCRIPT_CSS_FALLBACK = `
|
|
32031
|
+
[data-input-otp] {
|
|
32032
|
+
--nojs-bg: white !important;
|
|
32033
|
+
--nojs-fg: black !important;
|
|
32034
|
+
|
|
32035
|
+
background-color: var(--nojs-bg) !important;
|
|
32036
|
+
color: var(--nojs-fg) !important;
|
|
32037
|
+
caret-color: var(--nojs-fg) !important;
|
|
32038
|
+
letter-spacing: .25em !important;
|
|
32039
|
+
text-align: center !important;
|
|
32040
|
+
border: 1px solid var(--nojs-fg) !important;
|
|
32041
|
+
border-radius: 4px !important;
|
|
32042
|
+
width: 100% !important;
|
|
32043
|
+
}
|
|
32044
|
+
@media (prefers-color-scheme: dark) {
|
|
32045
|
+
[data-input-otp] {
|
|
32046
|
+
--nojs-bg: black !important;
|
|
32047
|
+
--nojs-fg: white !important;
|
|
32048
|
+
}
|
|
32049
|
+
}`;
|
|
32050
|
+
const PWM_BADGE_MARGIN_RIGHT = 18;
|
|
32051
|
+
const PWM_BADGE_SPACE_WIDTH_PX = 40;
|
|
32052
|
+
const PWM_BADGE_SPACE_WIDTH = `${PWM_BADGE_SPACE_WIDTH_PX}px`;
|
|
32053
|
+
const PASSWORD_MANAGERS_SELECTORS = [
|
|
32054
|
+
"[data-lastpass-icon-root]",
|
|
32055
|
+
"com-1password-button",
|
|
32056
|
+
"[data-dashlanecreated]",
|
|
32057
|
+
'[style$="2147483647 !important;"]'
|
|
32058
|
+
].join(",");
|
|
32059
|
+
const usePasswordManagerBadge = ({ containerRef, inputRef, pushPasswordManagerStrategy, isFocused }) => {
|
|
32060
|
+
const [hasPWMBadge, setHasPWMBadge] = reactExports.useState(false);
|
|
32061
|
+
const [hasPWMBadgeSpace, setHasPWMBadgeSpace] = reactExports.useState(false);
|
|
32062
|
+
const [done, setDone] = reactExports.useState(false);
|
|
32063
|
+
const willPushPWMBadge = pushPasswordManagerStrategy === "none" ? false : (pushPasswordManagerStrategy === "increase-width" || pushPasswordManagerStrategy === "experimental-no-flickering") && hasPWMBadge && hasPWMBadgeSpace;
|
|
32064
|
+
const trackPWMBadge = () => {
|
|
32065
|
+
const container = containerRef.current;
|
|
32066
|
+
const input = inputRef.current;
|
|
32067
|
+
if (!container || !input || done || pushPasswordManagerStrategy === "none") return;
|
|
32068
|
+
const elementToCompare = container;
|
|
32069
|
+
const rightCornerX = elementToCompare.getBoundingClientRect().left + elementToCompare.offsetWidth;
|
|
32070
|
+
const centereredY = elementToCompare.getBoundingClientRect().top + elementToCompare.offsetHeight / 2;
|
|
32071
|
+
const x = rightCornerX - PWM_BADGE_MARGIN_RIGHT;
|
|
32072
|
+
const y = centereredY;
|
|
32073
|
+
if (document.querySelectorAll(PASSWORD_MANAGERS_SELECTORS).length === 0) {
|
|
32074
|
+
if (document.elementFromPoint(x, y) === container) return;
|
|
32075
|
+
}
|
|
32076
|
+
setHasPWMBadge(true);
|
|
32077
|
+
setDone(true);
|
|
32078
|
+
};
|
|
32079
|
+
reactExports.useEffect(() => {
|
|
32080
|
+
const container = containerRef.current;
|
|
32081
|
+
if (!container || pushPasswordManagerStrategy === "none") return;
|
|
32082
|
+
const checkHasSpace = () => {
|
|
32083
|
+
setHasPWMBadgeSpace(window.innerWidth - container.getBoundingClientRect().right >= PWM_BADGE_SPACE_WIDTH_PX);
|
|
32084
|
+
};
|
|
32085
|
+
checkHasSpace();
|
|
32086
|
+
const interval = setInterval(checkHasSpace, 1e3);
|
|
32087
|
+
return () => {
|
|
32088
|
+
clearInterval(interval);
|
|
32089
|
+
};
|
|
32090
|
+
}, [containerRef, pushPasswordManagerStrategy]);
|
|
32091
|
+
reactExports.useEffect(() => {
|
|
32092
|
+
const _isFocused = isFocused || document.activeElement === inputRef.current;
|
|
32093
|
+
if (pushPasswordManagerStrategy === "none" || !_isFocused) return;
|
|
32094
|
+
const t1 = setTimeout(trackPWMBadge, 0);
|
|
32095
|
+
const t2 = setTimeout(trackPWMBadge, 2e3);
|
|
32096
|
+
const t3 = setTimeout(trackPWMBadge, 5e3);
|
|
32097
|
+
const t4 = setTimeout(() => {
|
|
32098
|
+
setDone(true);
|
|
32099
|
+
}, 6e3);
|
|
32100
|
+
return () => {
|
|
32101
|
+
clearTimeout(t1);
|
|
32102
|
+
clearTimeout(t2);
|
|
32103
|
+
clearTimeout(t3);
|
|
32104
|
+
clearTimeout(t4);
|
|
32105
|
+
};
|
|
32106
|
+
}, [
|
|
32107
|
+
inputRef,
|
|
32108
|
+
isFocused,
|
|
32109
|
+
pushPasswordManagerStrategy
|
|
32110
|
+
]);
|
|
32111
|
+
return {
|
|
32112
|
+
hasPWMBadge,
|
|
32113
|
+
willPushPWMBadge,
|
|
32114
|
+
PWM_BADGE_SPACE_WIDTH
|
|
32115
|
+
};
|
|
32116
|
+
};
|
|
32117
|
+
const usePrevious$1 = (value) => {
|
|
32118
|
+
const ref = reactExports.useRef(void 0);
|
|
32119
|
+
reactExports.useEffect(() => {
|
|
32120
|
+
ref.current = value;
|
|
32121
|
+
});
|
|
32122
|
+
return ref.current;
|
|
32123
|
+
};
|
|
32124
|
+
const OTPInputContext = reactExports.createContext({});
|
|
32125
|
+
const OTPInput = ({ value: uncheckedValue, onChange: uncheckedOnChange, maxLength, pattern, placeholder, inputMode = "numeric", onComplete, onActiveSlotChange, pushPasswordManagerStrategy = "increase-width", pasteTransformer, containerClassName, noScriptCSSFallback = NOSCRIPT_CSS_FALLBACK, render, children, ...props }) => {
|
|
32126
|
+
const [internalValue, setInternalValue] = reactExports.useState(typeof props.defaultValue === "string" ? props.defaultValue : "");
|
|
32127
|
+
const value = uncheckedValue ?? internalValue;
|
|
32128
|
+
const previousValue = usePrevious$1(value);
|
|
32129
|
+
const onChange = (newValue) => {
|
|
32130
|
+
uncheckedOnChange?.(newValue);
|
|
32131
|
+
setInternalValue(newValue);
|
|
32132
|
+
};
|
|
32133
|
+
const regexp = pattern !== void 0 ? typeof pattern === "string" ? new RegExp(pattern) : pattern : null;
|
|
32134
|
+
const inputRef = reactExports.useRef(null);
|
|
32135
|
+
const containerRef = reactExports.useRef(null);
|
|
32136
|
+
const initialLoadRef = reactExports.useRef({
|
|
32137
|
+
value,
|
|
32138
|
+
onChange,
|
|
32139
|
+
isIOS: typeof window !== "undefined" && window?.CSS?.supports?.("-webkit-touch-callout", "none")
|
|
32140
|
+
});
|
|
32141
|
+
const inputMetadataRef = reactExports.useRef({ prev: [
|
|
32142
|
+
inputRef.current?.selectionStart ?? null,
|
|
32143
|
+
inputRef.current?.selectionEnd ?? null,
|
|
32144
|
+
inputRef.current?.selectionDirection ?? "none"
|
|
32145
|
+
] });
|
|
32146
|
+
reactExports.useEffect(() => {
|
|
32147
|
+
const input = inputRef.current;
|
|
32148
|
+
const container = containerRef.current;
|
|
32149
|
+
if (!input || !container) return;
|
|
32150
|
+
if (initialLoadRef.current.value !== input.value) initialLoadRef.current.onChange(input.value);
|
|
32151
|
+
inputMetadataRef.current.prev = [
|
|
32152
|
+
input.selectionStart,
|
|
32153
|
+
input.selectionEnd,
|
|
32154
|
+
input.selectionDirection ?? "none"
|
|
32155
|
+
];
|
|
32156
|
+
const onDocumentSelectionChange = () => {
|
|
32157
|
+
if (document.activeElement !== input) {
|
|
32158
|
+
setMirrorSelectionStart(null);
|
|
32159
|
+
setMirrorSelectionEnd(null);
|
|
32160
|
+
setActualCaretPosition(null);
|
|
32161
|
+
return;
|
|
32162
|
+
}
|
|
32163
|
+
const selectionStart = input.selectionStart;
|
|
32164
|
+
const selectionEnd = input.selectionEnd;
|
|
32165
|
+
const selectionDirection = input.selectionDirection;
|
|
32166
|
+
const maxLength$1 = input.maxLength;
|
|
32167
|
+
const value$1 = input.value;
|
|
32168
|
+
const previousSelection = inputMetadataRef.current.prev;
|
|
32169
|
+
let calculatedStart = -1;
|
|
32170
|
+
let calculatedEnd = -1;
|
|
32171
|
+
let calculatedDirection = selectionDirection ?? "none";
|
|
32172
|
+
if (value$1.length !== 0 && selectionStart !== null && selectionEnd !== null) {
|
|
32173
|
+
const isSingleCaret = selectionStart === selectionEnd;
|
|
32174
|
+
const isInsertMode = selectionStart === value$1.length && value$1.length < maxLength$1;
|
|
32175
|
+
if (isSingleCaret && !isInsertMode) {
|
|
32176
|
+
const caretPosition = selectionStart;
|
|
32177
|
+
if (caretPosition === 0) {
|
|
32178
|
+
calculatedStart = 0;
|
|
32179
|
+
calculatedEnd = 1;
|
|
32180
|
+
calculatedDirection = "forward";
|
|
32181
|
+
} else if (caretPosition === maxLength$1) {
|
|
32182
|
+
calculatedStart = caretPosition - 1;
|
|
32183
|
+
calculatedEnd = caretPosition;
|
|
32184
|
+
calculatedDirection = "backward";
|
|
32185
|
+
} else if (maxLength$1 > 1 && value$1.length > 1) {
|
|
32186
|
+
let offset2 = 0;
|
|
32187
|
+
if (previousSelection[0] !== null && previousSelection[1] !== null) {
|
|
32188
|
+
calculatedDirection = caretPosition < previousSelection[1] ? "backward" : "forward";
|
|
32189
|
+
const wasPreviouslyInserting = previousSelection[0] === previousSelection[1] && previousSelection[0] < maxLength$1;
|
|
32190
|
+
if (calculatedDirection === "backward" && !wasPreviouslyInserting) offset2 = -1;
|
|
32191
|
+
}
|
|
32192
|
+
calculatedStart = offset2 + caretPosition;
|
|
32193
|
+
calculatedEnd = offset2 + caretPosition + 1;
|
|
32194
|
+
}
|
|
32195
|
+
}
|
|
32196
|
+
if (calculatedStart !== -1 && calculatedEnd !== -1 && calculatedStart !== calculatedEnd) inputRef.current?.setSelectionRange(calculatedStart, calculatedEnd, calculatedDirection);
|
|
32197
|
+
}
|
|
32198
|
+
const finalSelectionStart = calculatedStart !== -1 ? calculatedStart : selectionStart;
|
|
32199
|
+
const finalSelectionEnd = calculatedEnd !== -1 ? calculatedEnd : selectionEnd;
|
|
32200
|
+
const finalDirection = calculatedDirection;
|
|
32201
|
+
if (selectionStart !== null && selectionEnd !== null) if (selectionStart === selectionEnd) setActualCaretPosition(selectionStart);
|
|
32202
|
+
else setActualCaretPosition(finalSelectionStart);
|
|
32203
|
+
else setActualCaretPosition(null);
|
|
32204
|
+
setMirrorSelectionStart(finalSelectionStart);
|
|
32205
|
+
setMirrorSelectionEnd(finalSelectionEnd);
|
|
32206
|
+
inputMetadataRef.current.prev = [
|
|
32207
|
+
finalSelectionStart,
|
|
32208
|
+
finalSelectionEnd,
|
|
32209
|
+
finalDirection
|
|
32210
|
+
];
|
|
32211
|
+
};
|
|
32212
|
+
document.addEventListener("selectionchange", onDocumentSelectionChange, { capture: true });
|
|
32213
|
+
onDocumentSelectionChange();
|
|
32214
|
+
if (document.activeElement === input) setIsFocused(true);
|
|
32215
|
+
if (!document.getElementById("input-otp-style")) {
|
|
32216
|
+
const styleEl = document.createElement("style");
|
|
32217
|
+
styleEl.id = "input-otp-style";
|
|
32218
|
+
document.head.appendChild(styleEl);
|
|
32219
|
+
if (styleEl.sheet) {
|
|
32220
|
+
const autofillStyles = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
|
|
32221
|
+
safeInsertRule(styleEl.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }");
|
|
32222
|
+
safeInsertRule(styleEl.sheet, `[data-input-otp]:autofill { ${autofillStyles} }`);
|
|
32223
|
+
safeInsertRule(styleEl.sheet, `[data-input-otp]:-webkit-autofill { ${autofillStyles} }`);
|
|
32224
|
+
safeInsertRule(styleEl.sheet, `@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`);
|
|
32225
|
+
safeInsertRule(styleEl.sheet, `[data-input-otp] + * { pointer-events: all !important; }`);
|
|
32226
|
+
}
|
|
32227
|
+
}
|
|
32228
|
+
const updateRootHeight = () => {
|
|
32229
|
+
if (container) container.style.setProperty("--root-height", `${input.clientHeight}px`);
|
|
32230
|
+
};
|
|
32231
|
+
updateRootHeight();
|
|
32232
|
+
const resizeObserver = new ResizeObserver(updateRootHeight);
|
|
32233
|
+
resizeObserver.observe(input);
|
|
32234
|
+
return () => {
|
|
32235
|
+
document.removeEventListener("selectionchange", onDocumentSelectionChange, { capture: true });
|
|
32236
|
+
resizeObserver.disconnect();
|
|
32237
|
+
};
|
|
32238
|
+
}, []);
|
|
32239
|
+
const [isHoveringInput, setIsHoveringInput] = reactExports.useState(false);
|
|
32240
|
+
const [isFocused, setIsFocused] = reactExports.useState(false);
|
|
32241
|
+
const [mirrorSelectionStart, setMirrorSelectionStart] = reactExports.useState(null);
|
|
32242
|
+
const [mirrorSelectionEnd, setMirrorSelectionEnd] = reactExports.useState(null);
|
|
32243
|
+
const [actualCaretPosition, setActualCaretPosition] = reactExports.useState(null);
|
|
32244
|
+
reactExports.useEffect(() => {
|
|
32245
|
+
syncTimeouts(() => {
|
|
32246
|
+
inputRef.current?.dispatchEvent(new Event("input"));
|
|
32247
|
+
const s2 = inputRef.current?.selectionStart ?? null;
|
|
32248
|
+
const e = inputRef.current?.selectionEnd ?? null;
|
|
32249
|
+
const dir = inputRef.current?.selectionDirection ?? "none";
|
|
32250
|
+
if (s2 !== null && e !== null) {
|
|
32251
|
+
setMirrorSelectionStart(s2);
|
|
32252
|
+
setMirrorSelectionEnd(e);
|
|
32253
|
+
setActualCaretPosition(s2);
|
|
32254
|
+
inputMetadataRef.current.prev = [
|
|
32255
|
+
s2,
|
|
32256
|
+
e,
|
|
32257
|
+
dir
|
|
32258
|
+
];
|
|
32259
|
+
}
|
|
32260
|
+
});
|
|
32261
|
+
}, [value, isFocused]);
|
|
32262
|
+
reactExports.useEffect(() => {
|
|
32263
|
+
if (previousValue === void 0) return;
|
|
32264
|
+
if (value !== previousValue && previousValue.length < maxLength && value.length === maxLength) onComplete?.(value);
|
|
32265
|
+
}, [
|
|
32266
|
+
maxLength,
|
|
32267
|
+
onComplete,
|
|
32268
|
+
previousValue,
|
|
32269
|
+
value
|
|
32270
|
+
]);
|
|
32271
|
+
const previousActiveSlot = reactExports.useRef(null);
|
|
32272
|
+
reactExports.useEffect(() => {
|
|
32273
|
+
const activeSlotIndex = isFocused && actualCaretPosition !== null ? actualCaretPosition : null;
|
|
32274
|
+
if (activeSlotIndex !== previousActiveSlot.current) {
|
|
32275
|
+
previousActiveSlot.current = activeSlotIndex;
|
|
32276
|
+
onActiveSlotChange?.(activeSlotIndex);
|
|
32277
|
+
}
|
|
32278
|
+
}, [
|
|
32279
|
+
isFocused,
|
|
32280
|
+
actualCaretPosition,
|
|
32281
|
+
onActiveSlotChange
|
|
32282
|
+
]);
|
|
32283
|
+
const pwmb = usePasswordManagerBadge({
|
|
32284
|
+
containerRef,
|
|
32285
|
+
inputRef,
|
|
32286
|
+
pushPasswordManagerStrategy,
|
|
32287
|
+
isFocused
|
|
32288
|
+
});
|
|
32289
|
+
const _changeListener = (e) => {
|
|
32290
|
+
const newValue = e.currentTarget.value.slice(0, maxLength);
|
|
32291
|
+
if (newValue.length > 0 && regexp && !regexp.test(newValue)) {
|
|
32292
|
+
e.preventDefault();
|
|
32293
|
+
return;
|
|
32294
|
+
}
|
|
32295
|
+
if (typeof previousValue === "string" && newValue.length < previousValue.length) document.dispatchEvent(new Event("selectionchange"));
|
|
32296
|
+
onChange(newValue);
|
|
32297
|
+
};
|
|
32298
|
+
const _focusListener = () => {
|
|
32299
|
+
if (inputRef.current) {
|
|
32300
|
+
const start = Math.min(inputRef.current.value.length, maxLength - 1);
|
|
32301
|
+
const end = inputRef.current.value.length;
|
|
32302
|
+
inputRef.current?.setSelectionRange(start, end);
|
|
32303
|
+
setMirrorSelectionStart(start);
|
|
32304
|
+
setMirrorSelectionEnd(end);
|
|
32305
|
+
}
|
|
32306
|
+
setIsFocused(true);
|
|
32307
|
+
};
|
|
32308
|
+
const _pasteListener = (e) => {
|
|
32309
|
+
const input = inputRef.current;
|
|
32310
|
+
if (!pasteTransformer && (!initialLoadRef.current.isIOS || !e.clipboardData || !input)) return;
|
|
32311
|
+
const _content = e.clipboardData.getData("text/plain");
|
|
32312
|
+
const content2 = pasteTransformer ? pasteTransformer(_content) : _content;
|
|
32313
|
+
e.preventDefault();
|
|
32314
|
+
const start = inputRef.current?.selectionStart;
|
|
32315
|
+
const end = inputRef.current?.selectionEnd;
|
|
32316
|
+
const newValue = (start !== end ? value.slice(0, start ?? 0) + content2 + value.slice(end ?? 0) : value.slice(0, start ?? 0) + content2 + value.slice(start ?? 0)).slice(0, maxLength);
|
|
32317
|
+
if (newValue.length > 0 && regexp && !regexp.test(newValue)) return;
|
|
32318
|
+
if (input) {
|
|
32319
|
+
input.value = newValue;
|
|
32320
|
+
onChange(newValue);
|
|
32321
|
+
const _start = Math.min(newValue.length, maxLength - 1);
|
|
32322
|
+
const _end = newValue.length;
|
|
32323
|
+
input.setSelectionRange(_start, _end);
|
|
32324
|
+
setMirrorSelectionStart(_start);
|
|
32325
|
+
setMirrorSelectionEnd(_end);
|
|
32326
|
+
}
|
|
32327
|
+
};
|
|
32328
|
+
const dynamicInputStyle = {
|
|
32329
|
+
width: pwmb.willPushPWMBadge ? `calc(100% + ${pwmb.PWM_BADGE_SPACE_WIDTH})` : "100%",
|
|
32330
|
+
clipPath: pwmb.willPushPWMBadge ? `inset(0 ${pwmb.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0,
|
|
32331
|
+
fontSize: "var(--root-height)"
|
|
32332
|
+
};
|
|
32333
|
+
const renderedInput = /* @__PURE__ */ jsxRuntimeExports.jsx("input", {
|
|
32334
|
+
autoComplete: props.autoComplete || "one-time-code",
|
|
32335
|
+
...props,
|
|
32336
|
+
"data-input-otp": true,
|
|
32337
|
+
"data-input-otp-placeholder-shown": value.length === 0 || void 0,
|
|
32338
|
+
"data-input-otp-mss": mirrorSelectionStart,
|
|
32339
|
+
"data-input-otp-mse": mirrorSelectionEnd,
|
|
32340
|
+
inputMode,
|
|
32341
|
+
pattern: regexp?.source,
|
|
32342
|
+
"aria-placeholder": placeholder,
|
|
32343
|
+
className: "-z-10 pointer-events-auto absolute inset-0 flex h-full border-0 border-transparent bg-transparent text-center font-mono text-transparent tabular-nums leading-none tracking-[-.5em] caret-transparent opacity-100 shadow-none outline-none",
|
|
32344
|
+
style: dynamicInputStyle,
|
|
32345
|
+
maxLength,
|
|
32346
|
+
value,
|
|
32347
|
+
ref: inputRef,
|
|
32348
|
+
onPaste: (e) => {
|
|
32349
|
+
_pasteListener(e);
|
|
32350
|
+
props.onPaste?.(e);
|
|
32351
|
+
},
|
|
32352
|
+
onChange: _changeListener,
|
|
32353
|
+
onMouseOver: (e) => {
|
|
32354
|
+
setIsHoveringInput(true);
|
|
32355
|
+
props.onMouseOver?.(e);
|
|
32356
|
+
},
|
|
32357
|
+
onMouseLeave: (e) => {
|
|
32358
|
+
setIsHoveringInput(false);
|
|
32359
|
+
props.onMouseLeave?.(e);
|
|
32360
|
+
},
|
|
32361
|
+
onKeyDown: (e) => {
|
|
32362
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") requestAnimationFrame(() => {
|
|
32363
|
+
const input = inputRef.current;
|
|
32364
|
+
if (input && document.activeElement === input) {
|
|
32365
|
+
const s2 = input.selectionStart;
|
|
32366
|
+
const end = input.selectionEnd;
|
|
32367
|
+
if (s2 !== null && end !== null) setActualCaretPosition(s2);
|
|
32368
|
+
}
|
|
32369
|
+
});
|
|
32370
|
+
props.onKeyDown?.(e);
|
|
32371
|
+
},
|
|
32372
|
+
onFocus: (e) => {
|
|
32373
|
+
_focusListener();
|
|
32374
|
+
props.onFocus?.(e);
|
|
32375
|
+
},
|
|
32376
|
+
onBlur: (e) => {
|
|
32377
|
+
setIsFocused(false);
|
|
32378
|
+
props.onBlur?.(e);
|
|
32379
|
+
}
|
|
32380
|
+
});
|
|
32381
|
+
const setSelection = (index2) => {
|
|
32382
|
+
const input = inputRef.current;
|
|
32383
|
+
if (!input || props.disabled) return;
|
|
32384
|
+
const clampedIndex = Math.max(0, Math.min(index2, maxLength - 1));
|
|
32385
|
+
if (document.activeElement !== input) input.focus();
|
|
32386
|
+
const hasChar = value[clampedIndex] !== void 0;
|
|
32387
|
+
const start = clampedIndex;
|
|
32388
|
+
const end = hasChar ? clampedIndex + 1 : clampedIndex;
|
|
32389
|
+
input.setSelectionRange(start, end);
|
|
32390
|
+
setMirrorSelectionStart(start);
|
|
32391
|
+
setMirrorSelectionEnd(end);
|
|
32392
|
+
setIsFocused(true);
|
|
32393
|
+
};
|
|
32394
|
+
const contextValue = {
|
|
32395
|
+
slots: Array.from({ length: maxLength }).map((_2, slotIdx) => {
|
|
32396
|
+
const isActive = isFocused && mirrorSelectionStart !== null && mirrorSelectionEnd !== null && (mirrorSelectionStart === mirrorSelectionEnd && slotIdx === mirrorSelectionStart || slotIdx >= mirrorSelectionStart && slotIdx < mirrorSelectionEnd);
|
|
32397
|
+
const char = value[slotIdx] !== void 0 ? value[slotIdx] : null;
|
|
32398
|
+
return {
|
|
32399
|
+
char,
|
|
32400
|
+
placeholderChar: value[0] !== void 0 ? null : placeholder?.[slotIdx] ?? null,
|
|
32401
|
+
isActive,
|
|
32402
|
+
hasFakeCaret: isActive && char === null
|
|
32403
|
+
};
|
|
32404
|
+
}),
|
|
32405
|
+
isFocused,
|
|
32406
|
+
isHovering: !props.disabled && isHoveringInput,
|
|
32407
|
+
setSelection
|
|
32408
|
+
};
|
|
32409
|
+
const renderedChildren = render !== void 0 ? render(contextValue) : /* @__PURE__ */ jsxRuntimeExports.jsx(OTPInputContext.Provider, {
|
|
32410
|
+
value: contextValue,
|
|
32411
|
+
children
|
|
32412
|
+
});
|
|
32413
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [noScriptCSSFallback !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("noscript", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("style", { children: noScriptCSSFallback }) }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
32414
|
+
ref: containerRef,
|
|
32415
|
+
className: cn$2("relative", props.disabled ? "cursor-default" : "cursor-text", containerClassName),
|
|
32416
|
+
children: [renderedChildren, /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32417
|
+
className: "absolute inset-0",
|
|
32418
|
+
children: renderedInput
|
|
32419
|
+
})]
|
|
32420
|
+
})] });
|
|
32421
|
+
};
|
|
32422
|
+
const InputOTP = ({ className, render, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(OTPInput, {
|
|
32423
|
+
containerClassName: "relative flex items-center gap-2 has-disabled:opacity-50",
|
|
32424
|
+
className: cn$2("disabled:cursor-not-allowed", className),
|
|
32425
|
+
render,
|
|
32426
|
+
...props
|
|
32427
|
+
});
|
|
32428
|
+
const InputOTPGroup = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32429
|
+
className: cn$2("z-10 flex items-center gap-3", className),
|
|
32430
|
+
...props
|
|
32431
|
+
});
|
|
32432
|
+
const InputOTPSlot = ({ index: index2, className, onClick, onKeyDown, ...props }) => {
|
|
32433
|
+
const inputOTPContext = reactExports.useContext(OTPInputContext);
|
|
32434
|
+
const { char, isActive } = inputOTPContext?.slots[index2] ?? {};
|
|
32435
|
+
const { setSelection } = inputOTPContext ?? {};
|
|
32436
|
+
const handleClick = (e) => {
|
|
32437
|
+
setSelection?.(index2);
|
|
32438
|
+
onClick?.(e);
|
|
32439
|
+
};
|
|
32440
|
+
const handleKeyDown = (e) => {
|
|
32441
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
32442
|
+
e.preventDefault();
|
|
32443
|
+
setSelection?.(index2);
|
|
32444
|
+
}
|
|
32445
|
+
onKeyDown?.(e);
|
|
32446
|
+
};
|
|
32447
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
32448
|
+
"aria-active": isActive,
|
|
32449
|
+
variant: "input",
|
|
32450
|
+
color: "custom",
|
|
32451
|
+
tabIndex: -1,
|
|
32452
|
+
className: cn$2("relative z-10 px-2!", isActive && "ring-4!", className),
|
|
32453
|
+
onClick: handleClick,
|
|
32454
|
+
onKeyDown: handleKeyDown,
|
|
32455
|
+
label: null,
|
|
32456
|
+
...props,
|
|
32457
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
32458
|
+
className: "relative z-10 flex h-6 w-4 items-center justify-center",
|
|
32459
|
+
children: char
|
|
32460
|
+
})
|
|
32461
|
+
});
|
|
32462
|
+
};
|
|
32463
|
+
const InputOTPSeparator = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32464
|
+
"aria-hidden": true,
|
|
32465
|
+
className: "z-0 table h-0.5 w-3 rounded-full bg-border text-neutral",
|
|
32466
|
+
...props,
|
|
32467
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Minus, {})
|
|
32468
|
+
});
|
|
32469
|
+
const InputIndicator = ({ ref, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32470
|
+
"data-indicator": true,
|
|
32471
|
+
className: "absolute top-0 z-0 h-8 h-full w-auto rounded-xl bg-neutral-100 ring-4 ring-neutral-100 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none dark:bg-neutral-700 dark:ring-neutral-700",
|
|
32472
|
+
ref,
|
|
32473
|
+
...props
|
|
32474
|
+
});
|
|
32003
32475
|
const SearchInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
32004
32476
|
className: "relative flex items-center gap-1",
|
|
32005
32477
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "absolute left-2 size-4" }), /* @__PURE__ */ jsxRuntimeExports.jsx(Input, {
|
|
32006
32478
|
...props,
|
|
32007
32479
|
type: "search",
|
|
32008
|
-
className: cn$
|
|
32480
|
+
className: cn$2("pl-8", className)
|
|
32009
32481
|
})]
|
|
32010
32482
|
});
|
|
32011
32483
|
const EditableFieldLayout = ({ value = "", onCancel, onSave, onClick, children, isDisabled, ...props }) => {
|
|
@@ -32046,7 +32518,7 @@ const EditableFieldLayout = ({ value = "", onCancel, onSave, onClick, children,
|
|
|
32046
32518
|
ref: editableFieldRef,
|
|
32047
32519
|
...props,
|
|
32048
32520
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
32049
|
-
className: cn$
|
|
32521
|
+
className: cn$2("flex flex-1 gap-2", isEditing ? "display" : "hidden"),
|
|
32050
32522
|
children: [
|
|
32051
32523
|
children,
|
|
32052
32524
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
@@ -32079,7 +32551,7 @@ const EditableFieldLayout = ({ value = "", onCancel, onSave, onClick, children,
|
|
|
32079
32551
|
})
|
|
32080
32552
|
]
|
|
32081
32553
|
}, String(isEditing)), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
32082
|
-
className: cn$
|
|
32554
|
+
className: cn$2("flex flex-1 gap-2", isEditing ? "hidden" : "display"),
|
|
32083
32555
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
32084
32556
|
className: "ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6",
|
|
32085
32557
|
children: result
|
|
@@ -33949,12 +34421,12 @@ const useFormField = () => {
|
|
|
33949
34421
|
};
|
|
33950
34422
|
};
|
|
33951
34423
|
const InformationTag = ({ className, children, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("i", {
|
|
33952
|
-
className: cn$
|
|
34424
|
+
className: cn$2("text-neutral-400 text-xs", className),
|
|
33953
34425
|
...props,
|
|
33954
34426
|
children: ["ⓘ ", children]
|
|
33955
34427
|
});
|
|
33956
34428
|
const Label$1 = ({ htmlFor, required: required2 = false, disabled = false, className, children, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("label", {
|
|
33957
|
-
className: cn$
|
|
34429
|
+
className: cn$2("select-none font-medium text-sm leading-none", "peer-disabled:cursor-not-allowed peer-disabled:opacity-70", disabled && "cursor-not-allowed text-muted-foreground opacity-70", className),
|
|
33958
34430
|
htmlFor,
|
|
33959
34431
|
...props,
|
|
33960
34432
|
children: [children, required2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
@@ -33965,7 +34437,7 @@ const Label$1 = ({ htmlFor, required: required2 = false, disabled = false, class
|
|
|
33965
34437
|
})]
|
|
33966
34438
|
});
|
|
33967
34439
|
const TextArea = ({ className, variant, validationStyleEnabled = false, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("textarea", {
|
|
33968
|
-
className: cn$
|
|
34440
|
+
className: cn$2("resize-none", inputVariants({
|
|
33969
34441
|
variant,
|
|
33970
34442
|
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled",
|
|
33971
34443
|
className
|
|
@@ -34005,7 +34477,7 @@ const AutoSizedTextArea = ({ className, autoSize = true, onChange, maxRows = 999
|
|
|
34005
34477
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TextArea, {
|
|
34006
34478
|
ref: setRef2,
|
|
34007
34479
|
onChange: handleChange,
|
|
34008
|
-
className: cn$
|
|
34480
|
+
className: cn$2("overflow-y-auto", autoSize ? "resize-none" : "", className),
|
|
34009
34481
|
...props
|
|
34010
34482
|
});
|
|
34011
34483
|
};
|
|
@@ -38551,89 +39023,743 @@ function createAuthClient(options) {
|
|
|
38551
39023
|
);
|
|
38552
39024
|
return proxy;
|
|
38553
39025
|
}
|
|
39026
|
+
function bufferToBase64URLString(buffer) {
|
|
39027
|
+
const bytes = new Uint8Array(buffer);
|
|
39028
|
+
let str = "";
|
|
39029
|
+
for (const charCode of bytes) {
|
|
39030
|
+
str += String.fromCharCode(charCode);
|
|
39031
|
+
}
|
|
39032
|
+
const base64String = btoa(str);
|
|
39033
|
+
return base64String.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
39034
|
+
}
|
|
39035
|
+
function base64URLStringToBuffer(base64URLString) {
|
|
39036
|
+
const base642 = base64URLString.replace(/-/g, "+").replace(/_/g, "/");
|
|
39037
|
+
const padLength = (4 - base642.length % 4) % 4;
|
|
39038
|
+
const padded = base642.padEnd(base642.length + padLength, "=");
|
|
39039
|
+
const binary = atob(padded);
|
|
39040
|
+
const buffer = new ArrayBuffer(binary.length);
|
|
39041
|
+
const bytes = new Uint8Array(buffer);
|
|
39042
|
+
for (let i2 = 0; i2 < binary.length; i2++) {
|
|
39043
|
+
bytes[i2] = binary.charCodeAt(i2);
|
|
39044
|
+
}
|
|
39045
|
+
return buffer;
|
|
39046
|
+
}
|
|
39047
|
+
function browserSupportsWebAuthn() {
|
|
39048
|
+
return _browserSupportsWebAuthnInternals.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential === "function");
|
|
39049
|
+
}
|
|
39050
|
+
const _browserSupportsWebAuthnInternals = {
|
|
39051
|
+
stubThis: (value) => value
|
|
39052
|
+
};
|
|
39053
|
+
function toPublicKeyCredentialDescriptor(descriptor) {
|
|
39054
|
+
const { id: id2 } = descriptor;
|
|
39055
|
+
return {
|
|
39056
|
+
...descriptor,
|
|
39057
|
+
id: base64URLStringToBuffer(id2),
|
|
39058
|
+
/**
|
|
39059
|
+
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
39060
|
+
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
39061
|
+
* are fine to pass to WebAuthn since browsers will recognize the new value.
|
|
39062
|
+
*/
|
|
39063
|
+
transports: descriptor.transports
|
|
39064
|
+
};
|
|
39065
|
+
}
|
|
39066
|
+
function isValidDomain(hostname2) {
|
|
39067
|
+
return (
|
|
39068
|
+
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
39069
|
+
hostname2 === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(hostname2)
|
|
39070
|
+
);
|
|
39071
|
+
}
|
|
39072
|
+
class WebAuthnError extends Error {
|
|
39073
|
+
constructor({ message, code, cause, name }) {
|
|
39074
|
+
super(message, { cause });
|
|
39075
|
+
Object.defineProperty(this, "code", {
|
|
39076
|
+
enumerable: true,
|
|
39077
|
+
configurable: true,
|
|
39078
|
+
writable: true,
|
|
39079
|
+
value: void 0
|
|
39080
|
+
});
|
|
39081
|
+
this.name = name ?? cause.name;
|
|
39082
|
+
this.code = code;
|
|
39083
|
+
}
|
|
39084
|
+
}
|
|
39085
|
+
function identifyRegistrationError({ error, options }) {
|
|
39086
|
+
const { publicKey } = options;
|
|
39087
|
+
if (!publicKey) {
|
|
39088
|
+
throw Error("options was missing required publicKey property");
|
|
39089
|
+
}
|
|
39090
|
+
if (error.name === "AbortError") {
|
|
39091
|
+
if (options.signal instanceof AbortSignal) {
|
|
39092
|
+
return new WebAuthnError({
|
|
39093
|
+
message: "Registration ceremony was sent an abort signal",
|
|
39094
|
+
code: "ERROR_CEREMONY_ABORTED",
|
|
39095
|
+
cause: error
|
|
39096
|
+
});
|
|
39097
|
+
}
|
|
39098
|
+
} else if (error.name === "ConstraintError") {
|
|
39099
|
+
if (publicKey.authenticatorSelection?.requireResidentKey === true) {
|
|
39100
|
+
return new WebAuthnError({
|
|
39101
|
+
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
39102
|
+
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
39103
|
+
cause: error
|
|
39104
|
+
});
|
|
39105
|
+
} else if (
|
|
39106
|
+
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
39107
|
+
options.mediation === "conditional" && publicKey.authenticatorSelection?.userVerification === "required"
|
|
39108
|
+
) {
|
|
39109
|
+
return new WebAuthnError({
|
|
39110
|
+
message: "User verification was required during automatic registration but it could not be performed",
|
|
39111
|
+
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
39112
|
+
cause: error
|
|
39113
|
+
});
|
|
39114
|
+
} else if (publicKey.authenticatorSelection?.userVerification === "required") {
|
|
39115
|
+
return new WebAuthnError({
|
|
39116
|
+
message: "User verification was required but no available authenticator supported it",
|
|
39117
|
+
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
39118
|
+
cause: error
|
|
39119
|
+
});
|
|
39120
|
+
}
|
|
39121
|
+
} else if (error.name === "InvalidStateError") {
|
|
39122
|
+
return new WebAuthnError({
|
|
39123
|
+
message: "The authenticator was previously registered",
|
|
39124
|
+
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
39125
|
+
cause: error
|
|
39126
|
+
});
|
|
39127
|
+
} else if (error.name === "NotAllowedError") {
|
|
39128
|
+
return new WebAuthnError({
|
|
39129
|
+
message: error.message,
|
|
39130
|
+
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
39131
|
+
cause: error
|
|
39132
|
+
});
|
|
39133
|
+
} else if (error.name === "NotSupportedError") {
|
|
39134
|
+
const validPubKeyCredParams = publicKey.pubKeyCredParams.filter((param) => param.type === "public-key");
|
|
39135
|
+
if (validPubKeyCredParams.length === 0) {
|
|
39136
|
+
return new WebAuthnError({
|
|
39137
|
+
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
39138
|
+
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
39139
|
+
cause: error
|
|
39140
|
+
});
|
|
39141
|
+
}
|
|
39142
|
+
return new WebAuthnError({
|
|
39143
|
+
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
39144
|
+
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
39145
|
+
cause: error
|
|
39146
|
+
});
|
|
39147
|
+
} else if (error.name === "SecurityError") {
|
|
39148
|
+
const effectiveDomain = globalThis.location.hostname;
|
|
39149
|
+
if (!isValidDomain(effectiveDomain)) {
|
|
39150
|
+
return new WebAuthnError({
|
|
39151
|
+
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
39152
|
+
code: "ERROR_INVALID_DOMAIN",
|
|
39153
|
+
cause: error
|
|
39154
|
+
});
|
|
39155
|
+
} else if (publicKey.rp.id !== effectiveDomain) {
|
|
39156
|
+
return new WebAuthnError({
|
|
39157
|
+
message: `The RP ID "${publicKey.rp.id}" is invalid for this domain`,
|
|
39158
|
+
code: "ERROR_INVALID_RP_ID",
|
|
39159
|
+
cause: error
|
|
39160
|
+
});
|
|
39161
|
+
}
|
|
39162
|
+
} else if (error.name === "TypeError") {
|
|
39163
|
+
if (publicKey.user.id.byteLength < 1 || publicKey.user.id.byteLength > 64) {
|
|
39164
|
+
return new WebAuthnError({
|
|
39165
|
+
message: "User ID was not between 1 and 64 characters",
|
|
39166
|
+
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
39167
|
+
cause: error
|
|
39168
|
+
});
|
|
39169
|
+
}
|
|
39170
|
+
} else if (error.name === "UnknownError") {
|
|
39171
|
+
return new WebAuthnError({
|
|
39172
|
+
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
39173
|
+
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
39174
|
+
cause: error
|
|
39175
|
+
});
|
|
39176
|
+
}
|
|
39177
|
+
return error;
|
|
39178
|
+
}
|
|
39179
|
+
class BaseWebAuthnAbortService {
|
|
39180
|
+
constructor() {
|
|
39181
|
+
Object.defineProperty(this, "controller", {
|
|
39182
|
+
enumerable: true,
|
|
39183
|
+
configurable: true,
|
|
39184
|
+
writable: true,
|
|
39185
|
+
value: void 0
|
|
39186
|
+
});
|
|
39187
|
+
}
|
|
39188
|
+
createNewAbortSignal() {
|
|
39189
|
+
if (this.controller) {
|
|
39190
|
+
const abortError = new Error("Cancelling existing WebAuthn API call for new one");
|
|
39191
|
+
abortError.name = "AbortError";
|
|
39192
|
+
this.controller.abort(abortError);
|
|
39193
|
+
}
|
|
39194
|
+
const newController = new AbortController();
|
|
39195
|
+
this.controller = newController;
|
|
39196
|
+
return newController.signal;
|
|
39197
|
+
}
|
|
39198
|
+
cancelCeremony() {
|
|
39199
|
+
if (this.controller) {
|
|
39200
|
+
const abortError = new Error("Manually cancelling existing WebAuthn API call");
|
|
39201
|
+
abortError.name = "AbortError";
|
|
39202
|
+
this.controller.abort(abortError);
|
|
39203
|
+
this.controller = void 0;
|
|
39204
|
+
}
|
|
39205
|
+
}
|
|
39206
|
+
}
|
|
39207
|
+
const WebAuthnAbortService = new BaseWebAuthnAbortService();
|
|
39208
|
+
const attachments = ["cross-platform", "platform"];
|
|
39209
|
+
function toAuthenticatorAttachment(attachment) {
|
|
39210
|
+
if (!attachment) {
|
|
39211
|
+
return;
|
|
39212
|
+
}
|
|
39213
|
+
if (attachments.indexOf(attachment) < 0) {
|
|
39214
|
+
return;
|
|
39215
|
+
}
|
|
39216
|
+
return attachment;
|
|
39217
|
+
}
|
|
39218
|
+
async function startRegistration(options) {
|
|
39219
|
+
if (!options.optionsJSON && options.challenge) {
|
|
39220
|
+
console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.");
|
|
39221
|
+
options = { optionsJSON: options };
|
|
39222
|
+
}
|
|
39223
|
+
const { optionsJSON, useAutoRegister = false } = options;
|
|
39224
|
+
if (!browserSupportsWebAuthn()) {
|
|
39225
|
+
throw new Error("WebAuthn is not supported in this browser");
|
|
39226
|
+
}
|
|
39227
|
+
const publicKey = {
|
|
39228
|
+
...optionsJSON,
|
|
39229
|
+
challenge: base64URLStringToBuffer(optionsJSON.challenge),
|
|
39230
|
+
user: {
|
|
39231
|
+
...optionsJSON.user,
|
|
39232
|
+
id: base64URLStringToBuffer(optionsJSON.user.id)
|
|
39233
|
+
},
|
|
39234
|
+
excludeCredentials: optionsJSON.excludeCredentials?.map(toPublicKeyCredentialDescriptor)
|
|
39235
|
+
};
|
|
39236
|
+
const createOptions = {};
|
|
39237
|
+
if (useAutoRegister) {
|
|
39238
|
+
createOptions.mediation = "conditional";
|
|
39239
|
+
}
|
|
39240
|
+
createOptions.publicKey = publicKey;
|
|
39241
|
+
createOptions.signal = WebAuthnAbortService.createNewAbortSignal();
|
|
39242
|
+
let credential;
|
|
39243
|
+
try {
|
|
39244
|
+
credential = await navigator.credentials.create(createOptions);
|
|
39245
|
+
} catch (err) {
|
|
39246
|
+
throw identifyRegistrationError({ error: err, options: createOptions });
|
|
39247
|
+
}
|
|
39248
|
+
if (!credential) {
|
|
39249
|
+
throw new Error("Registration was not completed");
|
|
39250
|
+
}
|
|
39251
|
+
const { id: id2, rawId, response, type } = credential;
|
|
39252
|
+
let transports = void 0;
|
|
39253
|
+
if (typeof response.getTransports === "function") {
|
|
39254
|
+
transports = response.getTransports();
|
|
39255
|
+
}
|
|
39256
|
+
let responsePublicKeyAlgorithm = void 0;
|
|
39257
|
+
if (typeof response.getPublicKeyAlgorithm === "function") {
|
|
39258
|
+
try {
|
|
39259
|
+
responsePublicKeyAlgorithm = response.getPublicKeyAlgorithm();
|
|
39260
|
+
} catch (error) {
|
|
39261
|
+
warnOnBrokenImplementation("getPublicKeyAlgorithm()", error);
|
|
39262
|
+
}
|
|
39263
|
+
}
|
|
39264
|
+
let responsePublicKey = void 0;
|
|
39265
|
+
if (typeof response.getPublicKey === "function") {
|
|
39266
|
+
try {
|
|
39267
|
+
const _publicKey = response.getPublicKey();
|
|
39268
|
+
if (_publicKey !== null) {
|
|
39269
|
+
responsePublicKey = bufferToBase64URLString(_publicKey);
|
|
39270
|
+
}
|
|
39271
|
+
} catch (error) {
|
|
39272
|
+
warnOnBrokenImplementation("getPublicKey()", error);
|
|
39273
|
+
}
|
|
39274
|
+
}
|
|
39275
|
+
let responseAuthenticatorData;
|
|
39276
|
+
if (typeof response.getAuthenticatorData === "function") {
|
|
39277
|
+
try {
|
|
39278
|
+
responseAuthenticatorData = bufferToBase64URLString(response.getAuthenticatorData());
|
|
39279
|
+
} catch (error) {
|
|
39280
|
+
warnOnBrokenImplementation("getAuthenticatorData()", error);
|
|
39281
|
+
}
|
|
39282
|
+
}
|
|
39283
|
+
return {
|
|
39284
|
+
id: id2,
|
|
39285
|
+
rawId: bufferToBase64URLString(rawId),
|
|
39286
|
+
response: {
|
|
39287
|
+
attestationObject: bufferToBase64URLString(response.attestationObject),
|
|
39288
|
+
clientDataJSON: bufferToBase64URLString(response.clientDataJSON),
|
|
39289
|
+
transports,
|
|
39290
|
+
publicKeyAlgorithm: responsePublicKeyAlgorithm,
|
|
39291
|
+
publicKey: responsePublicKey,
|
|
39292
|
+
authenticatorData: responseAuthenticatorData
|
|
39293
|
+
},
|
|
39294
|
+
type,
|
|
39295
|
+
clientExtensionResults: credential.getClientExtensionResults(),
|
|
39296
|
+
authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment)
|
|
39297
|
+
};
|
|
39298
|
+
}
|
|
39299
|
+
function warnOnBrokenImplementation(methodName, cause) {
|
|
39300
|
+
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${methodName}. You should report this error to them.
|
|
39301
|
+
`, cause);
|
|
39302
|
+
}
|
|
39303
|
+
function browserSupportsWebAuthnAutofill() {
|
|
39304
|
+
if (!browserSupportsWebAuthn()) {
|
|
39305
|
+
return _browserSupportsWebAuthnAutofillInternals.stubThis(new Promise((resolve) => resolve(false)));
|
|
39306
|
+
}
|
|
39307
|
+
const globalPublicKeyCredential = globalThis.PublicKeyCredential;
|
|
39308
|
+
if (globalPublicKeyCredential?.isConditionalMediationAvailable === void 0) {
|
|
39309
|
+
return _browserSupportsWebAuthnAutofillInternals.stubThis(new Promise((resolve) => resolve(false)));
|
|
39310
|
+
}
|
|
39311
|
+
return _browserSupportsWebAuthnAutofillInternals.stubThis(globalPublicKeyCredential.isConditionalMediationAvailable());
|
|
39312
|
+
}
|
|
39313
|
+
const _browserSupportsWebAuthnAutofillInternals = {
|
|
39314
|
+
stubThis: (value) => value
|
|
39315
|
+
};
|
|
39316
|
+
function identifyAuthenticationError({ error, options }) {
|
|
39317
|
+
const { publicKey } = options;
|
|
39318
|
+
if (!publicKey) {
|
|
39319
|
+
throw Error("options was missing required publicKey property");
|
|
39320
|
+
}
|
|
39321
|
+
if (error.name === "AbortError") {
|
|
39322
|
+
if (options.signal instanceof AbortSignal) {
|
|
39323
|
+
return new WebAuthnError({
|
|
39324
|
+
message: "Authentication ceremony was sent an abort signal",
|
|
39325
|
+
code: "ERROR_CEREMONY_ABORTED",
|
|
39326
|
+
cause: error
|
|
39327
|
+
});
|
|
39328
|
+
}
|
|
39329
|
+
} else if (error.name === "NotAllowedError") {
|
|
39330
|
+
return new WebAuthnError({
|
|
39331
|
+
message: error.message,
|
|
39332
|
+
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
39333
|
+
cause: error
|
|
39334
|
+
});
|
|
39335
|
+
} else if (error.name === "SecurityError") {
|
|
39336
|
+
const effectiveDomain = globalThis.location.hostname;
|
|
39337
|
+
if (!isValidDomain(effectiveDomain)) {
|
|
39338
|
+
return new WebAuthnError({
|
|
39339
|
+
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
39340
|
+
code: "ERROR_INVALID_DOMAIN",
|
|
39341
|
+
cause: error
|
|
39342
|
+
});
|
|
39343
|
+
} else if (publicKey.rpId !== effectiveDomain) {
|
|
39344
|
+
return new WebAuthnError({
|
|
39345
|
+
message: `The RP ID "${publicKey.rpId}" is invalid for this domain`,
|
|
39346
|
+
code: "ERROR_INVALID_RP_ID",
|
|
39347
|
+
cause: error
|
|
39348
|
+
});
|
|
39349
|
+
}
|
|
39350
|
+
} else if (error.name === "UnknownError") {
|
|
39351
|
+
return new WebAuthnError({
|
|
39352
|
+
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
39353
|
+
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
39354
|
+
cause: error
|
|
39355
|
+
});
|
|
39356
|
+
}
|
|
39357
|
+
return error;
|
|
39358
|
+
}
|
|
39359
|
+
async function startAuthentication(options) {
|
|
39360
|
+
if (!options.optionsJSON && options.challenge) {
|
|
39361
|
+
console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.");
|
|
39362
|
+
options = { optionsJSON: options };
|
|
39363
|
+
}
|
|
39364
|
+
const { optionsJSON, useBrowserAutofill = false, verifyBrowserAutofillInput = true } = options;
|
|
39365
|
+
if (!browserSupportsWebAuthn()) {
|
|
39366
|
+
throw new Error("WebAuthn is not supported in this browser");
|
|
39367
|
+
}
|
|
39368
|
+
let allowCredentials;
|
|
39369
|
+
if (optionsJSON.allowCredentials?.length !== 0) {
|
|
39370
|
+
allowCredentials = optionsJSON.allowCredentials?.map(toPublicKeyCredentialDescriptor);
|
|
39371
|
+
}
|
|
39372
|
+
const publicKey = {
|
|
39373
|
+
...optionsJSON,
|
|
39374
|
+
challenge: base64URLStringToBuffer(optionsJSON.challenge),
|
|
39375
|
+
allowCredentials
|
|
39376
|
+
};
|
|
39377
|
+
const getOptions = {};
|
|
39378
|
+
if (useBrowserAutofill) {
|
|
39379
|
+
if (!await browserSupportsWebAuthnAutofill()) {
|
|
39380
|
+
throw Error("Browser does not support WebAuthn autofill");
|
|
39381
|
+
}
|
|
39382
|
+
const eligibleInputs = document.querySelectorAll("input[autocomplete$='webauthn']");
|
|
39383
|
+
if (eligibleInputs.length < 1 && verifyBrowserAutofillInput) {
|
|
39384
|
+
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
39385
|
+
}
|
|
39386
|
+
getOptions.mediation = "conditional";
|
|
39387
|
+
publicKey.allowCredentials = [];
|
|
39388
|
+
}
|
|
39389
|
+
getOptions.publicKey = publicKey;
|
|
39390
|
+
getOptions.signal = WebAuthnAbortService.createNewAbortSignal();
|
|
39391
|
+
let credential;
|
|
39392
|
+
try {
|
|
39393
|
+
credential = await navigator.credentials.get(getOptions);
|
|
39394
|
+
} catch (err) {
|
|
39395
|
+
throw identifyAuthenticationError({ error: err, options: getOptions });
|
|
39396
|
+
}
|
|
39397
|
+
if (!credential) {
|
|
39398
|
+
throw new Error("Authentication was not completed");
|
|
39399
|
+
}
|
|
39400
|
+
const { id: id2, rawId, response, type } = credential;
|
|
39401
|
+
let userHandle = void 0;
|
|
39402
|
+
if (response.userHandle) {
|
|
39403
|
+
userHandle = bufferToBase64URLString(response.userHandle);
|
|
39404
|
+
}
|
|
39405
|
+
return {
|
|
39406
|
+
id: id2,
|
|
39407
|
+
rawId: bufferToBase64URLString(rawId),
|
|
39408
|
+
response: {
|
|
39409
|
+
authenticatorData: bufferToBase64URLString(response.authenticatorData),
|
|
39410
|
+
clientDataJSON: bufferToBase64URLString(response.clientDataJSON),
|
|
39411
|
+
signature: bufferToBase64URLString(response.signature),
|
|
39412
|
+
userHandle
|
|
39413
|
+
},
|
|
39414
|
+
type,
|
|
39415
|
+
clientExtensionResults: credential.getClientExtensionResults(),
|
|
39416
|
+
authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment)
|
|
39417
|
+
};
|
|
39418
|
+
}
|
|
39419
|
+
const twoFactorClient = (options) => {
|
|
39420
|
+
return {
|
|
39421
|
+
id: "two-factor",
|
|
39422
|
+
$InferServerPlugin: {},
|
|
39423
|
+
atomListeners: [
|
|
39424
|
+
{
|
|
39425
|
+
matcher: (path) => path.startsWith("/two-factor/"),
|
|
39426
|
+
signal: "$sessionSignal"
|
|
39427
|
+
}
|
|
39428
|
+
],
|
|
39429
|
+
pathMethods: {
|
|
39430
|
+
"/two-factor/disable": "POST",
|
|
39431
|
+
"/two-factor/enable": "POST",
|
|
39432
|
+
"/two-factor/send-otp": "POST",
|
|
39433
|
+
"/two-factor/generate-backup-codes": "POST"
|
|
39434
|
+
},
|
|
39435
|
+
fetchPlugins: [
|
|
39436
|
+
{
|
|
39437
|
+
id: "two-factor",
|
|
39438
|
+
name: "two-factor",
|
|
39439
|
+
hooks: {
|
|
39440
|
+
async onSuccess(context) {
|
|
39441
|
+
if (context.data?.twoFactorRedirect) {
|
|
39442
|
+
if (options?.onTwoFactorRedirect) {
|
|
39443
|
+
await options.onTwoFactorRedirect();
|
|
39444
|
+
}
|
|
39445
|
+
}
|
|
39446
|
+
}
|
|
39447
|
+
}
|
|
39448
|
+
}
|
|
39449
|
+
]
|
|
39450
|
+
};
|
|
39451
|
+
};
|
|
39452
|
+
const getPasskeyActions = ($fetch, {
|
|
39453
|
+
$listPasskeys,
|
|
39454
|
+
$store
|
|
39455
|
+
}) => {
|
|
39456
|
+
const signInPasskey = async (opts, options) => {
|
|
39457
|
+
const response = await $fetch(
|
|
39458
|
+
"/passkey/generate-authenticate-options",
|
|
39459
|
+
{
|
|
39460
|
+
method: "POST",
|
|
39461
|
+
throw: false
|
|
39462
|
+
}
|
|
39463
|
+
);
|
|
39464
|
+
if (!response.data) {
|
|
39465
|
+
return response;
|
|
39466
|
+
}
|
|
39467
|
+
try {
|
|
39468
|
+
const res = await startAuthentication({
|
|
39469
|
+
optionsJSON: response.data,
|
|
39470
|
+
useBrowserAutofill: opts?.autoFill
|
|
39471
|
+
});
|
|
39472
|
+
const verified = await $fetch("/passkey/verify-authentication", {
|
|
39473
|
+
body: {
|
|
39474
|
+
response: res
|
|
39475
|
+
},
|
|
39476
|
+
...opts?.fetchOptions,
|
|
39477
|
+
...options,
|
|
39478
|
+
method: "POST",
|
|
39479
|
+
throw: false
|
|
39480
|
+
});
|
|
39481
|
+
$listPasskeys.set(Math.random());
|
|
39482
|
+
$store.notify("$sessionSignal");
|
|
39483
|
+
return verified;
|
|
39484
|
+
} catch (e) {
|
|
39485
|
+
return {
|
|
39486
|
+
data: null,
|
|
39487
|
+
error: {
|
|
39488
|
+
code: "AUTH_CANCELLED",
|
|
39489
|
+
message: "auth cancelled",
|
|
39490
|
+
status: 400,
|
|
39491
|
+
statusText: "BAD_REQUEST"
|
|
39492
|
+
}
|
|
39493
|
+
};
|
|
39494
|
+
}
|
|
39495
|
+
};
|
|
39496
|
+
const registerPasskey = async (opts, fetchOpts) => {
|
|
39497
|
+
const options = await $fetch(
|
|
39498
|
+
"/passkey/generate-register-options",
|
|
39499
|
+
{
|
|
39500
|
+
method: "GET",
|
|
39501
|
+
query: {
|
|
39502
|
+
...opts?.authenticatorAttachment && {
|
|
39503
|
+
authenticatorAttachment: opts.authenticatorAttachment
|
|
39504
|
+
},
|
|
39505
|
+
...opts?.name && {
|
|
39506
|
+
name: opts.name
|
|
39507
|
+
}
|
|
39508
|
+
},
|
|
39509
|
+
throw: false
|
|
39510
|
+
}
|
|
39511
|
+
);
|
|
39512
|
+
if (!options.data) {
|
|
39513
|
+
return options;
|
|
39514
|
+
}
|
|
39515
|
+
try {
|
|
39516
|
+
const res = await startRegistration({
|
|
39517
|
+
optionsJSON: options.data,
|
|
39518
|
+
useAutoRegister: opts?.useAutoRegister
|
|
39519
|
+
});
|
|
39520
|
+
const verified = await $fetch("/passkey/verify-registration", {
|
|
39521
|
+
...opts?.fetchOptions,
|
|
39522
|
+
...fetchOpts,
|
|
39523
|
+
body: {
|
|
39524
|
+
response: res,
|
|
39525
|
+
name: opts?.name
|
|
39526
|
+
},
|
|
39527
|
+
method: "POST",
|
|
39528
|
+
throw: false
|
|
39529
|
+
});
|
|
39530
|
+
if (!verified.data) {
|
|
39531
|
+
return verified;
|
|
39532
|
+
}
|
|
39533
|
+
$listPasskeys.set(Math.random());
|
|
39534
|
+
} catch (e) {
|
|
39535
|
+
if (e instanceof WebAuthnError) {
|
|
39536
|
+
if (e.code === "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED") {
|
|
39537
|
+
return {
|
|
39538
|
+
data: null,
|
|
39539
|
+
error: {
|
|
39540
|
+
code: e.code,
|
|
39541
|
+
message: "previously registered",
|
|
39542
|
+
status: 400,
|
|
39543
|
+
statusText: "BAD_REQUEST"
|
|
39544
|
+
}
|
|
39545
|
+
};
|
|
39546
|
+
}
|
|
39547
|
+
if (e.code === "ERROR_CEREMONY_ABORTED") {
|
|
39548
|
+
return {
|
|
39549
|
+
data: null,
|
|
39550
|
+
error: {
|
|
39551
|
+
code: e.code,
|
|
39552
|
+
message: "registration cancelled",
|
|
39553
|
+
status: 400,
|
|
39554
|
+
statusText: "BAD_REQUEST"
|
|
39555
|
+
}
|
|
39556
|
+
};
|
|
39557
|
+
}
|
|
39558
|
+
return {
|
|
39559
|
+
data: null,
|
|
39560
|
+
error: {
|
|
39561
|
+
code: e.code,
|
|
39562
|
+
message: e.message,
|
|
39563
|
+
status: 400,
|
|
39564
|
+
statusText: "BAD_REQUEST"
|
|
39565
|
+
}
|
|
39566
|
+
};
|
|
39567
|
+
}
|
|
39568
|
+
return {
|
|
39569
|
+
data: null,
|
|
39570
|
+
error: {
|
|
39571
|
+
code: "UNKNOWN_ERROR",
|
|
39572
|
+
message: e instanceof Error ? e.message : "unknown error",
|
|
39573
|
+
status: 500,
|
|
39574
|
+
statusText: "INTERNAL_SERVER_ERROR"
|
|
39575
|
+
}
|
|
39576
|
+
};
|
|
39577
|
+
}
|
|
39578
|
+
};
|
|
39579
|
+
return {
|
|
39580
|
+
signIn: {
|
|
39581
|
+
/**
|
|
39582
|
+
* Sign in with a registered passkey
|
|
39583
|
+
*/
|
|
39584
|
+
passkey: signInPasskey
|
|
39585
|
+
},
|
|
39586
|
+
passkey: {
|
|
39587
|
+
/**
|
|
39588
|
+
* Add a passkey to the user account
|
|
39589
|
+
*/
|
|
39590
|
+
addPasskey: registerPasskey
|
|
39591
|
+
},
|
|
39592
|
+
/**
|
|
39593
|
+
* Inferred Internal Types
|
|
39594
|
+
*/
|
|
39595
|
+
$Infer: {}
|
|
39596
|
+
};
|
|
39597
|
+
};
|
|
39598
|
+
const passkeyClient = () => {
|
|
39599
|
+
const $listPasskeys = atom();
|
|
39600
|
+
return {
|
|
39601
|
+
id: "passkey",
|
|
39602
|
+
$InferServerPlugin: {},
|
|
39603
|
+
getActions: ($fetch, $store) => getPasskeyActions($fetch, {
|
|
39604
|
+
$listPasskeys,
|
|
39605
|
+
$store
|
|
39606
|
+
}),
|
|
39607
|
+
getAtoms($fetch) {
|
|
39608
|
+
const listPasskeys = useAuthQuery(
|
|
39609
|
+
$listPasskeys,
|
|
39610
|
+
"/passkey/list-user-passkeys",
|
|
39611
|
+
$fetch,
|
|
39612
|
+
{
|
|
39613
|
+
method: "GET"
|
|
39614
|
+
}
|
|
39615
|
+
);
|
|
39616
|
+
return {
|
|
39617
|
+
listPasskeys,
|
|
39618
|
+
$listPasskeys
|
|
39619
|
+
};
|
|
39620
|
+
},
|
|
39621
|
+
pathMethods: {
|
|
39622
|
+
"/passkey/register": "POST",
|
|
39623
|
+
"/passkey/authenticate": "POST"
|
|
39624
|
+
},
|
|
39625
|
+
atomListeners: [
|
|
39626
|
+
{
|
|
39627
|
+
matcher(path) {
|
|
39628
|
+
return path === "/passkey/verify-registration" || path === "/passkey/delete-passkey" || path === "/passkey/update-passkey" || path === "/sign-out";
|
|
39629
|
+
},
|
|
39630
|
+
signal: "$listPasskeys"
|
|
39631
|
+
},
|
|
39632
|
+
{
|
|
39633
|
+
matcher: (path) => path === "/passkey/verify-authentication",
|
|
39634
|
+
signal: "$sessionSignal"
|
|
39635
|
+
}
|
|
39636
|
+
]
|
|
39637
|
+
};
|
|
39638
|
+
};
|
|
39639
|
+
const magicLinkClient = () => {
|
|
39640
|
+
return {
|
|
39641
|
+
id: "magic-link",
|
|
39642
|
+
$InferServerPlugin: {}
|
|
39643
|
+
};
|
|
39644
|
+
};
|
|
39645
|
+
const getAuthClient = (backendURL) => createAuthClient({
|
|
39646
|
+
baseURL: backendURL,
|
|
39647
|
+
withCredentials: true,
|
|
39648
|
+
plugins: [
|
|
39649
|
+
twoFactorClient({ onTwoFactorRedirect: () => {
|
|
39650
|
+
const redirectUrl = new URLSearchParams(window.location.search).get("redirect_url");
|
|
39651
|
+
const twoFaUrl = redirectUrl ? `/auth/2fa?redirect_url=${encodeURIComponent(redirectUrl)}` : "/auth/2fa";
|
|
39652
|
+
window.location.href = twoFaUrl;
|
|
39653
|
+
} }),
|
|
39654
|
+
passkeyClient(),
|
|
39655
|
+
magicLinkClient()
|
|
39656
|
+
]
|
|
39657
|
+
});
|
|
38554
39658
|
const getAuthAPI = (intlayerConfig) => {
|
|
38555
39659
|
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
38556
39660
|
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
38557
|
-
const
|
|
38558
|
-
return createAuthClient({
|
|
38559
|
-
baseURL: backendURL,
|
|
38560
|
-
withCredentials: true
|
|
38561
|
-
});
|
|
38562
|
-
};
|
|
39661
|
+
const client2 = getAuthClient(backendURL);
|
|
38563
39662
|
const signInEmail = async (...args) => {
|
|
38564
|
-
return
|
|
39663
|
+
return client2.signIn.email(...args);
|
|
38565
39664
|
};
|
|
38566
39665
|
const signInSocial = async (...args) => {
|
|
38567
|
-
return
|
|
39666
|
+
return client2.signIn.social(...args);
|
|
38568
39667
|
};
|
|
38569
39668
|
const signUpEmail = async (...args) => {
|
|
38570
|
-
return
|
|
39669
|
+
return client2.signUp.email(...args);
|
|
38571
39670
|
};
|
|
38572
39671
|
const signOut = async (...args) => {
|
|
38573
|
-
return
|
|
39672
|
+
return client2.signOut(...args);
|
|
38574
39673
|
};
|
|
38575
39674
|
const changePasswordSession = async (...args) => {
|
|
38576
|
-
return
|
|
39675
|
+
return client2.changePassword(...args);
|
|
38577
39676
|
};
|
|
38578
39677
|
const requestPasswordResetSession = async (...args) => {
|
|
38579
|
-
return
|
|
39678
|
+
return client2.requestPasswordReset(...args);
|
|
38580
39679
|
};
|
|
38581
39680
|
const resetPassword = async (...args) => {
|
|
38582
|
-
return
|
|
39681
|
+
return client2.resetPassword(...args);
|
|
38583
39682
|
};
|
|
38584
39683
|
const verifyEmailSession = async (...args) => {
|
|
38585
|
-
return
|
|
39684
|
+
return client2.verifyEmail(...args);
|
|
38586
39685
|
};
|
|
38587
39686
|
const getSession = async (...args) => {
|
|
38588
|
-
return
|
|
39687
|
+
return client2.getSession(...args);
|
|
38589
39688
|
};
|
|
38590
39689
|
const forgetPassword = async (...args) => {
|
|
38591
|
-
return
|
|
39690
|
+
return client2.forgetPassword(...args);
|
|
38592
39691
|
};
|
|
38593
39692
|
const sendVerificationEmail = async (...args) => {
|
|
38594
|
-
return
|
|
39693
|
+
return client2.sendVerificationEmail(...args);
|
|
38595
39694
|
};
|
|
38596
39695
|
const changeEmail = async (...args) => {
|
|
38597
|
-
return
|
|
39696
|
+
return client2.changeEmail(...args);
|
|
38598
39697
|
};
|
|
38599
39698
|
const deleteUser = async (...args) => {
|
|
38600
|
-
return
|
|
39699
|
+
return client2.deleteUser(...args);
|
|
38601
39700
|
};
|
|
38602
39701
|
const revokeSession = async (...args) => {
|
|
38603
|
-
return
|
|
39702
|
+
return client2.revokeSession(...args);
|
|
38604
39703
|
};
|
|
38605
39704
|
const revokeSessions = async (...args) => {
|
|
38606
|
-
return
|
|
39705
|
+
return client2.revokeSessions(...args);
|
|
38607
39706
|
};
|
|
38608
39707
|
const revokeOtherSessions = async (...args) => {
|
|
38609
|
-
return
|
|
39708
|
+
return client2.revokeOtherSessions(...args);
|
|
38610
39709
|
};
|
|
38611
39710
|
const linkSocial = async (...args) => {
|
|
38612
|
-
return
|
|
39711
|
+
return client2.linkSocial(...args);
|
|
38613
39712
|
};
|
|
38614
39713
|
const listAccounts = async (...args) => {
|
|
38615
|
-
return
|
|
39714
|
+
return client2.listAccounts(...args);
|
|
38616
39715
|
};
|
|
38617
39716
|
const unlinkAccount = async (...args) => {
|
|
38618
|
-
return
|
|
39717
|
+
return client2.unlinkAccount(...args);
|
|
38619
39718
|
};
|
|
38620
39719
|
const refreshToken = async (...args) => {
|
|
38621
|
-
return
|
|
39720
|
+
return client2.refreshToken(...args);
|
|
38622
39721
|
};
|
|
38623
39722
|
const getAccessToken = async (...args) => {
|
|
38624
|
-
return
|
|
39723
|
+
return client2.getAccessToken(...args);
|
|
38625
39724
|
};
|
|
38626
39725
|
const accountInfo = async (...args) => {
|
|
38627
|
-
return
|
|
39726
|
+
return client2.accountInfo(...args);
|
|
38628
39727
|
};
|
|
38629
39728
|
const updateUser = async (...args) => {
|
|
38630
|
-
return
|
|
39729
|
+
return client2.updateUser(...args);
|
|
38631
39730
|
};
|
|
38632
39731
|
const listSessions = async (...args) => {
|
|
38633
|
-
return
|
|
39732
|
+
return client2.listSessions(...args);
|
|
39733
|
+
};
|
|
39734
|
+
const enableTwoFactor = async (...args) => {
|
|
39735
|
+
return client2.twoFactor.enable(...args);
|
|
39736
|
+
};
|
|
39737
|
+
const disableTwoFactor = async (...args) => {
|
|
39738
|
+
return client2.twoFactor.disable(...args);
|
|
39739
|
+
};
|
|
39740
|
+
const verifyTotp = async (...args) => {
|
|
39741
|
+
return client2.twoFactor.verifyTotp(...args);
|
|
39742
|
+
};
|
|
39743
|
+
const verifyBackupCode = async (...args) => {
|
|
39744
|
+
return client2.twoFactor.verifyBackupCode(...args);
|
|
39745
|
+
};
|
|
39746
|
+
const addPasskey = async (...args) => {
|
|
39747
|
+
return client2.passkey.addPasskey(...args);
|
|
39748
|
+
};
|
|
39749
|
+
const signInPasskey = async (...args) => {
|
|
39750
|
+
return client2.signIn.passkey(...args);
|
|
39751
|
+
};
|
|
39752
|
+
const deletePasskey = async (...args) => {
|
|
39753
|
+
return client2.passkey.deletePasskey(...args);
|
|
39754
|
+
};
|
|
39755
|
+
const listPasskeys = async () => {
|
|
39756
|
+
return client2.$fetch("/passkey/list-user-passkeys", { method: "GET" });
|
|
39757
|
+
};
|
|
39758
|
+
const signInMagicLink = async (...args) => {
|
|
39759
|
+
return client2.signIn.magicLink(...args);
|
|
38634
39760
|
};
|
|
38635
39761
|
return {
|
|
38636
|
-
getAuthClient,
|
|
39762
|
+
getAuthClient: () => client2,
|
|
38637
39763
|
signInEmail,
|
|
38638
39764
|
signUpEmail,
|
|
38639
39765
|
signOut,
|
|
@@ -38657,10 +39783,19 @@ const getAuthAPI = (intlayerConfig) => {
|
|
|
38657
39783
|
getAccessToken,
|
|
38658
39784
|
accountInfo,
|
|
38659
39785
|
updateUser,
|
|
38660
|
-
listSessions
|
|
38661
|
-
|
|
38662
|
-
|
|
38663
|
-
|
|
39786
|
+
listSessions,
|
|
39787
|
+
enableTwoFactor,
|
|
39788
|
+
disableTwoFactor,
|
|
39789
|
+
verifyTotp,
|
|
39790
|
+
verifyBackupCode,
|
|
39791
|
+
addPasskey,
|
|
39792
|
+
signInPasskey,
|
|
39793
|
+
deletePasskey,
|
|
39794
|
+
listPasskeys,
|
|
39795
|
+
signInMagicLink
|
|
39796
|
+
};
|
|
39797
|
+
};
|
|
39798
|
+
function useSession(sessionProp, intlayerConfiguration) {
|
|
38664
39799
|
const configuration$1 = useConfiguration();
|
|
38665
39800
|
const config2 = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
38666
39801
|
const queryClient = useQueryClient();
|
|
@@ -38677,7 +39812,9 @@ const useSession = (sessionProp, intlayerConfiguration) => {
|
|
|
38677
39812
|
enabled: !sessionProp
|
|
38678
39813
|
});
|
|
38679
39814
|
const session = data ?? (isFetched ? null : void 0);
|
|
38680
|
-
const setSession = (nextSession) =>
|
|
39815
|
+
const setSession = (nextSession) => {
|
|
39816
|
+
queryClient.setQueryData(["session"], nextSession);
|
|
39817
|
+
};
|
|
38681
39818
|
const fetchSession = async () => {
|
|
38682
39819
|
return (await refetch()).data;
|
|
38683
39820
|
};
|
|
@@ -38687,7 +39824,7 @@ const useSession = (sessionProp, intlayerConfiguration) => {
|
|
|
38687
39824
|
revalidateSession: fetchSession,
|
|
38688
39825
|
setSession
|
|
38689
39826
|
};
|
|
38690
|
-
}
|
|
39827
|
+
}
|
|
38691
39828
|
const useAuth = ({ session: sessionProp, intlayerConfiguration } = {}) => {
|
|
38692
39829
|
const { session, fetchSession, revalidateSession, setSession } = useSession(sessionProp, intlayerConfiguration);
|
|
38693
39830
|
const { oAuth2AccessToken } = useOAuth2(intlayerConfiguration);
|
|
@@ -39117,7 +40254,7 @@ const MultiSelectRoot = ({ values: valuesProp, defaultValues, onValueChange, loo
|
|
|
39117
40254
|
]),
|
|
39118
40255
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CommandRoot, {
|
|
39119
40256
|
onKeyDown: handleKeyDown,
|
|
39120
|
-
className: cn$
|
|
40257
|
+
className: cn$2("flex w-full flex-col gap-2 overflow-visible bg-transparent", className),
|
|
39121
40258
|
dir,
|
|
39122
40259
|
...props,
|
|
39123
40260
|
children
|
|
@@ -39131,12 +40268,12 @@ const MultiSelectTrigger = ({ className, getBadgeValue = (value$1) => value$1, v
|
|
|
39131
40268
|
e.stopPropagation();
|
|
39132
40269
|
}, []);
|
|
39133
40270
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
39134
|
-
className: cn$
|
|
40271
|
+
className: cn$2("flex w-full flex-col gap-3", "cursor-pointer select-text text-base shadow-none outline-none md:text-sm", "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl", "px-2 py-3 md:py-2", "bg-neutral-50 dark:bg-neutral-950", "text-text", "ring-0", "focus-within:outline-none", "focus-within:ring-3", "focus-within:ring-neutral-200", "dark:focus-within:ring-neutral-500", "focus-within:ring-offset-white", "dark:focus-within:ring-offset-neutral-500", "[box-shadow:none]", "disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-error", validationStyleEnabled && "valid:border-success invalid:border-error", className),
|
|
39135
40272
|
...props,
|
|
39136
40273
|
children: [value.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
39137
40274
|
className: "flex w-full flex-wrap gap-1",
|
|
39138
40275
|
children: value.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, {
|
|
39139
|
-
className: cn$
|
|
40276
|
+
className: cn$2("flex items-center gap-1 rounded-xl px-1", activeIndex === index2 && "ring-2 ring-muted-foreground"),
|
|
39140
40277
|
color: BadgeColor.TEXT,
|
|
39141
40278
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
39142
40279
|
className: "text-xs",
|
|
@@ -39171,7 +40308,7 @@ const MultiSelectInput = ({ className, ...props }) => {
|
|
|
39171
40308
|
onBlur: () => setOpen(false),
|
|
39172
40309
|
onFocus: () => setOpen(true),
|
|
39173
40310
|
onClick: () => setActiveIndex(-1),
|
|
39174
|
-
className: cn$
|
|
40311
|
+
className: cn$2("ml-2 flex-1 cursor-pointer outline-hidden", className, activeIndex !== -1 && "caret-transparent")
|
|
39175
40312
|
});
|
|
39176
40313
|
};
|
|
39177
40314
|
const MultiSelectContent = ({ children }) => {
|
|
@@ -39182,7 +40319,7 @@ const MultiSelectContent = ({ children }) => {
|
|
|
39182
40319
|
});
|
|
39183
40320
|
};
|
|
39184
40321
|
const MultiSelectList = ({ className, children }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Command.List, {
|
|
39185
|
-
className: cn$
|
|
40322
|
+
className: cn$2("absolute top-0 z-10 flex w-full flex-col gap-2", "rounded-xl p-2 shadow-md", "bg-white dark:bg-neutral-950", "text-text", "border border-neutral-200 dark:border-neutral-800", "transition-colors", className),
|
|
39186
40323
|
children: [children, /* @__PURE__ */ jsxRuntimeExports.jsx(Command.Empty, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
39187
40324
|
className: "text-muted-foreground",
|
|
39188
40325
|
children: "No results found"
|
|
@@ -39201,7 +40338,7 @@ const MultiSelectItem = ({ className, value, children, ...props }) => {
|
|
|
39201
40338
|
onValueChange(value);
|
|
39202
40339
|
setInputValue("");
|
|
39203
40340
|
},
|
|
39204
|
-
className: cn$
|
|
40341
|
+
className: cn$2("flex cursor-pointer justify-between", "rounded-lg px-2 py-1", "transition-colors", "hover:bg-neutral/10", isIncluded && "opacity-50", props.disabled && "cursor-not-allowed opacity-50", className),
|
|
39205
40342
|
onMouseDown: mousePreventDefault,
|
|
39206
40343
|
children: [children, isIncluded && /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "size-4" })]
|
|
39207
40344
|
});
|
|
@@ -40177,9 +41314,9 @@ function isTableElement(element) {
|
|
|
40177
41314
|
}
|
|
40178
41315
|
const topLayerSelectors = [":popover-open", ":modal"];
|
|
40179
41316
|
function isTopLayer(element) {
|
|
40180
|
-
return topLayerSelectors.some((
|
|
41317
|
+
return topLayerSelectors.some((selector2) => {
|
|
40181
41318
|
try {
|
|
40182
|
-
return element.matches(
|
|
41319
|
+
return element.matches(selector2);
|
|
40183
41320
|
} catch (_e2) {
|
|
40184
41321
|
return false;
|
|
40185
41322
|
}
|
|
@@ -42655,7 +43792,7 @@ const SelectRoot = Root2$1;
|
|
|
42655
43792
|
const SelectGroup = Group;
|
|
42656
43793
|
const SelectValue = Value;
|
|
42657
43794
|
const SelectTrigger = ({ validationStyleEnabled = false, className, children, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Trigger$1, {
|
|
42658
|
-
className: cn$
|
|
43795
|
+
className: cn$2("flex w-full cursor-pointer items-center justify-between whitespace-nowrap", "select-text text-base shadow-none outline-none md:text-sm", "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl", "px-2 py-3 md:py-2", "bg-neutral-50 dark:bg-neutral-950", "text-text", "ring-0", "focus-visible:outline-none", "focus-visible:ring-3", "focus-visible:ring-neutral-200", "dark:focus-visible:ring-neutral-500", "focus-visible:ring-offset-white", "dark:focus-visible:ring-offset-neutral-500", "[box-shadow:none] focus:[box-shadow:none]", "disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-error", "[&>span]:line-clamp-1", validationStyleEnabled && "valid:border-success invalid:border-error", className),
|
|
42659
43796
|
...props,
|
|
42660
43797
|
children: [children, /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {
|
|
42661
43798
|
asChild: true,
|
|
@@ -42663,34 +43800,34 @@ const SelectTrigger = ({ validationStyleEnabled = false, className, children, ..
|
|
|
42663
43800
|
})]
|
|
42664
43801
|
});
|
|
42665
43802
|
const SelectScrollUpButton = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollUpButton, {
|
|
42666
|
-
className: cn$
|
|
43803
|
+
className: cn$2("flex cursor-default items-center justify-center py-1", className),
|
|
42667
43804
|
...props,
|
|
42668
43805
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronUp, {})
|
|
42669
43806
|
});
|
|
42670
43807
|
const SelectScrollDownButton = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollDownButton, {
|
|
42671
|
-
className: cn$
|
|
43808
|
+
className: cn$2("flex cursor-default items-center justify-center py-1", className),
|
|
42672
43809
|
...props,
|
|
42673
43810
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, {})
|
|
42674
43811
|
});
|
|
42675
43812
|
const SelectContent = ({ className, children, position = SelectContentPosition.POPPER, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Content2, {
|
|
42676
|
-
className: cn$
|
|
43813
|
+
className: cn$2("relative z-50 max-h-96 min-w-32 overflow-hidden", "rounded-xl shadow-md", "bg-white dark:bg-neutral-950", "text-text", "border border-neutral-200 dark:border-neutral-800", "data-[state=closed]:animate-out data-[state=open]:animate-in", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2", "data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2", "data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1", className),
|
|
42677
43814
|
position,
|
|
42678
43815
|
...props,
|
|
42679
43816
|
children: [
|
|
42680
43817
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectScrollUpButton, {}),
|
|
42681
43818
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Viewport$1, {
|
|
42682
|
-
className: cn$
|
|
43819
|
+
className: cn$2("p-1", position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),
|
|
42683
43820
|
children
|
|
42684
43821
|
}),
|
|
42685
43822
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectScrollDownButton, {})
|
|
42686
43823
|
]
|
|
42687
43824
|
}) });
|
|
42688
43825
|
const SelectLabel = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Label, {
|
|
42689
|
-
className: cn$
|
|
43826
|
+
className: cn$2("px-1 py-0.5 font-semibold text-sm", className),
|
|
42690
43827
|
...props
|
|
42691
43828
|
});
|
|
42692
43829
|
const SelectItem = ({ className, children, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Item, {
|
|
42693
|
-
className: cn$
|
|
43830
|
+
className: cn$2("relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-neutral/10 data-disabled:pointer-events-none data-disabled:opacity-50", className),
|
|
42694
43831
|
...props,
|
|
42695
43832
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
42696
43833
|
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
@@ -42698,7 +43835,7 @@ const SelectItem = ({ className, children, ...props }) => /* @__PURE__ */ jsxRun
|
|
|
42698
43835
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx(ItemText, { children })]
|
|
42699
43836
|
});
|
|
42700
43837
|
const SelectSeparator = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {
|
|
42701
|
-
className: cn$
|
|
43838
|
+
className: cn$2("-mx-1 my-1 h-px", "bg-neutral-200 dark:bg-neutral-800", className),
|
|
42702
43839
|
...props
|
|
42703
43840
|
});
|
|
42704
43841
|
const Select = SelectRoot;
|
|
@@ -42712,14 +43849,17 @@ Select.Label = SelectLabel;
|
|
|
42712
43849
|
Select.Item = SelectItem;
|
|
42713
43850
|
Select.Separator = SelectSeparator;
|
|
42714
43851
|
const selectorDefault = (option) => option?.getAttribute("aria-selected") === "true";
|
|
42715
|
-
const useItemSelector = (optionsRefs, selector = selectorDefault, isHoverable = false
|
|
43852
|
+
const useItemSelector = (optionsRefs, { selector: selector2 = selectorDefault, isHoverable = false } = {
|
|
43853
|
+
selector: selectorDefault,
|
|
43854
|
+
isHoverable: false
|
|
43855
|
+
}) => {
|
|
42716
43856
|
const [choiceIndicatorPosition, setChoiceIndicatorPosition] = reactExports.useState(null);
|
|
42717
43857
|
const [hoveredItem, setHoveredItem] = reactExports.useState(null);
|
|
42718
43858
|
const itemsLength = optionsRefs.current.length;
|
|
42719
43859
|
const calculatePosition = () => {
|
|
42720
43860
|
let targetElement = null;
|
|
42721
43861
|
if (hoveredItem) targetElement = hoveredItem;
|
|
42722
|
-
else targetElement = optionsRefs.current.find(
|
|
43862
|
+
else targetElement = optionsRefs.current.find(selector2) ?? null;
|
|
42723
43863
|
if (!targetElement) {
|
|
42724
43864
|
setChoiceIndicatorPosition((prev) => ({
|
|
42725
43865
|
left: 0,
|
|
@@ -42766,7 +43906,7 @@ const useItemSelector = (optionsRefs, selector = selectorDefault, isHoverable =
|
|
|
42766
43906
|
resizeObserver.observe(element);
|
|
42767
43907
|
resizeObservers.push(resizeObserver);
|
|
42768
43908
|
};
|
|
42769
|
-
const selectedItem = optionsRefs.current.find(
|
|
43909
|
+
const selectedItem = optionsRefs.current.find(selector2) ?? null;
|
|
42770
43910
|
if (selectedItem) observeSize(selectedItem);
|
|
42771
43911
|
if (hoveredItem) observeSize(hoveredItem);
|
|
42772
43912
|
const handleMouseEnter = (event) => {
|
|
@@ -42795,7 +43935,7 @@ const useItemSelector = (optionsRefs, selector = selectorDefault, isHoverable =
|
|
|
42795
43935
|
};
|
|
42796
43936
|
}, [
|
|
42797
43937
|
optionsRefs,
|
|
42798
|
-
|
|
43938
|
+
selector2,
|
|
42799
43939
|
hoveredItem,
|
|
42800
43940
|
itemsLength
|
|
42801
43941
|
]);
|
|
@@ -42821,17 +43961,17 @@ let SwitchSelectorColor = /* @__PURE__ */ (function(SwitchSelectorColor$1) {
|
|
|
42821
43961
|
SwitchSelectorColor$1["TEXT"] = "text";
|
|
42822
43962
|
return SwitchSelectorColor$1;
|
|
42823
43963
|
})({});
|
|
42824
|
-
const switchSelectorVariant = cva("flex w-fit flex-row gap-2 rounded-full border-[1.5px] p-[1.5px]", {
|
|
43964
|
+
const switchSelectorVariant = cva("flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.5px] p-[1.5px]", {
|
|
42825
43965
|
variants: { color: {
|
|
42826
|
-
[SwitchSelectorColor.PRIMARY]: "border-primary text-primary",
|
|
42827
|
-
[SwitchSelectorColor.SECONDARY]: "border-secondary text-secondary",
|
|
42828
|
-
[SwitchSelectorColor.DESTRUCTIVE]: "border-destructive bg-destructive text-destructive",
|
|
42829
|
-
[SwitchSelectorColor.NEUTRAL]: "border-neutral text-neutral",
|
|
42830
|
-
[SwitchSelectorColor.LIGHT]: "border-white text-white",
|
|
42831
|
-
[SwitchSelectorColor.DARK]: "border-neutral-800 text-neutral-800",
|
|
42832
|
-
[SwitchSelectorColor.TEXT]: "border-text text-text"
|
|
43966
|
+
[`${SwitchSelectorColor.PRIMARY}`]: "border-primary text-primary",
|
|
43967
|
+
[`${SwitchSelectorColor.SECONDARY}`]: "border-secondary text-secondary",
|
|
43968
|
+
[`${SwitchSelectorColor.DESTRUCTIVE}`]: "border-destructive bg-destructive text-destructive",
|
|
43969
|
+
[`${SwitchSelectorColor.NEUTRAL}`]: "border-neutral text-neutral",
|
|
43970
|
+
[`${SwitchSelectorColor.LIGHT}`]: "border-white text-white",
|
|
43971
|
+
[`${SwitchSelectorColor.DARK}`]: "border-neutral-800 text-neutral-800",
|
|
43972
|
+
[`${SwitchSelectorColor.TEXT}`]: "border-text text-text"
|
|
42833
43973
|
} },
|
|
42834
|
-
defaultVariants: { color: SwitchSelectorColor.PRIMARY }
|
|
43974
|
+
defaultVariants: { color: `${SwitchSelectorColor.PRIMARY}` }
|
|
42835
43975
|
});
|
|
42836
43976
|
let SwitchSelectorSize = /* @__PURE__ */ (function(SwitchSelectorSize$1) {
|
|
42837
43977
|
SwitchSelectorSize$1["SM"] = "sm";
|
|
@@ -42839,28 +43979,31 @@ let SwitchSelectorSize = /* @__PURE__ */ (function(SwitchSelectorSize$1) {
|
|
|
42839
43979
|
SwitchSelectorSize$1["LG"] = "lg";
|
|
42840
43980
|
return SwitchSelectorSize$1;
|
|
42841
43981
|
})({});
|
|
42842
|
-
const choiceVariant = cva("z-1 w-full flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default
|
|
43982
|
+
const choiceVariant = cva("z-1 w-full flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-text-opposite motion-reduce:transition-none", {
|
|
42843
43983
|
variants: { size: {
|
|
42844
|
-
[SwitchSelectorSize.SM]: "px-2 py-1 text-xs",
|
|
42845
|
-
[SwitchSelectorSize.MD]: "p-2 text-sm",
|
|
42846
|
-
[SwitchSelectorSize.LG]: "p-4 text-base"
|
|
43984
|
+
[`${SwitchSelectorSize.SM}`]: "px-2 py-1 text-xs",
|
|
43985
|
+
[`${SwitchSelectorSize.MD}`]: "p-2 text-sm",
|
|
43986
|
+
[`${SwitchSelectorSize.LG}`]: "p-4 text-base"
|
|
42847
43987
|
} },
|
|
42848
|
-
defaultVariants: { size: SwitchSelectorSize.MD }
|
|
43988
|
+
defaultVariants: { size: `${SwitchSelectorSize.MD}` }
|
|
42849
43989
|
});
|
|
42850
43990
|
const indicatorVariant$1 = cva("absolute top-0 z-[-1] h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none", { variants: { color: {
|
|
42851
|
-
[SwitchSelectorColor.PRIMARY]: "bg-primary
|
|
42852
|
-
[SwitchSelectorColor.SECONDARY]: "bg-secondary
|
|
42853
|
-
[SwitchSelectorColor.DESTRUCTIVE]: "bg-destructive
|
|
42854
|
-
[SwitchSelectorColor.NEUTRAL]: "bg-neutral
|
|
42855
|
-
[SwitchSelectorColor.LIGHT]: "bg-white
|
|
42856
|
-
[SwitchSelectorColor.DARK]: "bg-neutral-800
|
|
42857
|
-
[SwitchSelectorColor.TEXT]: "bg-text
|
|
43991
|
+
[`${SwitchSelectorColor.PRIMARY}`]: "bg-primary data-[indicator=true]:text-text",
|
|
43992
|
+
[`${SwitchSelectorColor.SECONDARY}`]: "bg-secondary data-[indicator=true]:text-text",
|
|
43993
|
+
[`${SwitchSelectorColor.DESTRUCTIVE}`]: "bg-destructive data-[indicator=true]:text-text",
|
|
43994
|
+
[`${SwitchSelectorColor.NEUTRAL}`]: "bg-neutral data-[indicator=true]:text-white",
|
|
43995
|
+
[`${SwitchSelectorColor.LIGHT}`]: "bg-white data-[indicator=true]:text-black",
|
|
43996
|
+
[`${SwitchSelectorColor.DARK}`]: "bg-neutral-800 data-[indicator=true]:text-white",
|
|
43997
|
+
[`${SwitchSelectorColor.TEXT}`]: "bg-text data-[indicator=true]:text-text-opposite"
|
|
42858
43998
|
} } });
|
|
42859
|
-
const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChange, color: color2 = SwitchSelectorColor.PRIMARY, size: size2 = SwitchSelectorSize.MD, className }) => {
|
|
43999
|
+
const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChange, color: color2 = SwitchSelectorColor.PRIMARY, size: size2 = SwitchSelectorSize.MD, className, hoverable = true }) => {
|
|
42860
44000
|
const [valueState, setValue] = reactExports.useState(value ?? defaultValue ?? choices[0].value);
|
|
44001
|
+
const [hoveredIndex, setHoveredIndex] = reactExports.useState(null);
|
|
42861
44002
|
const optionsRefs = reactExports.useRef([]);
|
|
42862
44003
|
const indicatorRef = reactExports.useRef(null);
|
|
42863
|
-
const { choiceIndicatorPosition } = useItemSelector(optionsRefs);
|
|
44004
|
+
const { choiceIndicatorPosition } = useItemSelector(optionsRefs, { isHoverable: hoverable });
|
|
44005
|
+
const selectedIndex = choices.findIndex((choice) => choice.value === valueState);
|
|
44006
|
+
const indicatorIndex = hoverable && hoveredIndex !== null ? hoveredIndex : selectedIndex;
|
|
42864
44007
|
const handleChange = (newValue) => {
|
|
42865
44008
|
setValue(newValue);
|
|
42866
44009
|
onChange?.(newValue);
|
|
@@ -42880,21 +44023,26 @@ const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChang
|
|
|
42880
44023
|
children: [choices.map((choice, index2) => {
|
|
42881
44024
|
const { content: content2, value: value$1, ...buttonProps } = choice;
|
|
42882
44025
|
const isKeyOfKey = typeof value$1 === "string" || typeof value$1 === "number";
|
|
42883
|
-
const isSelected =
|
|
44026
|
+
const isSelected = index2 === selectedIndex;
|
|
44027
|
+
const isIndicatorOwner = index2 === indicatorIndex;
|
|
42884
44028
|
return /* @__PURE__ */ reactExports.createElement("button", {
|
|
42885
44029
|
...buttonProps,
|
|
42886
|
-
className: cn$
|
|
44030
|
+
className: cn$2(choiceVariant({ size: size2 })),
|
|
42887
44031
|
key: isKeyOfKey ? value$1 : index2,
|
|
42888
44032
|
role: "tab",
|
|
42889
44033
|
onClick: () => handleChange(value$1),
|
|
42890
|
-
"aria-selected": isSelected,
|
|
44034
|
+
"aria-selected": isSelected ? "true" : void 0,
|
|
44035
|
+
"data-indicator": isIndicatorOwner ? "true" : void 0,
|
|
42891
44036
|
disabled: isSelected,
|
|
44037
|
+
tabIndex: isSelected ? 0 : -1,
|
|
42892
44038
|
ref: (el) => {
|
|
42893
44039
|
optionsRefs.current[index2] = el;
|
|
42894
|
-
}
|
|
44040
|
+
},
|
|
44041
|
+
onMouseEnter: () => setHoveredIndex(index2),
|
|
44042
|
+
onMouseLeave: () => setHoveredIndex(null)
|
|
42895
44043
|
}, content2);
|
|
42896
44044
|
}), choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
42897
|
-
className: cn$
|
|
44045
|
+
className: cn$2(indicatorVariant$1({ color: color2 })),
|
|
42898
44046
|
style: choiceIndicatorPosition,
|
|
42899
44047
|
ref: indicatorRef
|
|
42900
44048
|
})]
|
|
@@ -45406,7 +46554,7 @@ const Form$1 = ({ schema, onSubmit: onSubmitProp, onSubmitSuccess: onSubmitSucce
|
|
|
45406
46554
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormProvider, {
|
|
45407
46555
|
...props,
|
|
45408
46556
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("form", {
|
|
45409
|
-
className: cn$
|
|
46557
|
+
className: cn$2("flex size-full flex-col gap-y-6", className),
|
|
45410
46558
|
onSubmit: props.handleSubmit(onSubmit),
|
|
45411
46559
|
autoComplete: autoComplete ? "on" : "off",
|
|
45412
46560
|
noValidate: true,
|
|
@@ -45431,7 +46579,7 @@ const useForm = (schema, props) => {
|
|
|
45431
46579
|
const FormLabel = ({ className, ...props }) => {
|
|
45432
46580
|
const { error, formItemId } = useFormField();
|
|
45433
46581
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, {
|
|
45434
|
-
className: cn$
|
|
46582
|
+
className: cn$2("mb-2", error && "text-error", className),
|
|
45435
46583
|
htmlFor: formItemId,
|
|
45436
46584
|
...props
|
|
45437
46585
|
});
|
|
@@ -45450,8 +46598,7 @@ const FormLabelLayout = ({ children, isRequired, info, htmlFor, className }) =>
|
|
|
45450
46598
|
}), info && /* @__PURE__ */ jsxRuntimeExports.jsx(InformationTag, { content: info })]
|
|
45451
46599
|
});
|
|
45452
46600
|
const FormItemLayout = ({ label, description, isRequired, info, children, showErrorMessage = true, htmlFor }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, {
|
|
45453
|
-
|
|
45454
|
-
className: "flex w-full flex-col gap-2 p-2",
|
|
46601
|
+
className: "flex w-full flex-col gap-2 px-1 py-2",
|
|
45455
46602
|
children: [
|
|
45456
46603
|
(description || label) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
45457
46604
|
className: "flex flex-col gap-1 p-1 leading-none",
|
|
@@ -45540,6 +46687,111 @@ const InputPasswordElement = ({ autoComplete, ...props }) => /* @__PURE__ */ jsx
|
|
|
45540
46687
|
maxLength: 255,
|
|
45541
46688
|
...props
|
|
45542
46689
|
});
|
|
46690
|
+
const selector = (option) => option?.getAttribute("aria-active") === "true";
|
|
46691
|
+
const OTPFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, slots = 6, maxLength = 6, ...props }) => {
|
|
46692
|
+
const { error } = useFormField();
|
|
46693
|
+
const optionsRefs = reactExports.useRef([]);
|
|
46694
|
+
const indicatorRef = reactExports.useRef(null);
|
|
46695
|
+
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs, {
|
|
46696
|
+
selector,
|
|
46697
|
+
isHoverable: true
|
|
46698
|
+
});
|
|
46699
|
+
reactExports.useEffect(() => {
|
|
46700
|
+
calculatePosition();
|
|
46701
|
+
}, []);
|
|
46702
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemLayout, {
|
|
46703
|
+
htmlFor: name,
|
|
46704
|
+
label,
|
|
46705
|
+
description,
|
|
46706
|
+
isRequired,
|
|
46707
|
+
info,
|
|
46708
|
+
showErrorMessage,
|
|
46709
|
+
"aria-invalid": !!error,
|
|
46710
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(InputOTP, {
|
|
46711
|
+
onChange: field.onChange,
|
|
46712
|
+
defaultValue: field.value,
|
|
46713
|
+
maxLength,
|
|
46714
|
+
pattern: "^[0-9]+$",
|
|
46715
|
+
onActiveSlotChange: calculatePosition,
|
|
46716
|
+
...props,
|
|
46717
|
+
children: children ?? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
46718
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(InputOTPGroup, { children: [
|
|
46719
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46720
|
+
index: 0,
|
|
46721
|
+
ref: (el) => {
|
|
46722
|
+
optionsRefs.current[0] = el;
|
|
46723
|
+
}
|
|
46724
|
+
}),
|
|
46725
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46726
|
+
index: 1,
|
|
46727
|
+
ref: (el) => {
|
|
46728
|
+
optionsRefs.current[1] = el;
|
|
46729
|
+
}
|
|
46730
|
+
}),
|
|
46731
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46732
|
+
index: 2,
|
|
46733
|
+
ref: (el) => {
|
|
46734
|
+
optionsRefs.current[2] = el;
|
|
46735
|
+
}
|
|
46736
|
+
})
|
|
46737
|
+
] }),
|
|
46738
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSeparator, {}),
|
|
46739
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(InputOTPGroup, { children: [
|
|
46740
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46741
|
+
index: 3,
|
|
46742
|
+
ref: (el) => {
|
|
46743
|
+
optionsRefs.current[3] = el;
|
|
46744
|
+
}
|
|
46745
|
+
}),
|
|
46746
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46747
|
+
index: 4,
|
|
46748
|
+
ref: (el) => {
|
|
46749
|
+
optionsRefs.current[4] = el;
|
|
46750
|
+
}
|
|
46751
|
+
}),
|
|
46752
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46753
|
+
index: 5,
|
|
46754
|
+
ref: (el) => {
|
|
46755
|
+
optionsRefs.current[5] = el;
|
|
46756
|
+
}
|
|
46757
|
+
})
|
|
46758
|
+
] }),
|
|
46759
|
+
choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx(InputIndicator, {
|
|
46760
|
+
style: choiceIndicatorPosition,
|
|
46761
|
+
ref: indicatorRef
|
|
46762
|
+
})
|
|
46763
|
+
] })
|
|
46764
|
+
})
|
|
46765
|
+
});
|
|
46766
|
+
};
|
|
46767
|
+
const OTPElement = ({ name, description, label, isRequired, info, showErrorMessage, children, slots = 6, maxLength = 6, ...props }) => {
|
|
46768
|
+
const { control } = useFormContext();
|
|
46769
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Field, {
|
|
46770
|
+
control,
|
|
46771
|
+
name,
|
|
46772
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(OTPFieldContent, {
|
|
46773
|
+
field,
|
|
46774
|
+
name,
|
|
46775
|
+
label,
|
|
46776
|
+
description,
|
|
46777
|
+
isRequired,
|
|
46778
|
+
info,
|
|
46779
|
+
showErrorMessage,
|
|
46780
|
+
slots,
|
|
46781
|
+
maxLength,
|
|
46782
|
+
...props,
|
|
46783
|
+
children
|
|
46784
|
+
})
|
|
46785
|
+
});
|
|
46786
|
+
};
|
|
46787
|
+
const SearchInputElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormElement, {
|
|
46788
|
+
id: props.name,
|
|
46789
|
+
"data-testid": props.name,
|
|
46790
|
+
Element: SearchInput,
|
|
46791
|
+
"aria-labelledby": props.label ? `${props.name}-label` : void 0,
|
|
46792
|
+
"aria-label": props.label ? void 0 : props.name,
|
|
46793
|
+
...props
|
|
46794
|
+
});
|
|
45543
46795
|
const TextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormElement, {
|
|
45544
46796
|
Element: TextArea,
|
|
45545
46797
|
id: props.name,
|
|
@@ -45567,29 +46819,58 @@ const CheckboxElement = ({ autoComplete, ...props }) => /* @__PURE__ */ jsxRunti
|
|
|
45567
46819
|
maxLength: 255,
|
|
45568
46820
|
...props
|
|
45569
46821
|
});
|
|
46822
|
+
const MultiSelectFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
46823
|
+
const { error } = useFormField();
|
|
46824
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemLayout, {
|
|
46825
|
+
htmlFor: name,
|
|
46826
|
+
label,
|
|
46827
|
+
description,
|
|
46828
|
+
isRequired,
|
|
46829
|
+
info,
|
|
46830
|
+
showErrorMessage,
|
|
46831
|
+
"aria-invalid": !!error,
|
|
46832
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiSelect, {
|
|
46833
|
+
onValueChange: field.onChange,
|
|
46834
|
+
values: field.value,
|
|
46835
|
+
...props,
|
|
46836
|
+
children
|
|
46837
|
+
})
|
|
46838
|
+
});
|
|
46839
|
+
};
|
|
45570
46840
|
const MultiSelectElement = ({ name, description, label, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
45571
46841
|
const { control } = useFormContext();
|
|
45572
46842
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Field, {
|
|
45573
46843
|
control,
|
|
45574
46844
|
name,
|
|
45575
|
-
render: ({ field }) => {
|
|
45576
|
-
|
|
45577
|
-
|
|
45578
|
-
|
|
45579
|
-
|
|
45580
|
-
|
|
45581
|
-
|
|
45582
|
-
|
|
45583
|
-
|
|
45584
|
-
|
|
45585
|
-
|
|
45586
|
-
|
|
45587
|
-
|
|
45588
|
-
|
|
45589
|
-
|
|
45590
|
-
|
|
45591
|
-
|
|
45592
|
-
|
|
46845
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(MultiSelectFieldContent, {
|
|
46846
|
+
field,
|
|
46847
|
+
name,
|
|
46848
|
+
label,
|
|
46849
|
+
description,
|
|
46850
|
+
isRequired,
|
|
46851
|
+
info,
|
|
46852
|
+
showErrorMessage,
|
|
46853
|
+
...props,
|
|
46854
|
+
children
|
|
46855
|
+
})
|
|
46856
|
+
});
|
|
46857
|
+
};
|
|
46858
|
+
const SelectFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
46859
|
+
const { error } = useFormField();
|
|
46860
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemLayout, {
|
|
46861
|
+
htmlFor: name,
|
|
46862
|
+
label,
|
|
46863
|
+
description,
|
|
46864
|
+
isRequired,
|
|
46865
|
+
info,
|
|
46866
|
+
showErrorMessage,
|
|
46867
|
+
"aria-invalid": !!error,
|
|
46868
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select, {
|
|
46869
|
+
onValueChange: field.onChange,
|
|
46870
|
+
defaultValue: field.value,
|
|
46871
|
+
...props,
|
|
46872
|
+
children
|
|
46873
|
+
})
|
|
45593
46874
|
});
|
|
45594
46875
|
};
|
|
45595
46876
|
const SelectElement = ({ name, description, label, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
@@ -45597,24 +46878,34 @@ const SelectElement = ({ name, description, label, isRequired, info, showErrorMe
|
|
|
45597
46878
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Field, {
|
|
45598
46879
|
control,
|
|
45599
46880
|
name,
|
|
45600
|
-
render: ({ field }) => {
|
|
45601
|
-
|
|
45602
|
-
|
|
45603
|
-
|
|
45604
|
-
|
|
45605
|
-
|
|
45606
|
-
|
|
45607
|
-
|
|
45608
|
-
|
|
45609
|
-
|
|
45610
|
-
|
|
45611
|
-
|
|
45612
|
-
|
|
45613
|
-
|
|
45614
|
-
|
|
45615
|
-
|
|
45616
|
-
|
|
45617
|
-
|
|
46881
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldContent, {
|
|
46882
|
+
field,
|
|
46883
|
+
name,
|
|
46884
|
+
label,
|
|
46885
|
+
description,
|
|
46886
|
+
isRequired,
|
|
46887
|
+
info,
|
|
46888
|
+
showErrorMessage,
|
|
46889
|
+
...props,
|
|
46890
|
+
children
|
|
46891
|
+
})
|
|
46892
|
+
});
|
|
46893
|
+
};
|
|
46894
|
+
const SwitchSelectorFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
46895
|
+
const { error } = useFormField();
|
|
46896
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemLayout, {
|
|
46897
|
+
htmlFor: name,
|
|
46898
|
+
label,
|
|
46899
|
+
description,
|
|
46900
|
+
isRequired,
|
|
46901
|
+
info,
|
|
46902
|
+
showErrorMessage,
|
|
46903
|
+
"aria-invalid": !!error,
|
|
46904
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(SwitchSelector, {
|
|
46905
|
+
...field,
|
|
46906
|
+
...props,
|
|
46907
|
+
children
|
|
46908
|
+
})
|
|
45618
46909
|
});
|
|
45619
46910
|
};
|
|
45620
46911
|
const SwitchSelectorElement = ({ name, description, label, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
@@ -45622,23 +46913,17 @@ const SwitchSelectorElement = ({ name, description, label, isRequired, info, sho
|
|
|
45622
46913
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Field, {
|
|
45623
46914
|
control,
|
|
45624
46915
|
name,
|
|
45625
|
-
render: ({ field }) => {
|
|
45626
|
-
|
|
45627
|
-
|
|
45628
|
-
|
|
45629
|
-
|
|
45630
|
-
|
|
45631
|
-
|
|
45632
|
-
|
|
45633
|
-
|
|
45634
|
-
|
|
45635
|
-
|
|
45636
|
-
...field,
|
|
45637
|
-
...props,
|
|
45638
|
-
children
|
|
45639
|
-
})
|
|
45640
|
-
});
|
|
45641
|
-
}
|
|
46916
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(SwitchSelectorFieldContent, {
|
|
46917
|
+
field,
|
|
46918
|
+
name,
|
|
46919
|
+
label,
|
|
46920
|
+
description,
|
|
46921
|
+
isRequired,
|
|
46922
|
+
info,
|
|
46923
|
+
showErrorMessage,
|
|
46924
|
+
...props,
|
|
46925
|
+
children
|
|
46926
|
+
})
|
|
45642
46927
|
});
|
|
45643
46928
|
};
|
|
45644
46929
|
const FormControl = (props) => {
|
|
@@ -45689,6 +46974,8 @@ Form.MultiSelect = MultiSelectElement;
|
|
|
45689
46974
|
Form.EditableFieldInput = EditableFieldInputElement;
|
|
45690
46975
|
Form.EditableFieldTextArea = EditableFieldTextAreaElement;
|
|
45691
46976
|
Form.SwitchSelector = SwitchSelectorElement;
|
|
46977
|
+
Form.OTP = OTPElement;
|
|
46978
|
+
Form.SearchInput = SearchInputElement;
|
|
45692
46979
|
const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) => {
|
|
45693
46980
|
const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = reactExports.useState(false);
|
|
45694
46981
|
const { setLocaleDictionary } = useDictionariesRecordActions();
|
|
@@ -45764,7 +47051,7 @@ const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) =
|
|
|
45764
47051
|
})]
|
|
45765
47052
|
})
|
|
45766
47053
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("form", {
|
|
45767
|
-
className: cn$
|
|
47054
|
+
className: cn$2("flex justify-end gap-2 max-md:flex-col", className),
|
|
45768
47055
|
...props,
|
|
45769
47056
|
children: [
|
|
45770
47057
|
mode.includes("remote") && isDistantDictionary && onDelete && isAuthenticated && /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Button, {
|
|
@@ -45822,7 +47109,7 @@ const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) =
|
|
|
45822
47109
|
})] });
|
|
45823
47110
|
};
|
|
45824
47111
|
const ItemLayout = ({ level, title, description, children, rightParam, isSelected, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
45825
|
-
className: cn$
|
|
47112
|
+
className: cn$2("rounded-md p-2 transition", "hover:bg-card/30 [&:has(.section:hover)]:bg-transparent", level === 2 && "hover:bg-card/30", level >= 3 && "", isSelected === true && "bg-card/40"),
|
|
45826
47113
|
...props,
|
|
45827
47114
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, {
|
|
45828
47115
|
isOpen: isSelected,
|
|
@@ -45832,7 +47119,7 @@ const ItemLayout = ({ level, title, description, children, rightParam, isSelecte
|
|
|
45832
47119
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
45833
47120
|
className: "flex w-full items-center justify-between",
|
|
45834
47121
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
45835
|
-
className: cn$
|
|
47122
|
+
className: cn$2(level === 0 && "text-lg", level === 1 && "text-md", level === 2 && "text-md", level >= 3 && "text-base"),
|
|
45836
47123
|
children: title
|
|
45837
47124
|
}), rightParam && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
45838
47125
|
className: "flex w-auto items-center justify-between p-3",
|
|
@@ -45843,7 +47130,10 @@ const ItemLayout = ({ level, title, description, children, rightParam, isSelecte
|
|
|
45843
47130
|
children: description
|
|
45844
47131
|
})]
|
|
45845
47132
|
}),
|
|
45846
|
-
children
|
|
47133
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
47134
|
+
className: "size-full px-2",
|
|
47135
|
+
children
|
|
47136
|
+
})
|
|
45847
47137
|
})
|
|
45848
47138
|
});
|
|
45849
47139
|
const ArrayWrapper = (props) => {
|
|
@@ -45926,7 +47216,7 @@ const StringWrapper = ({ keyPath, section, editedContent, editedContentValue: ed
|
|
|
45926
47216
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
45927
47217
|
role: "button",
|
|
45928
47218
|
tabIndex: 0,
|
|
45929
|
-
className: cn$
|
|
47219
|
+
className: cn$2("w-full rounded-md p-2 text-left transition", "hover:bg-card/30 [&:has(.section:hover)]:bg-transparent", level === 2 && "hover:bg-card/30", level >= 3 && ""),
|
|
45930
47220
|
onClick: (e) => {
|
|
45931
47221
|
e.stopPropagation();
|
|
45932
47222
|
onFocusKeyPath(keyPath);
|
|
@@ -46005,7 +47295,7 @@ const NestedObjectWrapper = reactExports.memo((props) => {
|
|
|
46005
47295
|
const isSelected = isSameKeyPath(newKeyPath, focusedKeyPath);
|
|
46006
47296
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ItemLayout, {
|
|
46007
47297
|
level: keyPath.length,
|
|
46008
|
-
title: key2,
|
|
47298
|
+
title: camelCaseToSentence(key2),
|
|
46009
47299
|
description: "",
|
|
46010
47300
|
isSelected,
|
|
46011
47301
|
onClick: (e) => {
|
|
@@ -46686,14 +47976,14 @@ function superRefine(fn) {
|
|
|
46686
47976
|
return _superRefine(fn);
|
|
46687
47977
|
}
|
|
46688
47978
|
const DropDown = ({ children, className, identifier, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
46689
|
-
className: cn$
|
|
47979
|
+
className: cn$2(`group/dropdown relative flex`, className),
|
|
46690
47980
|
"aria-label": `DropDown ${identifier}`,
|
|
46691
47981
|
id: `dropdown-container-${identifier}`,
|
|
46692
47982
|
...props,
|
|
46693
47983
|
children
|
|
46694
47984
|
});
|
|
46695
47985
|
const Trigger = ({ children, identifier, className, label, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
46696
|
-
className: cn$
|
|
47986
|
+
className: cn$2("w-full cursor-pointer", className),
|
|
46697
47987
|
label: label ?? `Open panel ${identifier}`,
|
|
46698
47988
|
"aria-haspopup": "true",
|
|
46699
47989
|
"aria-controls": `dropdown-panel-${identifier}`,
|
|
@@ -46711,14 +48001,14 @@ let DropDownAlign = /* @__PURE__ */ (function(DropDownAlign$1) {
|
|
|
46711
48001
|
return DropDownAlign$1;
|
|
46712
48002
|
})({});
|
|
46713
48003
|
const Panel = ({ children, isHidden: isHidden2 = void 0, isOverable = false, isFocusable = false, align = DropDownAlign.START, identifier, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
46714
|
-
className: cn$
|
|
48004
|
+
className: cn$2("absolute top-[calc(100%+0.5rem)] z-[1000] min-w-full", align === DropDownAlign.START && "left-0", align === DropDownAlign.END && "right-0", className),
|
|
46715
48005
|
"aria-hidden": isHidden2,
|
|
46716
48006
|
role: "region",
|
|
46717
48007
|
"aria-labelledby": `dropdown-trigger-${identifier}`,
|
|
46718
48008
|
id: `dropdown-panel-${identifier}`,
|
|
46719
48009
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MaxHeightSmoother, {
|
|
46720
48010
|
isHidden: isHidden2,
|
|
46721
|
-
className: cn$
|
|
48011
|
+
className: cn$2("overflow-x-visible", isHidden2 === false && "invisible", isHidden2 === true && "visible", isOverable && "group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]", isFocusable && "group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]"),
|
|
46722
48012
|
...props,
|
|
46723
48013
|
children
|
|
46724
48014
|
})
|
|
@@ -48270,7 +49560,7 @@ const ExpandCollapse = ({ isRollable = true, minHeight = DEFAULT_MIN_HEIGHT, chi
|
|
|
48270
49560
|
}, []);
|
|
48271
49561
|
if (!isRollable) return children;
|
|
48272
49562
|
if (!isTooBig) return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48273
|
-
className: cn$
|
|
49563
|
+
className: cn$2("grid w-full", className),
|
|
48274
49564
|
ref: codeContainerRef,
|
|
48275
49565
|
children
|
|
48276
49566
|
});
|
|
@@ -48279,11 +49569,11 @@ const ExpandCollapse = ({ isRollable = true, minHeight = DEFAULT_MIN_HEIGHT, chi
|
|
|
48279
49569
|
minHeight,
|
|
48280
49570
|
className: "w-full overflow-x-auto overflow-y-hidden",
|
|
48281
49571
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48282
|
-
className: cn$
|
|
49572
|
+
className: cn$2("grid w-full", className),
|
|
48283
49573
|
ref: codeContainerRef,
|
|
48284
49574
|
children
|
|
48285
49575
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("button", {
|
|
48286
|
-
className: cn$
|
|
49576
|
+
className: cn$2("absolute right-0 bottom-0 flex w-full cursor-pointer items-center justify-center rounded-t-2xl bg-gradient-to-t from-card/80 to-transparent px-3 py-0.5 text-md text-neutral-700 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all duration-300 hover:py-1 dark:text-neutral-400", isCollapsed ? "w-full" : "w-32"),
|
|
48287
49577
|
type: "button",
|
|
48288
49578
|
onClick: () => setIsCollapsed((prev) => !prev),
|
|
48289
49579
|
children: expandCollapseContent(isCollapsed)
|
|
@@ -48354,9 +49644,9 @@ const CodeDefault = ({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div
|
|
|
48354
49644
|
}, `line-${index2}-${line.slice(0, 10)}`)) })
|
|
48355
49645
|
})
|
|
48356
49646
|
});
|
|
48357
|
-
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-
|
|
49647
|
+
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-DnZQYzr7.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
|
|
48358
49648
|
const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48359
|
-
className: cn$
|
|
49649
|
+
className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
|
|
48360
49650
|
...props,
|
|
48361
49651
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, {
|
|
48362
49652
|
fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeDefault, { children }),
|
|
@@ -48378,7 +49668,7 @@ let PopoverYAlign = /* @__PURE__ */ (function(PopoverYAlign$1) {
|
|
|
48378
49668
|
return PopoverYAlign$1;
|
|
48379
49669
|
})({});
|
|
48380
49670
|
const PopoverStatic = ({ children, className, identifier, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48381
|
-
className: cn$
|
|
49671
|
+
className: cn$2("group/popover relative flex cursor-pointer", className),
|
|
48382
49672
|
id: `unrollable-panel-button-${identifier}`,
|
|
48383
49673
|
"aria-haspopup": true,
|
|
48384
49674
|
...props,
|
|
@@ -48391,7 +49681,7 @@ const Detail = reactExports.forwardRef(({ children, isHidden: isHidden2 = void 0
|
|
|
48391
49681
|
"aria-hidden": isHidden2,
|
|
48392
49682
|
"aria-labelledby": `unrollable-panel-button-${identifier}`,
|
|
48393
49683
|
id: `unrollable-panel-${identifier}`,
|
|
48394
|
-
className: cn$
|
|
49684
|
+
className: cn$2("absolute z-[1000] min-w-full rounded-md ring-1 ring-neutral", xAlign === "start" && "left-0", xAlign === "end" && "right-0", yAlign === "bellow" && "top-[calc(100%+1rem)]", yAlign === "above" && "bottom-[calc(100%+1rem)]", displayArrow && 'before:absolute before:z-[999] before:h-0 before:w-0 before:content-[""]', displayArrow && xAlign === "start" && "before:left-2", displayArrow && xAlign === "end" && "before:right-2", displayArrow && yAlign === "bellow" && "before:-top-[10px] before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral before:border-l-[10px] before:border-l-transparent", displayArrow && yAlign === "above" && "before:-bottom-[10px] before:border-t-[10px] before:border-t-neutral before:border-r-[10px] before:border-r-transparent before:border-l-[10px] before:border-l-transparent", "overflow-x-visible opacity-0 transition-all duration-400 ease-in-out", isHidden2 !== false ? "invisible" : "visible opacity-100 delay-800", isOverable && "group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800", isFocusable && "group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800", className),
|
|
48395
49685
|
...props,
|
|
48396
49686
|
children
|
|
48397
49687
|
}));
|
|
@@ -48537,7 +49827,10 @@ const CodeFormatSelector = () => {
|
|
|
48537
49827
|
setCodeFormat(value);
|
|
48538
49828
|
setContentDeclarationFormat(value);
|
|
48539
49829
|
},
|
|
48540
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49830
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49831
|
+
className: "py-1",
|
|
49832
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: "Code Format" })
|
|
49833
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
|
|
48541
49834
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
48542
49835
|
value: "typescript",
|
|
48543
49836
|
children: "TypeScript"
|
|
@@ -48558,7 +49851,10 @@ const ContentDeclarationFormatSelector = () => {
|
|
|
48558
49851
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
48559
49852
|
value: contentDeclarationFormat,
|
|
48560
49853
|
onValueChange: setContentDeclarationFormat,
|
|
48561
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49854
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49855
|
+
className: "py-1",
|
|
49856
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: "Dictionary Format" })
|
|
49857
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
|
|
48562
49858
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
48563
49859
|
value: "typescript",
|
|
48564
49860
|
children: "TypeScript"
|
|
@@ -48598,7 +49894,10 @@ const PackageManagerSelector = () => {
|
|
|
48598
49894
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
48599
49895
|
value: packageManager,
|
|
48600
49896
|
onValueChange: setPackageManager,
|
|
48601
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49897
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49898
|
+
className: "py-1",
|
|
49899
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: "Package Manager" })
|
|
49900
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
|
|
48602
49901
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
48603
49902
|
value: "npm",
|
|
48604
49903
|
children: "npm"
|
|
@@ -48627,7 +49926,7 @@ const Code = ({ children, language, isDarkMode, showHeader = true, showLineNumbe
|
|
|
48627
49926
|
codeFormat,
|
|
48628
49927
|
contentDeclarationFormat,
|
|
48629
49928
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, {
|
|
48630
|
-
className: cn$
|
|
49929
|
+
className: cn$2("relative min-w-0 max-w-full text-sm leading-6", showLineNumbers && "with-line-number ml-0", className),
|
|
48631
49930
|
transparency: "lg",
|
|
48632
49931
|
...props,
|
|
48633
49932
|
children: [showHeader && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
@@ -48646,7 +49945,7 @@ const Code = ({ children, language, isDarkMode, showHeader = true, showLineNumbe
|
|
|
48646
49945
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48647
49946
|
className: "sticky top-46 z-20",
|
|
48648
49947
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48649
|
-
className: cn$
|
|
49948
|
+
className: cn$2("absolute right-2 bottom-0 flex h-7 items-center", hadSelectInHeader && "h-11"),
|
|
48650
49949
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyCode, { code })
|
|
48651
49950
|
})
|
|
48652
49951
|
})] }), /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandCollapse, {
|
|
@@ -48696,12 +49995,12 @@ const indicatorVariant = cva("absolute top-0 z-[-1] h-full w-auto rounded-lg tra
|
|
|
48696
49995
|
const TabSelector = ({ tabs, selectedChoice, onTabClick, color: color2 = TabSelectorColor.PRIMARY, hoverable = false, className }) => {
|
|
48697
49996
|
const optionsRefs = reactExports.useRef([]);
|
|
48698
49997
|
const indicatorRef = reactExports.useRef(null);
|
|
48699
|
-
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs,
|
|
49998
|
+
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs, { isHoverable: hoverable });
|
|
48700
49999
|
reactExports.useEffect(() => {
|
|
48701
50000
|
calculatePosition();
|
|
48702
50001
|
}, [selectedChoice, tabs]);
|
|
48703
50002
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
48704
|
-
className: cn$
|
|
50003
|
+
className: cn$2(tabSelectorVariant({ color: color2 }), className),
|
|
48705
50004
|
"aria-orientation": "horizontal",
|
|
48706
50005
|
"aria-multiselectable": "false",
|
|
48707
50006
|
role: "tablist",
|
|
@@ -48723,7 +50022,7 @@ const TabSelector = ({ tabs, selectedChoice, onTabClick, color: color2 = TabSele
|
|
|
48723
50022
|
}
|
|
48724
50023
|
});
|
|
48725
50024
|
}), choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48726
|
-
className: cn$
|
|
50025
|
+
className: cn$2(indicatorVariant({ color: color2 })),
|
|
48727
50026
|
style: choiceIndicatorPosition,
|
|
48728
50027
|
ref: indicatorRef
|
|
48729
50028
|
}, `${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`)]
|
|
@@ -48912,7 +50211,7 @@ const TabComponent = ({ defaultTab, group, variant, children, className, ...prop
|
|
|
48912
50211
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabContext.Provider, {
|
|
48913
50212
|
value: contextValue,
|
|
48914
50213
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
48915
|
-
className: cn$
|
|
50214
|
+
className: cn$2(tabContainerVariant({ variant }), className),
|
|
48916
50215
|
...props,
|
|
48917
50216
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48918
50217
|
className: "sticky top-36 z-10 flex gap-3 bg-background/70 p-3 backdrop-blur",
|
|
@@ -48922,7 +50221,7 @@ const TabComponent = ({ defaultTab, group, variant, children, className, ...prop
|
|
|
48922
50221
|
const { label, value, disabled } = child.props;
|
|
48923
50222
|
const isActive = currentTabValue === value;
|
|
48924
50223
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("button", {
|
|
48925
|
-
className: cn$
|
|
50224
|
+
className: cn$2("cursor-pointer rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none", !isActive && "text-neutral/70"),
|
|
48926
50225
|
"data-active": isActive,
|
|
48927
50226
|
disabled,
|
|
48928
50227
|
onClick: () => !disabled && handleSetActiveTab(value),
|
|
@@ -48942,7 +50241,7 @@ const TabComponent = ({ defaultTab, group, variant, children, className, ...prop
|
|
|
48942
50241
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48943
50242
|
role: "tablist",
|
|
48944
50243
|
"aria-orientation": "horizontal",
|
|
48945
|
-
className: cn$
|
|
50244
|
+
className: cn$2("grid w-full min-w-0", isDragging2 ? "transition-none" : "transition-transform duration-300 ease-in-out"),
|
|
48946
50245
|
style: {
|
|
48947
50246
|
gridTemplateColumns: `repeat(${tabItems.length}, 100%)`,
|
|
48948
50247
|
transform: `translateX(-${activeTabIndex * 100 - (isDragging2 ? dragDeltaPct : 0)}%)`
|
|
@@ -48957,7 +50256,7 @@ const TabComponent = ({ defaultTab, group, variant, children, className, ...prop
|
|
|
48957
50256
|
"aria-hidden": !isActive,
|
|
48958
50257
|
tabIndex: isActive ? 0 : -1,
|
|
48959
50258
|
"data-active": isActive,
|
|
48960
|
-
className: cn$
|
|
50259
|
+
className: cn$2("w-full min-w-0 p-6 opacity-100 transition-opacity duration-300 ease-in-out", !isActive && "pointer-events-none opacity-0"),
|
|
48961
50260
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48962
50261
|
className: "flex w-full min-w-0 flex-col items-stretch gap-6",
|
|
48963
50262
|
children: children$1
|
|
@@ -48994,7 +50293,7 @@ const Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
|
48994
50293
|
isRollable,
|
|
48995
50294
|
className: "max-w-full overflow-x-auto",
|
|
48996
50295
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("table", {
|
|
48997
|
-
className: cn$
|
|
50296
|
+
className: cn$2("min-w-full max-w-full table-auto overflow-x-auto bg-background text-left", className),
|
|
48998
50297
|
...props
|
|
48999
50298
|
})
|
|
49000
50299
|
}),
|
|
@@ -49006,7 +50305,7 @@ const Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
|
49006
50305
|
children: isModalOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
49007
50306
|
className: "grid",
|
|
49008
50307
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("table", {
|
|
49009
|
-
className: cn$
|
|
50308
|
+
className: cn$2("min-w-full max-w-full table-auto text-left", className),
|
|
49010
50309
|
...props
|
|
49011
50310
|
})
|
|
49012
50311
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})
|
|
@@ -50404,22 +51703,27 @@ const MarkdownRenderer = ({ children, isDarkMode, locale, options }) => {
|
|
|
50404
51703
|
}),
|
|
50405
51704
|
h2: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H2, {
|
|
50406
51705
|
isClickable: true,
|
|
51706
|
+
className: "mt-16",
|
|
50407
51707
|
...props
|
|
50408
51708
|
}),
|
|
50409
51709
|
h3: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H3, {
|
|
50410
51710
|
isClickable: true,
|
|
51711
|
+
className: "mt-5",
|
|
50411
51712
|
...props
|
|
50412
51713
|
}),
|
|
50413
51714
|
h4: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H4, {
|
|
50414
51715
|
isClickable: true,
|
|
51716
|
+
className: "mt-3",
|
|
50415
51717
|
...props
|
|
50416
51718
|
}),
|
|
50417
51719
|
h5: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H5, {
|
|
50418
51720
|
isClickable: true,
|
|
51721
|
+
className: "mt-3",
|
|
50419
51722
|
...props
|
|
50420
51723
|
}),
|
|
50421
51724
|
h6: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H6, {
|
|
50422
51725
|
isClickable: true,
|
|
51726
|
+
className: "mt-3",
|
|
50423
51727
|
...props
|
|
50424
51728
|
}),
|
|
50425
51729
|
code: (props) => !props.className ? /* @__PURE__ */ jsxRuntimeExports.jsx("strong", {
|
|
@@ -50433,21 +51737,21 @@ const MarkdownRenderer = ({ children, isDarkMode, locale, options }) => {
|
|
|
50433
51737
|
showHeader: Boolean(props.fileName)
|
|
50434
51738
|
}),
|
|
50435
51739
|
blockquote: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("blockquote", {
|
|
50436
|
-
className: cn$
|
|
51740
|
+
className: cn$2("mt-5 gap-3 border-card border-l-4 pl-5 text-neutral", className),
|
|
50437
51741
|
...props
|
|
50438
51742
|
}),
|
|
50439
51743
|
ul: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
|
|
50440
|
-
className: cn$
|
|
51744
|
+
className: cn$2("mt-5 flex list-disc flex-col gap-3 pl-5", className),
|
|
50441
51745
|
...props
|
|
50442
51746
|
}),
|
|
50443
51747
|
ol: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("ol", {
|
|
50444
|
-
className: cn$
|
|
51748
|
+
className: cn$2("mt-5 flex list-decimal flex-col gap-3 pl-5", className),
|
|
50445
51749
|
...props
|
|
50446
51750
|
}),
|
|
50447
51751
|
img: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("img", {
|
|
50448
51752
|
...props,
|
|
50449
51753
|
loading: "lazy",
|
|
50450
|
-
className: cn$
|
|
51754
|
+
className: cn$2("max-h-[80vh] max-w-full rounded-md", className),
|
|
50451
51755
|
src: `${props.src}?raw=true`
|
|
50452
51756
|
}),
|
|
50453
51757
|
a: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Link, {
|
|
@@ -50463,30 +51767,30 @@ const MarkdownRenderer = ({ children, isDarkMode, locale, options }) => {
|
|
|
50463
51767
|
...props
|
|
50464
51768
|
}),
|
|
50465
51769
|
th: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("th", {
|
|
50466
|
-
className: cn$
|
|
51770
|
+
className: cn$2("border-neutral border-b bg-neutral/10 p-4", className),
|
|
50467
51771
|
...props
|
|
50468
51772
|
}),
|
|
50469
51773
|
tr: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50470
|
-
className: cn$
|
|
51774
|
+
className: cn$2("hover:/10 hover:bg-neutral/10", className),
|
|
50471
51775
|
...props
|
|
50472
51776
|
}),
|
|
50473
51777
|
td: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
50474
|
-
className: cn$
|
|
51778
|
+
className: cn$2("border-neutral-500/50 border-b p-4", className),
|
|
50475
51779
|
...props
|
|
50476
51780
|
}),
|
|
50477
51781
|
hr: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("hr", {
|
|
50478
|
-
className: cn$
|
|
51782
|
+
className: cn$2("mx-6 mt-16 text-neutral", className),
|
|
50479
51783
|
...props
|
|
50480
51784
|
}),
|
|
50481
51785
|
Tabs: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { ...props }),
|
|
50482
51786
|
Tab: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { ...props }),
|
|
50483
51787
|
TabItem: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tab.Item, { ...props }),
|
|
50484
51788
|
Columns: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
50485
|
-
className: cn$
|
|
51789
|
+
className: cn$2("flex gap-4 max-md:flex-col", className),
|
|
50486
51790
|
...props
|
|
50487
51791
|
}),
|
|
50488
51792
|
Column: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
50489
|
-
className: cn$
|
|
51793
|
+
className: cn$2("flex-1", className),
|
|
50490
51794
|
...props
|
|
50491
51795
|
}),
|
|
50492
51796
|
...overrides
|
|
@@ -50822,16 +52126,25 @@ const TranslationTextEditor = ({ section, keyPath, dictionary, renderSection })
|
|
|
50822
52126
|
className: "flex w-full flex-col gap-2",
|
|
50823
52127
|
children: localesList.map((translationKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50824
52128
|
className: "mt-2 w-full p-2 text-xs",
|
|
50825
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
50826
|
-
|
|
50827
|
-
|
|
50828
|
-
|
|
50829
|
-
|
|
50830
|
-
|
|
50831
|
-
|
|
50832
|
-
|
|
50833
|
-
|
|
50834
|
-
|
|
52129
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52130
|
+
className: "w-full",
|
|
52131
|
+
children: getLocaleName(translationKey, locale)
|
|
52132
|
+
})
|
|
52133
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
52134
|
+
className: "flex",
|
|
52135
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52136
|
+
className: "w-full",
|
|
52137
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
52138
|
+
section: content2[translationKey] ?? getEmptyNode(content2[defaultLocale]),
|
|
52139
|
+
keyPath: [...keyPath, {
|
|
52140
|
+
type: NodeType.Translation,
|
|
52141
|
+
key: translationKey
|
|
52142
|
+
}],
|
|
52143
|
+
dictionary,
|
|
52144
|
+
renderSection
|
|
52145
|
+
})
|
|
52146
|
+
})
|
|
52147
|
+
})] }, translationKey))
|
|
50835
52148
|
})
|
|
50836
52149
|
});
|
|
50837
52150
|
};
|
|
@@ -50919,7 +52232,10 @@ const ConditionTextEditor = ({ section, keyPath, dictionary, renderSection }) =>
|
|
|
50919
52232
|
"fallback"
|
|
50920
52233
|
].map((condKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50921
52234
|
className: "mt-2 block w-full p-2 text-xs",
|
|
50922
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52235
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52236
|
+
className: "w-full",
|
|
52237
|
+
children: String(condKey)
|
|
52238
|
+
})
|
|
50923
52239
|
}, condKey), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50924
52240
|
className: "block w-full",
|
|
50925
52241
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
@@ -50947,7 +52263,10 @@ const GenderTextEditor = ({ section, keyPath, dictionary, renderSection }) => {
|
|
|
50947
52263
|
"fallback"
|
|
50948
52264
|
].map((condKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50949
52265
|
className: "mt-2 block w-full p-2 text-xs",
|
|
50950
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52266
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52267
|
+
className: "w-full",
|
|
52268
|
+
children: String(condKey)
|
|
52269
|
+
})
|
|
50951
52270
|
}, condKey), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50952
52271
|
className: "block w-full",
|
|
50953
52272
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
@@ -50973,7 +52292,7 @@ const ArrayTextEditor = ({ section, keyPath, dictionary, renderSection }) => {
|
|
|
50973
52292
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", {
|
|
50974
52293
|
className: "flex w-full flex-col gap-2",
|
|
50975
52294
|
children: section.map((subSection, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("tr", {
|
|
50976
|
-
className: "mt-2 flex w-full justify-between gap-2 p-2",
|
|
52295
|
+
className: "mt-2 flex w-full items-center justify-between gap-2 p-2",
|
|
50977
52296
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
50978
52297
|
className: "text-xs",
|
|
50979
52298
|
children: String(index2)
|
|
@@ -51038,7 +52357,10 @@ const ObjectTextEditor = ({ section, keyPath, dictionary, renderSection }) => /*
|
|
|
51038
52357
|
const subSection = typedSection[key2] ?? getEmptyNode(typedSection[firstKey]);
|
|
51039
52358
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
51040
52359
|
className: "mt-2 p-2 text-xs",
|
|
51041
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52360
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52361
|
+
className: "w-full",
|
|
52362
|
+
children: String(key2)
|
|
52363
|
+
})
|
|
51042
52364
|
}, JSON.stringify(subSection)), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
51043
52365
|
className: "block w-full",
|
|
51044
52366
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditor, {
|
|
@@ -51120,7 +52442,7 @@ const NestedTextEditor = ({ keyPath, dictionary, renderSection, section, ...prop
|
|
|
51120
52442
|
const content2 = section[NodeType.Nested];
|
|
51121
52443
|
const childrenKeyPath = [...keyPath, { type: NodeType.Nested }];
|
|
51122
52444
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
51123
|
-
className: "w-full p-2",
|
|
52445
|
+
className: "flex w-full flex-col gap-4 p-2",
|
|
51124
52446
|
children: [
|
|
51125
52447
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { children: "Dictionary key" }),
|
|
51126
52448
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput, {
|
|
@@ -51276,7 +52598,7 @@ const getIsEditableSection = (section) => {
|
|
|
51276
52598
|
const KeyPathBreadcrumb = ({ keyPath, dictionaryKey, onClickKeyPath, locale }) => {
|
|
51277
52599
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, {
|
|
51278
52600
|
links: [{
|
|
51279
|
-
text: dictionaryKey,
|
|
52601
|
+
text: camelCaseToSentence(dictionaryKey),
|
|
51280
52602
|
onClick: () => onClickKeyPath([])
|
|
51281
52603
|
}, ...keyPath.map((el, index2) => ({
|
|
51282
52604
|
onClick: () => onClickKeyPath(keyPath.slice(0, index2 + 1)),
|
|
@@ -51286,9 +52608,6 @@ const KeyPathBreadcrumb = ({ keyPath, dictionaryKey, onClickKeyPath, locale }) =
|
|
|
51286
52608
|
elementType: "location"
|
|
51287
52609
|
});
|
|
51288
52610
|
};
|
|
51289
|
-
const camelCaseToSentence = (content2) => {
|
|
51290
|
-
return String(content2).replace(/([A-Z])/g, " $1").toLowerCase().trim();
|
|
51291
|
-
};
|
|
51292
52611
|
const NavigationViewNode = ({ section: sectionProp, keyPath, dictionary }) => {
|
|
51293
52612
|
const { locales } = configuration.internationalization;
|
|
51294
52613
|
const section = getContentNodeByKeyPath(sectionProp, keyPath, useEditorLocale());
|
|
@@ -51829,8 +53148,8 @@ function validateChanges(initial, changes) {
|
|
|
51829
53148
|
})) errorHandler$1("changeField");
|
|
51830
53149
|
return changes;
|
|
51831
53150
|
}
|
|
51832
|
-
function validateSelector(
|
|
51833
|
-
if (!isFunction(
|
|
53151
|
+
function validateSelector(selector2) {
|
|
53152
|
+
if (!isFunction(selector2)) errorHandler$1("selectorType");
|
|
51834
53153
|
}
|
|
51835
53154
|
function validateHandler(handler) {
|
|
51836
53155
|
if (!(isFunction(handler) || isObject$1(handler))) errorHandler$1("handlerType");
|
|
@@ -51876,11 +53195,11 @@ function create(initial) {
|
|
|
51876
53195
|
var validate = curry$1(validators$1.changes)(initial);
|
|
51877
53196
|
var getChanges = curry$1(extractChanges)(state);
|
|
51878
53197
|
function getState2() {
|
|
51879
|
-
var
|
|
53198
|
+
var selector2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(state2) {
|
|
51880
53199
|
return state2;
|
|
51881
53200
|
};
|
|
51882
|
-
validators$1.selector(
|
|
51883
|
-
return
|
|
53201
|
+
validators$1.selector(selector2);
|
|
53202
|
+
return selector2(state.current);
|
|
51884
53203
|
}
|
|
51885
53204
|
function setState2(causedChanges) {
|
|
51886
53205
|
compose$1(didUpdate, update, validate, getChanges)(causedChanges);
|
|
@@ -52298,11 +53617,11 @@ const MonacoCode = ({ children, language, isDarkMode, showLineNumbers, showCopyB
|
|
|
52298
53617
|
};
|
|
52299
53618
|
const isShowLineNumbers = showLineNumbers ?? children.split("\n").length > 1;
|
|
52300
53619
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
52301
|
-
className: cn$
|
|
53620
|
+
className: cn$2("relative h-full w-full text-sm", showLineNumbers && "ml-0"),
|
|
52302
53621
|
children: [showCopyButton && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
52303
53622
|
className: "sticky top-5 z-10",
|
|
52304
53623
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
52305
|
-
className: cn$
|
|
53624
|
+
className: cn$2("absolute right-2 bottom-0 flex h-7 items-center"),
|
|
52306
53625
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, { content: children })
|
|
52307
53626
|
})
|
|
52308
53627
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
@@ -52714,13 +54033,13 @@ const DictionaryFieldEditor = ({ dictionary, onClickDictionaryList, isDarkMode,
|
|
|
52714
54033
|
});
|
|
52715
54034
|
};
|
|
52716
54035
|
const MaxWidthSmoother = ({ children, isHidden: isHidden2, minWidth = 0, align = "left", className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
52717
|
-
className: cn$
|
|
54036
|
+
className: cn$2("relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out", isHidden2 ? "" : "grid-cols-[1fr]", className),
|
|
52718
54037
|
"aria-hidden": isHidden2,
|
|
52719
54038
|
...props,
|
|
52720
54039
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
52721
54040
|
style: { minWidth: `${minWidth}px` },
|
|
52722
54041
|
tabIndex: isHidden2 !== false ? void 0 : -1,
|
|
52723
|
-
className: cn$
|
|
54042
|
+
className: cn$2(align === "right" && "ml-auto"),
|
|
52724
54043
|
children
|
|
52725
54044
|
})
|
|
52726
54045
|
});
|
|
@@ -52748,6 +54067,18 @@ const checkIsMobileUserAgent = () => {
|
|
|
52748
54067
|
if (typeof userAgent === "undefined") return;
|
|
52749
54068
|
return /android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(userAgent);
|
|
52750
54069
|
};
|
|
54070
|
+
const checkIsIOS = () => {
|
|
54071
|
+
if (typeof window === "undefined") return;
|
|
54072
|
+
const userAgent = window.navigator?.userAgent;
|
|
54073
|
+
if (typeof userAgent === "undefined") return;
|
|
54074
|
+
return /iP(?:hone|ad|od)/.test(userAgent);
|
|
54075
|
+
};
|
|
54076
|
+
const checkIsMac = () => {
|
|
54077
|
+
if (typeof window === "undefined") return;
|
|
54078
|
+
const userAgent = window.navigator?.userAgent;
|
|
54079
|
+
if (typeof userAgent === "undefined") return;
|
|
54080
|
+
return /Macintosh|MacIntel|Mac OS X/.test(userAgent);
|
|
54081
|
+
};
|
|
52751
54082
|
const checkIsMobileScreen = (breakpoint) => {
|
|
52752
54083
|
if (typeof window === "undefined") return;
|
|
52753
54084
|
return (window?.innerWidth ?? 0) <= breakpoint;
|
|
@@ -52759,7 +54090,9 @@ const calculateIsMobile = (breakpoint = "md") => {
|
|
|
52759
54090
|
return {
|
|
52760
54091
|
isMobileScreen,
|
|
52761
54092
|
isMobileUserAgent,
|
|
52762
|
-
isMobile: isMobileScreen ?? isMobileUserAgent
|
|
54093
|
+
isMobile: isMobileScreen ?? isMobileUserAgent,
|
|
54094
|
+
isIOS: checkIsIOS(),
|
|
54095
|
+
isMac: checkIsMac()
|
|
52763
54096
|
};
|
|
52764
54097
|
};
|
|
52765
54098
|
const useDevice = (breakpoint = "md") => {
|
|
@@ -53658,7 +54991,7 @@ const ToastPrimitives = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
53658
54991
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
53659
54992
|
const ToastProvider = ToastPrimitives;
|
|
53660
54993
|
const ToastViewport = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Viewport, {
|
|
53661
|
-
className: cn$
|
|
54994
|
+
className: cn$2("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]", className),
|
|
53662
54995
|
...props
|
|
53663
54996
|
});
|
|
53664
54997
|
const toastVariants = cva("group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none", {
|
|
@@ -53671,22 +55004,22 @@ const toastVariants = cva("group data-[state=closed]:fade-out-80 data-[state=clo
|
|
|
53671
55004
|
});
|
|
53672
55005
|
const Toast = ({ className, variant, ...props }) => {
|
|
53673
55006
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2, {
|
|
53674
|
-
className: cn$
|
|
55007
|
+
className: cn$2(toastVariants({ variant }), className),
|
|
53675
55008
|
...props
|
|
53676
55009
|
});
|
|
53677
55010
|
};
|
|
53678
55011
|
const ToastClose = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Close, {
|
|
53679
|
-
className: cn$
|
|
55012
|
+
className: cn$2("absolute top-1 right-1 rounded-md p-1 text-text/50 opacity-0 transition-opacity hover:text-text/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 group-[.destructive]:hover:text-red-50", className),
|
|
53680
55013
|
"toast-close": "",
|
|
53681
55014
|
...props,
|
|
53682
55015
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "size-5" })
|
|
53683
55016
|
});
|
|
53684
55017
|
const ToastTitle = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Title, {
|
|
53685
|
-
className: cn$
|
|
55018
|
+
className: cn$2("font-semibold text-sm [&+div]:text-xs", className),
|
|
53686
55019
|
...props
|
|
53687
55020
|
});
|
|
53688
55021
|
const ToastDescription = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Description, {
|
|
53689
|
-
className: cn$
|
|
55022
|
+
className: cn$2("text-sm opacity-90", className),
|
|
53690
55023
|
...props
|
|
53691
55024
|
});
|
|
53692
55025
|
const TOAST_LIMIT = 1;
|