@carlonicora/nextjs-jsonapi 5.6.0 → 5.7.0
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/dist/{BlockNoteEditor-NEYG5L6W.mjs → BlockNoteEditor-R3WXUFHX.mjs} +4 -4
- package/dist/{BlockNoteEditor-AE3ZTEEH.js → BlockNoteEditor-ZHXXFWUJ.js} +19 -19
- package/dist/{BlockNoteEditor-AE3ZTEEH.js.map → BlockNoteEditor-ZHXXFWUJ.js.map} +1 -1
- package/dist/{BlockNoteViewer-3OUT5UFY.mjs → BlockNoteViewer-BVVN6D3T.mjs} +2 -2
- package/dist/{BlockNoteViewer-4CFKQM7U.js → BlockNoteViewer-SD3ZFIXD.js} +3 -3
- package/dist/{BlockNoteViewer-4CFKQM7U.js.map → BlockNoteViewer-SD3ZFIXD.js.map} +1 -1
- package/dist/billing/index.d.mts +33 -43
- package/dist/billing/index.d.ts +33 -43
- package/dist/billing/index.js +590 -574
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +28 -12
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-3I5AAJXV.js → chunk-2TXE57LE.js} +3 -3
- package/dist/{chunk-3I5AAJXV.js.map → chunk-2TXE57LE.js.map} +1 -1
- package/dist/{chunk-HKZAESS6.js → chunk-5TH2DSAH.js} +17 -12
- package/dist/chunk-5TH2DSAH.js.map +1 -0
- package/dist/{chunk-SFYPXCK4.mjs → chunk-CFB6FHIY.mjs} +638 -536
- package/dist/{chunk-SFYPXCK4.mjs.map → chunk-CFB6FHIY.mjs.map} +1 -1
- package/dist/{chunk-EYA2F6AN.mjs → chunk-FK26NX3S.mjs} +16 -11
- package/dist/chunk-FK26NX3S.mjs.map +1 -0
- package/dist/{chunk-53BAULDP.js → chunk-IJME5SAM.js} +4 -4
- package/dist/{chunk-53BAULDP.js.map → chunk-IJME5SAM.js.map} +1 -1
- package/dist/{chunk-KQHBONL4.mjs → chunk-OKCV4GPJ.mjs} +2 -2
- package/dist/{chunk-BTPUYUQ3.mjs → chunk-RGQYFSJF.mjs} +2 -2
- package/dist/{chunk-Y7RR57EW.mjs → chunk-WCHLCOZG.mjs} +2 -2
- package/dist/{chunk-RL3PL3KV.js → chunk-XOSC3FFP.js} +8 -8
- package/dist/{chunk-RL3PL3KV.js.map → chunk-XOSC3FFP.js.map} +1 -1
- package/dist/{chunk-LQ4DK4JF.js → chunk-ZCOPOO7T.js} +1314 -1212
- package/dist/chunk-ZCOPOO7T.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +9 -3
- package/dist/core/index.d.ts +9 -3
- package/dist/core/index.js +10 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +9 -1
- package/dist/{format-options-D6c7FNDi.d.mts → currency-DT_dveBx.d.mts} +41 -8
- package/dist/{format-options-BtX3o0Yu.d.ts → currency-pK9eRYRC.d.ts} +41 -8
- package/dist/email-automations/index.js +92 -92
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.js +121 -121
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +16 -16
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +124 -124
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
- package/src/core/index.ts +3 -0
- package/src/features/billing/contexts/CouponContext.tsx +0 -2
- package/src/features/billing/stripe-coupon/components/details/CouponDetails.tsx +5 -2
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeEditor.tsx +6 -5
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeFields.tsx +67 -45
- package/src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx +304 -212
- package/src/features/billing/stripe-coupon/components/widgets/CouponCodeActions.tsx +4 -3
- package/src/features/billing/stripe-coupon/data/stripe-coupon.interface.ts +11 -7
- package/src/features/billing/stripe-coupon/data/stripe-coupon.ts +6 -4
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx +14 -7
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.tsx +2 -2
- package/src/features/billing/stripe-coupon/stripe-coupon-code.module.ts +3 -2
- package/src/features/billing/stripe-coupon/stripe-coupon.module.ts +11 -4
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +1 -1
- package/src/features/billing/stripe-subscription/hooks/wizard-promotion.ts +15 -8
- package/dist/chunk-EYA2F6AN.mjs.map +0 -1
- package/dist/chunk-HKZAESS6.js.map +0 -1
- package/dist/chunk-LQ4DK4JF.js.map +0 -1
- /package/dist/{BlockNoteEditor-NEYG5L6W.mjs.map → BlockNoteEditor-R3WXUFHX.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-3OUT5UFY.mjs.map → BlockNoteViewer-BVVN6D3T.mjs.map} +0 -0
- /package/dist/{chunk-KQHBONL4.mjs.map → chunk-OKCV4GPJ.mjs.map} +0 -0
- /package/dist/{chunk-BTPUYUQ3.mjs.map → chunk-RGQYFSJF.mjs.map} +0 -0
- /package/dist/{chunk-Y7RR57EW.mjs.map → chunk-WCHLCOZG.mjs.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
isReferralEnabled,
|
|
17
17
|
isRegistrationAllowed,
|
|
18
18
|
useWaitlistText
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WCHLCOZG.mjs";
|
|
20
20
|
import {
|
|
21
21
|
getRoleId,
|
|
22
22
|
isRolesConfigured
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
RehydrationFactory,
|
|
55
55
|
RoleService,
|
|
56
56
|
S3Service,
|
|
57
|
+
STRIPE_COUPON_DETAIL_PAGE_URL,
|
|
57
58
|
StripeCouponCodeService,
|
|
58
59
|
StripeCouponService,
|
|
59
60
|
StripeProductService,
|
|
@@ -96,7 +97,7 @@ import {
|
|
|
96
97
|
useIsMobile,
|
|
97
98
|
validateItalianTaxCode,
|
|
98
99
|
validatePartitaIva
|
|
99
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-FK26NX3S.mjs";
|
|
100
101
|
import {
|
|
101
102
|
ENV
|
|
102
103
|
} from "./chunk-V5MI7RNB.mjs";
|
|
@@ -10710,7 +10711,7 @@ import { useRef as useRef18 } from "react";
|
|
|
10710
10711
|
import dynamic from "next/dynamic";
|
|
10711
10712
|
import React18 from "react";
|
|
10712
10713
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
10713
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10714
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-R3WXUFHX.mjs"), {
|
|
10714
10715
|
ssr: false
|
|
10715
10716
|
});
|
|
10716
10717
|
var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -11771,14 +11772,14 @@ function GdprConsentCheckbox({
|
|
|
11771
11772
|
id,
|
|
11772
11773
|
label,
|
|
11773
11774
|
description,
|
|
11774
|
-
required
|
|
11775
|
+
required: required2
|
|
11775
11776
|
}) {
|
|
11776
11777
|
return /* @__PURE__ */ jsx104(FormFieldWrapper, { form, name: id, orientation: "horizontal", children: (field) => /* @__PURE__ */ jsxs61("div", { className: "flex flex-row items-start space-x-3 space-y-0", children: [
|
|
11777
|
-
/* @__PURE__ */ jsx104(Checkbox, { checked: field.value, onCheckedChange: field.onChange, "aria-required":
|
|
11778
|
+
/* @__PURE__ */ jsx104(Checkbox, { checked: field.value, onCheckedChange: field.onChange, "aria-required": required2 }),
|
|
11778
11779
|
/* @__PURE__ */ jsxs61("div", { className: "space-y-1 leading-none", children: [
|
|
11779
11780
|
/* @__PURE__ */ jsxs61("span", { className: "text-sm font-normal", children: [
|
|
11780
11781
|
label,
|
|
11781
|
-
|
|
11782
|
+
required2 && /* @__PURE__ */ jsx104("span", { className: "ms-1 text-destructive", children: "*" })
|
|
11782
11783
|
] }),
|
|
11783
11784
|
description && /* @__PURE__ */ jsx104(FieldDescription, { className: "text-xs", children: description })
|
|
11784
11785
|
] })
|
|
@@ -16917,7 +16918,7 @@ __name(BlockNoteEditorMentionSuggestionMenu, "BlockNoteEditorMentionSuggestionMe
|
|
|
16917
16918
|
import dynamic2 from "next/dynamic";
|
|
16918
16919
|
import React29 from "react";
|
|
16919
16920
|
import { jsx as jsx177 } from "react/jsx-runtime";
|
|
16920
|
-
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-
|
|
16921
|
+
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-BVVN6D3T.mjs").then((m) => m.BlockNoteViewer), { ssr: false });
|
|
16921
16922
|
var BlockNoteViewerContainer = React29.memo(/* @__PURE__ */ __name(function ViewerContainer(props) {
|
|
16922
16923
|
return /* @__PURE__ */ jsx177(BlockNoteViewer, { ...props });
|
|
16923
16924
|
}, "ViewerContainer"));
|
|
@@ -17856,7 +17857,7 @@ var useStripeCouponTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
17856
17857
|
header: t("billing.admin.coupons.fields.name"),
|
|
17857
17858
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
17858
17859
|
const coupon = row.original.jsonApiData;
|
|
17859
|
-
return /* @__PURE__ */ jsx191(Link, { href: generateUrl({ page:
|
|
17860
|
+
return /* @__PURE__ */ jsx191(Link, { href: generateUrl({ page: STRIPE_COUPON_DETAIL_PAGE_URL, id: coupon.id }), children: coupon.name });
|
|
17860
17861
|
}, "cell"),
|
|
17861
17862
|
enableSorting: false,
|
|
17862
17863
|
enableHiding: false
|
|
@@ -17918,11 +17919,11 @@ registerTableGenerator("stripe-coupons", useStripeCouponTableStructure);
|
|
|
17918
17919
|
|
|
17919
17920
|
// src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx
|
|
17920
17921
|
import { useTranslations as useTranslations76 } from "next-intl";
|
|
17921
|
-
import { useMemo as useMemo36 } from "react";
|
|
17922
|
+
import { useMemo as useMemo36, useState as useState66 } from "react";
|
|
17922
17923
|
|
|
17923
17924
|
// src/features/billing/contexts/CouponContext.tsx
|
|
17924
17925
|
import { useTranslations as useTranslations74 } from "next-intl";
|
|
17925
|
-
import { createContext as createContext28, useCallback as useCallback34, useContext as useContext28, useMemo as useMemo35, useState as
|
|
17926
|
+
import { createContext as createContext28, useCallback as useCallback34, useContext as useContext28, useMemo as useMemo35, useState as useState64 } from "react";
|
|
17926
17927
|
|
|
17927
17928
|
// src/features/billing/stripe-coupon/components/forms/CouponRefresher.tsx
|
|
17928
17929
|
import { RefreshCwIcon as RefreshCwIcon4 } from "lucide-react";
|
|
@@ -17961,24 +17962,45 @@ __name(CouponRefresher, "CouponRefresher");
|
|
|
17961
17962
|
// src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx
|
|
17962
17963
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
|
17963
17964
|
import { useTranslations as useTranslations73 } from "next-intl";
|
|
17964
|
-
import { useCallback as useCallback33, useMemo as useMemo34 } from "react";
|
|
17965
|
+
import { useCallback as useCallback33, useMemo as useMemo34, useState as useState63 } from "react";
|
|
17965
17966
|
import { useForm as useForm5 } from "react-hook-form";
|
|
17966
17967
|
import { v4 as v45 } from "uuid";
|
|
17967
17968
|
import { z as z5 } from "zod";
|
|
17968
17969
|
|
|
17969
17970
|
// src/features/billing/stripe-coupon/components/forms/CouponCodeFields.tsx
|
|
17970
17971
|
import { useTranslations as useTranslations72 } from "next-intl";
|
|
17972
|
+
import { useState as useState62 } from "react";
|
|
17971
17973
|
import { z as z4 } from "zod";
|
|
17972
17974
|
import { jsx as jsx193, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
17973
|
-
var
|
|
17974
|
-
|
|
17975
|
-
|
|
17976
|
-
)
|
|
17977
|
-
|
|
17978
|
-
|
|
17979
|
-
|
|
17980
|
-
|
|
17981
|
-
|
|
17975
|
+
var rawNumber = /* @__PURE__ */ __name(() => z4.union([z4.string(), z4.number()]).nullish(), "rawNumber");
|
|
17976
|
+
function issueMessages(schema, value) {
|
|
17977
|
+
const result = schema.safeParse(value);
|
|
17978
|
+
return result.success ? [] : result.error.issues.map((issue) => issue.message);
|
|
17979
|
+
}
|
|
17980
|
+
__name(issueMessages, "issueMessages");
|
|
17981
|
+
function parseOptionalPositiveInt(value) {
|
|
17982
|
+
if (value === void 0 || value === null || value === "" || value === 0) return void 0;
|
|
17983
|
+
if (typeof value === "number") return Number.isNaN(value) ? void 0 : value;
|
|
17984
|
+
return parseInt(value, 10);
|
|
17985
|
+
}
|
|
17986
|
+
__name(parseOptionalPositiveInt, "parseOptionalPositiveInt");
|
|
17987
|
+
function parseOptionalDecimal(value) {
|
|
17988
|
+
if (typeof value === "string") return value.trim() === "" ? void 0 : parseFloat(value.replace(",", "."));
|
|
17989
|
+
if (value === void 0 || value === null || Number.isNaN(value)) return void 0;
|
|
17990
|
+
return value;
|
|
17991
|
+
}
|
|
17992
|
+
__name(parseOptionalDecimal, "parseOptionalDecimal");
|
|
17993
|
+
var positiveIntCheck = z4.number().int().min(1).optional();
|
|
17994
|
+
var decimalCheck = z4.number().optional();
|
|
17995
|
+
var optionalPositiveInt = /* @__PURE__ */ __name(() => rawNumber().superRefine((value, ctx) => {
|
|
17996
|
+
for (const message of issueMessages(positiveIntCheck, parseOptionalPositiveInt(value)))
|
|
17997
|
+
ctx.addIssue({ code: "custom", message });
|
|
17998
|
+
}), "optionalPositiveInt");
|
|
17999
|
+
var optionalDecimal = /* @__PURE__ */ __name(() => rawNumber().superRefine((value, ctx) => {
|
|
18000
|
+
for (const message of issueMessages(decimalCheck, parseOptionalDecimal(value)))
|
|
18001
|
+
ctx.addIssue({ code: "custom", message });
|
|
18002
|
+
}), "optionalDecimal");
|
|
18003
|
+
var optionalDate = /* @__PURE__ */ __name(() => z4.union([z4.date(), z4.literal("")]).nullish(), "optionalDate");
|
|
17982
18004
|
var couponCodeSchema = /* @__PURE__ */ __name((t) => z4.object({
|
|
17983
18005
|
code: z4.string().optional(),
|
|
17984
18006
|
firstTimeTransaction: z4.boolean(),
|
|
@@ -17989,7 +18011,8 @@ var couponCodeSchema = /* @__PURE__ */ __name((t) => z4.object({
|
|
|
17989
18011
|
maxRedemptions: optionalPositiveInt(),
|
|
17990
18012
|
automatic: z4.boolean()
|
|
17991
18013
|
}).superRefine((values, ctx) => {
|
|
17992
|
-
|
|
18014
|
+
const minimumAmount = parseOptionalDecimal(values.minimumAmount);
|
|
18015
|
+
if (minimumAmount !== void 0 && minimumAmount <= 0)
|
|
17993
18016
|
ctx.addIssue({
|
|
17994
18017
|
code: "custom",
|
|
17995
18018
|
path: ["minimumAmount"],
|
|
@@ -18012,13 +18035,15 @@ var toCouponCodeInput = /* @__PURE__ */ __name((values) => {
|
|
|
18012
18035
|
automatic: values.automatic
|
|
18013
18036
|
};
|
|
18014
18037
|
if (values.code?.trim()) input.code = values.code.trim();
|
|
18015
|
-
|
|
18016
|
-
|
|
18038
|
+
const minimumAmount = parseOptionalDecimal(values.minimumAmount);
|
|
18039
|
+
if (minimumAmount !== void 0) {
|
|
18040
|
+
input.minimumAmount = Math.round(minimumAmount * 100);
|
|
18017
18041
|
input.minimumAmountCurrency = values.minimumAmountCurrency;
|
|
18018
18042
|
}
|
|
18019
18043
|
if (values.stripeCustomerId?.trim()) input.stripeCustomerId = values.stripeCustomerId.trim();
|
|
18020
18044
|
if (values.expiresAt) input.expiresAt = values.expiresAt;
|
|
18021
|
-
|
|
18045
|
+
const maxRedemptions = parseOptionalPositiveInt(values.maxRedemptions);
|
|
18046
|
+
if (maxRedemptions !== void 0) input.maxRedemptions = maxRedemptions;
|
|
18022
18047
|
return input;
|
|
18023
18048
|
}, "toCouponCodeInput");
|
|
18024
18049
|
var couponCurrencyOptions = [
|
|
@@ -18028,6 +18053,7 @@ var couponCurrencyOptions = [
|
|
|
18028
18053
|
];
|
|
18029
18054
|
function CouponCodeFields({ form, prefix = "" }) {
|
|
18030
18055
|
const t = useTranslations72();
|
|
18056
|
+
const [now] = useState62(() => /* @__PURE__ */ new Date());
|
|
18031
18057
|
return /* @__PURE__ */ jsxs103("div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
18032
18058
|
/* @__PURE__ */ jsx193(
|
|
18033
18059
|
FormInput,
|
|
@@ -18085,7 +18111,7 @@ function CouponCodeFields({ form, prefix = "" }) {
|
|
|
18085
18111
|
form,
|
|
18086
18112
|
id: `${prefix}expiresAt`,
|
|
18087
18113
|
name: t("billing.admin.coupons.fields.expiresAt"),
|
|
18088
|
-
minDate:
|
|
18114
|
+
minDate: now,
|
|
18089
18115
|
allowEmpty: true
|
|
18090
18116
|
}
|
|
18091
18117
|
),
|
|
@@ -18113,8 +18139,89 @@ function CouponCodeFields({ form, prefix = "" }) {
|
|
|
18113
18139
|
__name(CouponCodeFields, "CouponCodeFields");
|
|
18114
18140
|
|
|
18115
18141
|
// src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx
|
|
18116
|
-
import {
|
|
18117
|
-
|
|
18142
|
+
import { jsx as jsx194, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
18143
|
+
var couponRenameSchema = /* @__PURE__ */ __name((t) => z5.object({ id: z5.string(), name: z5.string().min(1, { message: t("billing.admin.coupons.errors.name") }) }), "couponRenameSchema");
|
|
18144
|
+
var couponCreateSchema = /* @__PURE__ */ __name((t) => z5.object({
|
|
18145
|
+
id: z5.uuidv4(),
|
|
18146
|
+
name: z5.string().min(1, { message: t("billing.admin.coupons.errors.name") }),
|
|
18147
|
+
stripeCouponId: z5.string().optional(),
|
|
18148
|
+
discountType: z5.enum(["percent_off", "amount_off"]),
|
|
18149
|
+
percentOff: optionalDecimal(),
|
|
18150
|
+
amountOff: optionalDecimal(),
|
|
18151
|
+
currency: z5.string().min(1),
|
|
18152
|
+
duration: z5.enum(["once", "repeating", "forever"]),
|
|
18153
|
+
durationInMonths: optionalPositiveInt(),
|
|
18154
|
+
products: z5.array(z5.object({ id: z5.string(), name: z5.string().optional() })),
|
|
18155
|
+
redeemBy: optionalDate(),
|
|
18156
|
+
maxRedemptions: optionalPositiveInt(),
|
|
18157
|
+
firstCode: couponCodeSchema(t)
|
|
18158
|
+
}).superRefine((values, ctx) => {
|
|
18159
|
+
const percentOff = parseOptionalDecimal(values.percentOff);
|
|
18160
|
+
if (values.discountType === "percent_off" && (percentOff === void 0 || percentOff < 0.01 || percentOff > 100))
|
|
18161
|
+
ctx.addIssue({
|
|
18162
|
+
code: "custom",
|
|
18163
|
+
path: ["percentOff"],
|
|
18164
|
+
message: t("billing.admin.coupons.errors.percentOff")
|
|
18165
|
+
});
|
|
18166
|
+
const amountOff = parseOptionalDecimal(values.amountOff);
|
|
18167
|
+
if (values.discountType === "amount_off" && (amountOff === void 0 || amountOff <= 0))
|
|
18168
|
+
ctx.addIssue({
|
|
18169
|
+
code: "custom",
|
|
18170
|
+
path: ["amountOff"],
|
|
18171
|
+
message: t("billing.admin.coupons.errors.amountOff")
|
|
18172
|
+
});
|
|
18173
|
+
if (values.duration === "repeating" && parseOptionalPositiveInt(values.durationInMonths) === void 0)
|
|
18174
|
+
ctx.addIssue({
|
|
18175
|
+
code: "custom",
|
|
18176
|
+
path: ["durationInMonths"],
|
|
18177
|
+
message: t("billing.admin.coupons.errors.durationInMonths")
|
|
18178
|
+
});
|
|
18179
|
+
}), "couponCreateSchema");
|
|
18180
|
+
function required(value, field) {
|
|
18181
|
+
if (value === void 0) throw new Error(`${field} is not set`);
|
|
18182
|
+
return value;
|
|
18183
|
+
}
|
|
18184
|
+
__name(required, "required");
|
|
18185
|
+
function toDiscountInput(values) {
|
|
18186
|
+
if (values.discountType === "percent_off")
|
|
18187
|
+
return { discountType: "percent_off", percentOff: required(parseOptionalDecimal(values.percentOff), "percentOff") };
|
|
18188
|
+
return {
|
|
18189
|
+
discountType: "amount_off",
|
|
18190
|
+
amountOff: Math.round(required(parseOptionalDecimal(values.amountOff), "amountOff") * 100),
|
|
18191
|
+
currency: values.currency
|
|
18192
|
+
};
|
|
18193
|
+
}
|
|
18194
|
+
__name(toDiscountInput, "toDiscountInput");
|
|
18195
|
+
function toDurationInput(values) {
|
|
18196
|
+
if (values.duration === "repeating")
|
|
18197
|
+
return {
|
|
18198
|
+
duration: "repeating",
|
|
18199
|
+
durationInMonths: required(parseOptionalPositiveInt(values.durationInMonths), "durationInMonths")
|
|
18200
|
+
};
|
|
18201
|
+
return { duration: values.duration };
|
|
18202
|
+
}
|
|
18203
|
+
__name(toDurationInput, "toDurationInput");
|
|
18204
|
+
function toCouponInput(values) {
|
|
18205
|
+
const payload = {
|
|
18206
|
+
id: values.id,
|
|
18207
|
+
name: values.name,
|
|
18208
|
+
firstCode: toCouponCodeInput(values.firstCode),
|
|
18209
|
+
...toDiscountInput(values),
|
|
18210
|
+
...toDurationInput(values)
|
|
18211
|
+
};
|
|
18212
|
+
if (values.stripeCouponId?.trim()) payload.stripeCouponId = values.stripeCouponId.trim();
|
|
18213
|
+
if (values.products.length > 0) payload.productIds = values.products.map((product) => product.id);
|
|
18214
|
+
if (values.redeemBy) payload.redeemBy = values.redeemBy;
|
|
18215
|
+
const maxRedemptions = parseOptionalPositiveInt(values.maxRedemptions);
|
|
18216
|
+
if (maxRedemptions !== void 0) payload.maxRedemptions = maxRedemptions;
|
|
18217
|
+
return payload;
|
|
18218
|
+
}
|
|
18219
|
+
__name(toCouponInput, "toCouponInput");
|
|
18220
|
+
function couponPageModule() {
|
|
18221
|
+
return { ...Modules.StripeCoupon, pageUrl: STRIPE_COUPON_DETAIL_PAGE_URL };
|
|
18222
|
+
}
|
|
18223
|
+
__name(couponPageModule, "couponPageModule");
|
|
18224
|
+
function CouponRenameEditor({
|
|
18118
18225
|
coupon,
|
|
18119
18226
|
propagateChanges,
|
|
18120
18227
|
onSuccess,
|
|
@@ -18127,48 +18234,95 @@ function CouponEditorInternal({
|
|
|
18127
18234
|
const t = useTranslations73();
|
|
18128
18235
|
const fmt = useBillingFormatOptions();
|
|
18129
18236
|
const router = useI18nRouter();
|
|
18130
|
-
const {
|
|
18131
|
-
const
|
|
18132
|
-
const
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
|
|
18159
|
-
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18163
|
-
|
|
18164
|
-
|
|
18165
|
-
|
|
18166
|
-
|
|
18167
|
-
|
|
18168
|
-
|
|
18169
|
-
|
|
18237
|
+
const { renameCoupon } = useCouponContext();
|
|
18238
|
+
const formSchema = useMemo34(() => couponRenameSchema(t), [t]);
|
|
18239
|
+
const getDefaultValues = useCallback33(() => ({ id: coupon.id, name: coupon.name }), [coupon]);
|
|
18240
|
+
const form = useForm5({
|
|
18241
|
+
resolver: zodResolver5(formSchema),
|
|
18242
|
+
defaultValues: getDefaultValues()
|
|
18243
|
+
});
|
|
18244
|
+
return /* @__PURE__ */ jsx194(
|
|
18245
|
+
EditorSheet,
|
|
18246
|
+
{
|
|
18247
|
+
form,
|
|
18248
|
+
entityType: t("billing.admin.coupons.entity"),
|
|
18249
|
+
entityName: coupon.name,
|
|
18250
|
+
isEdit: true,
|
|
18251
|
+
module: couponPageModule(),
|
|
18252
|
+
size: "lg",
|
|
18253
|
+
propagateChanges,
|
|
18254
|
+
onSuccess,
|
|
18255
|
+
onNavigate: (url) => router.push(url),
|
|
18256
|
+
onSubmit: async (values) => await renameCoupon({ id: coupon.id, name: values.name }),
|
|
18257
|
+
onReset: getDefaultValues,
|
|
18258
|
+
trigger,
|
|
18259
|
+
forceShow,
|
|
18260
|
+
onClose,
|
|
18261
|
+
dialogOpen,
|
|
18262
|
+
onDialogOpenChange,
|
|
18263
|
+
children: /* @__PURE__ */ jsxs104("div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
18264
|
+
/* @__PURE__ */ jsx194(
|
|
18265
|
+
FormInput,
|
|
18266
|
+
{
|
|
18267
|
+
form,
|
|
18268
|
+
id: "name",
|
|
18269
|
+
name: t("billing.admin.coupons.fields.name"),
|
|
18270
|
+
placeholder: t("billing.admin.coupons.placeholders.name"),
|
|
18271
|
+
isRequired: true
|
|
18272
|
+
}
|
|
18273
|
+
),
|
|
18274
|
+
/* @__PURE__ */ jsxs104("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
18275
|
+
/* @__PURE__ */ jsx194(
|
|
18276
|
+
DetailField,
|
|
18277
|
+
{
|
|
18278
|
+
label: t("billing.admin.coupons.fields.discount"),
|
|
18279
|
+
value: /* @__PURE__ */ jsx194("span", { className: "tabular-nums", children: formatCouponDiscount(coupon, t, fmt) })
|
|
18280
|
+
}
|
|
18281
|
+
),
|
|
18282
|
+
/* @__PURE__ */ jsx194(
|
|
18283
|
+
DetailField,
|
|
18284
|
+
{
|
|
18285
|
+
label: t("billing.admin.coupons.fields.redeemBy"),
|
|
18286
|
+
value: /* @__PURE__ */ jsx194("span", { className: "tabular-nums", children: coupon.redeemBy ? formatDate2(coupon.redeemBy, fmt) : "\u2014" })
|
|
18287
|
+
}
|
|
18288
|
+
),
|
|
18289
|
+
/* @__PURE__ */ jsx194(
|
|
18290
|
+
DetailField,
|
|
18291
|
+
{
|
|
18292
|
+
label: t("billing.admin.coupons.fields.maxRedemptions"),
|
|
18293
|
+
value: /* @__PURE__ */ jsx194("span", { className: "tabular-nums", children: coupon.maxRedemptions ?? t("billing.admin.coupons.places.no_limit") })
|
|
18294
|
+
}
|
|
18295
|
+
),
|
|
18296
|
+
/* @__PURE__ */ jsx194(
|
|
18297
|
+
DetailField,
|
|
18298
|
+
{
|
|
18299
|
+
label: t("billing.admin.coupons.fields.stripeId"),
|
|
18300
|
+
value: /* @__PURE__ */ jsx194("span", { className: "tabular-nums", children: coupon.stripeCouponId })
|
|
18301
|
+
}
|
|
18302
|
+
)
|
|
18303
|
+
] }),
|
|
18304
|
+
/* @__PURE__ */ jsx194("p", { className: "text-muted-foreground text-xs/relaxed", children: t("billing.admin.coupons.fixed_notice") })
|
|
18305
|
+
] })
|
|
18306
|
+
}
|
|
18307
|
+
);
|
|
18308
|
+
}
|
|
18309
|
+
__name(CouponRenameEditor, "CouponRenameEditor");
|
|
18310
|
+
function CouponCreateEditor({
|
|
18311
|
+
propagateChanges,
|
|
18312
|
+
onSuccess,
|
|
18313
|
+
trigger,
|
|
18314
|
+
forceShow,
|
|
18315
|
+
onClose,
|
|
18316
|
+
dialogOpen,
|
|
18317
|
+
onDialogOpenChange
|
|
18318
|
+
}) {
|
|
18319
|
+
const t = useTranslations73();
|
|
18320
|
+
const router = useI18nRouter();
|
|
18321
|
+
const { createCoupon } = useCouponContext();
|
|
18322
|
+
const [now] = useState63(() => /* @__PURE__ */ new Date());
|
|
18323
|
+
const formSchema = useMemo34(() => couponCreateSchema(t), [t]);
|
|
18170
18324
|
const getDefaultValues = useCallback33(
|
|
18171
|
-
() =>
|
|
18325
|
+
() => ({
|
|
18172
18326
|
id: v45(),
|
|
18173
18327
|
name: "",
|
|
18174
18328
|
stripeCouponId: "",
|
|
@@ -18183,8 +18337,8 @@ function CouponEditorInternal({
|
|
|
18183
18337
|
redeemBy: void 0,
|
|
18184
18338
|
maxRedemptions: "",
|
|
18185
18339
|
firstCode: couponCodeDefaults()
|
|
18186
|
-
},
|
|
18187
|
-
[
|
|
18340
|
+
}),
|
|
18341
|
+
[]
|
|
18188
18342
|
);
|
|
18189
18343
|
const form = useForm5({
|
|
18190
18344
|
resolver: zodResolver5(formSchema),
|
|
@@ -18206,34 +18360,13 @@ function CouponEditorInternal({
|
|
|
18206
18360
|
{
|
|
18207
18361
|
form,
|
|
18208
18362
|
entityType: t("billing.admin.coupons.entity"),
|
|
18209
|
-
|
|
18210
|
-
|
|
18211
|
-
module: Modules.StripeCoupon,
|
|
18363
|
+
isEdit: false,
|
|
18364
|
+
module: couponPageModule(),
|
|
18212
18365
|
size: "lg",
|
|
18213
18366
|
propagateChanges,
|
|
18214
18367
|
onSuccess,
|
|
18215
18368
|
onNavigate: (url) => router.push(url),
|
|
18216
|
-
onSubmit: async (values) =>
|
|
18217
|
-
if (isEdit) return await renameCoupon({ id: coupon.id, name: values.name });
|
|
18218
|
-
const payload = {
|
|
18219
|
-
id: values.id,
|
|
18220
|
-
name: values.name,
|
|
18221
|
-
discountType: values.discountType,
|
|
18222
|
-
duration: values.duration,
|
|
18223
|
-
firstCode: toCouponCodeInput(values.firstCode)
|
|
18224
|
-
};
|
|
18225
|
-
if (values.stripeCouponId?.trim()) payload.stripeCouponId = values.stripeCouponId.trim();
|
|
18226
|
-
if (values.discountType === "percent_off") payload.percentOff = values.percentOff;
|
|
18227
|
-
else {
|
|
18228
|
-
payload.amountOff = Math.round(values.amountOff * 100);
|
|
18229
|
-
payload.currency = values.currency;
|
|
18230
|
-
}
|
|
18231
|
-
if (values.duration === "repeating") payload.durationInMonths = values.durationInMonths;
|
|
18232
|
-
if (values.products.length > 0) payload.productIds = values.products.map((p) => p.id);
|
|
18233
|
-
if (values.redeemBy) payload.redeemBy = values.redeemBy;
|
|
18234
|
-
if (values.maxRedemptions !== void 0) payload.maxRedemptions = values.maxRedemptions;
|
|
18235
|
-
return await createCoupon(payload);
|
|
18236
|
-
},
|
|
18369
|
+
onSubmit: async (values) => await createCoupon(toCouponInput(values)),
|
|
18237
18370
|
onReset: getDefaultValues,
|
|
18238
18371
|
trigger,
|
|
18239
18372
|
forceShow,
|
|
@@ -18251,152 +18384,118 @@ function CouponEditorInternal({
|
|
|
18251
18384
|
isRequired: true
|
|
18252
18385
|
}
|
|
18253
18386
|
),
|
|
18254
|
-
|
|
18255
|
-
|
|
18256
|
-
|
|
18257
|
-
|
|
18258
|
-
|
|
18259
|
-
|
|
18260
|
-
|
|
18261
|
-
|
|
18262
|
-
|
|
18263
|
-
|
|
18264
|
-
|
|
18265
|
-
|
|
18266
|
-
|
|
18267
|
-
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
-
|
|
18282
|
-
|
|
18283
|
-
)
|
|
18284
|
-
] }),
|
|
18285
|
-
/* @__PURE__ */ jsx194("p", { className: "text-muted-foreground text-xs/relaxed", children: t("billing.admin.coupons.fixed_notice") })
|
|
18286
|
-
] }) : /* @__PURE__ */ jsxs104(Fragment29, { children: [
|
|
18387
|
+
/* @__PURE__ */ jsx194(
|
|
18388
|
+
FormInput,
|
|
18389
|
+
{
|
|
18390
|
+
form,
|
|
18391
|
+
id: "stripeCouponId",
|
|
18392
|
+
name: t("billing.admin.coupons.fields.stripeCouponId"),
|
|
18393
|
+
placeholder: t("billing.admin.coupons.placeholders.stripeCouponId")
|
|
18394
|
+
}
|
|
18395
|
+
),
|
|
18396
|
+
/* @__PURE__ */ jsx194(
|
|
18397
|
+
FormSelect,
|
|
18398
|
+
{
|
|
18399
|
+
form,
|
|
18400
|
+
id: "discountType",
|
|
18401
|
+
name: t("billing.admin.coupons.fields.discountType"),
|
|
18402
|
+
values: discountTypeOptions
|
|
18403
|
+
}
|
|
18404
|
+
),
|
|
18405
|
+
watchDiscountType === "percent_off" ? /* @__PURE__ */ jsx194(
|
|
18406
|
+
FormInput,
|
|
18407
|
+
{
|
|
18408
|
+
form,
|
|
18409
|
+
id: "percentOff",
|
|
18410
|
+
type: "decimal",
|
|
18411
|
+
name: t("billing.admin.coupons.fields.percentOff"),
|
|
18412
|
+
placeholder: t("billing.admin.coupons.placeholders.percentOff"),
|
|
18413
|
+
isRequired: true
|
|
18414
|
+
}
|
|
18415
|
+
) : /* @__PURE__ */ jsxs104("div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
18287
18416
|
/* @__PURE__ */ jsx194(
|
|
18288
18417
|
FormInput,
|
|
18289
18418
|
{
|
|
18290
18419
|
form,
|
|
18291
|
-
id: "
|
|
18292
|
-
name: t("billing.admin.coupons.fields.stripeCouponId"),
|
|
18293
|
-
placeholder: t("billing.admin.coupons.placeholders.stripeCouponId")
|
|
18294
|
-
}
|
|
18295
|
-
),
|
|
18296
|
-
/* @__PURE__ */ jsx194(
|
|
18297
|
-
FormSelect,
|
|
18298
|
-
{
|
|
18299
|
-
form,
|
|
18300
|
-
id: "discountType",
|
|
18301
|
-
name: t("billing.admin.coupons.fields.discountType"),
|
|
18302
|
-
values: discountTypeOptions
|
|
18303
|
-
}
|
|
18304
|
-
),
|
|
18305
|
-
watchDiscountType === "percent_off" ? /* @__PURE__ */ jsx194(
|
|
18306
|
-
FormInput,
|
|
18307
|
-
{
|
|
18308
|
-
form,
|
|
18309
|
-
id: "percentOff",
|
|
18420
|
+
id: "amountOff",
|
|
18310
18421
|
type: "decimal",
|
|
18311
|
-
name: t("billing.admin.coupons.fields.
|
|
18312
|
-
placeholder: t("billing.admin.coupons.placeholders.
|
|
18422
|
+
name: t("billing.admin.coupons.fields.amountOff"),
|
|
18423
|
+
placeholder: t("billing.admin.coupons.placeholders.amountOff"),
|
|
18313
18424
|
isRequired: true
|
|
18314
18425
|
}
|
|
18315
|
-
)
|
|
18316
|
-
/* @__PURE__ */ jsx194(
|
|
18317
|
-
FormInput,
|
|
18318
|
-
{
|
|
18319
|
-
form,
|
|
18320
|
-
id: "amountOff",
|
|
18321
|
-
type: "decimal",
|
|
18322
|
-
name: t("billing.admin.coupons.fields.amountOff"),
|
|
18323
|
-
placeholder: t("billing.admin.coupons.placeholders.amountOff"),
|
|
18324
|
-
isRequired: true
|
|
18325
|
-
}
|
|
18326
|
-
),
|
|
18327
|
-
/* @__PURE__ */ jsx194(
|
|
18328
|
-
FormSelect,
|
|
18329
|
-
{
|
|
18330
|
-
form,
|
|
18331
|
-
id: "currency",
|
|
18332
|
-
name: t("billing.admin.coupons.fields.currency"),
|
|
18333
|
-
values: couponCurrencyOptions,
|
|
18334
|
-
isRequired: true
|
|
18335
|
-
}
|
|
18336
|
-
)
|
|
18337
|
-
] }),
|
|
18426
|
+
),
|
|
18338
18427
|
/* @__PURE__ */ jsx194(
|
|
18339
18428
|
FormSelect,
|
|
18340
18429
|
{
|
|
18341
18430
|
form,
|
|
18342
|
-
id: "
|
|
18343
|
-
name: t("billing.admin.coupons.fields.
|
|
18344
|
-
values:
|
|
18345
|
-
}
|
|
18346
|
-
),
|
|
18347
|
-
watchDuration === "repeating" && /* @__PURE__ */ jsx194(
|
|
18348
|
-
FormInput,
|
|
18349
|
-
{
|
|
18350
|
-
form,
|
|
18351
|
-
id: "durationInMonths",
|
|
18352
|
-
type: "number",
|
|
18353
|
-
name: t("billing.admin.coupons.fields.durationInMonths"),
|
|
18354
|
-
placeholder: t("billing.admin.coupons.placeholders.durationInMonths"),
|
|
18431
|
+
id: "currency",
|
|
18432
|
+
name: t("billing.admin.coupons.fields.currency"),
|
|
18433
|
+
values: couponCurrencyOptions,
|
|
18355
18434
|
isRequired: true
|
|
18356
18435
|
}
|
|
18357
|
-
)
|
|
18358
|
-
|
|
18359
|
-
|
|
18360
|
-
|
|
18361
|
-
|
|
18362
|
-
|
|
18363
|
-
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
|
|
18368
|
-
|
|
18369
|
-
|
|
18370
|
-
|
|
18371
|
-
|
|
18372
|
-
|
|
18373
|
-
|
|
18374
|
-
|
|
18375
|
-
|
|
18376
|
-
|
|
18377
|
-
|
|
18378
|
-
|
|
18379
|
-
|
|
18380
|
-
|
|
18381
|
-
|
|
18382
|
-
|
|
18383
|
-
|
|
18384
|
-
|
|
18385
|
-
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18392
|
-
|
|
18436
|
+
)
|
|
18437
|
+
] }),
|
|
18438
|
+
/* @__PURE__ */ jsx194(
|
|
18439
|
+
FormSelect,
|
|
18440
|
+
{
|
|
18441
|
+
form,
|
|
18442
|
+
id: "duration",
|
|
18443
|
+
name: t("billing.admin.coupons.fields.duration"),
|
|
18444
|
+
values: durationOptions
|
|
18445
|
+
}
|
|
18446
|
+
),
|
|
18447
|
+
watchDuration === "repeating" && /* @__PURE__ */ jsx194(
|
|
18448
|
+
FormInput,
|
|
18449
|
+
{
|
|
18450
|
+
form,
|
|
18451
|
+
id: "durationInMonths",
|
|
18452
|
+
type: "number",
|
|
18453
|
+
name: t("billing.admin.coupons.fields.durationInMonths"),
|
|
18454
|
+
placeholder: t("billing.admin.coupons.placeholders.durationInMonths"),
|
|
18455
|
+
isRequired: true
|
|
18456
|
+
}
|
|
18457
|
+
),
|
|
18458
|
+
/* @__PURE__ */ jsx194(
|
|
18459
|
+
EntityMultiSelector,
|
|
18460
|
+
{
|
|
18461
|
+
id: "products",
|
|
18462
|
+
form,
|
|
18463
|
+
label: t("billing.admin.coupons.fields.products"),
|
|
18464
|
+
description: t("billing.admin.coupons.help.products"),
|
|
18465
|
+
retriever: (params) => StripeProductService.listProducts(params),
|
|
18466
|
+
module: Modules.StripeProduct,
|
|
18467
|
+
getLabel: (product) => product.name
|
|
18468
|
+
}
|
|
18469
|
+
),
|
|
18470
|
+
/* @__PURE__ */ jsx194(
|
|
18471
|
+
FormDateTime,
|
|
18472
|
+
{
|
|
18473
|
+
form,
|
|
18474
|
+
id: "redeemBy",
|
|
18475
|
+
name: t("billing.admin.coupons.fields.redeemBy"),
|
|
18476
|
+
minDate: now,
|
|
18477
|
+
allowEmpty: true
|
|
18478
|
+
}
|
|
18479
|
+
),
|
|
18480
|
+
/* @__PURE__ */ jsx194(
|
|
18481
|
+
FormInput,
|
|
18482
|
+
{
|
|
18483
|
+
form,
|
|
18484
|
+
id: "maxRedemptions",
|
|
18485
|
+
type: "number",
|
|
18486
|
+
name: t("billing.admin.coupons.fields.maxRedemptions"),
|
|
18487
|
+
placeholder: t("billing.admin.coupons.placeholders.maxRedemptions")
|
|
18488
|
+
}
|
|
18489
|
+
),
|
|
18490
|
+
/* @__PURE__ */ jsx194(SectionHeader, { children: t("billing.admin.coupons.first_code") }),
|
|
18491
|
+
/* @__PURE__ */ jsx194(CouponCodeFields, { form, prefix: "firstCode." })
|
|
18393
18492
|
] })
|
|
18394
18493
|
}
|
|
18395
18494
|
);
|
|
18396
18495
|
}
|
|
18397
|
-
__name(
|
|
18496
|
+
__name(CouponCreateEditor, "CouponCreateEditor");
|
|
18398
18497
|
function CouponEditor(props) {
|
|
18399
|
-
return /* @__PURE__ */ jsx194(
|
|
18498
|
+
return props.coupon ? /* @__PURE__ */ jsx194(CouponRenameEditor, { ...props, coupon: props.coupon }) : /* @__PURE__ */ jsx194(CouponCreateEditor, { ...props });
|
|
18400
18499
|
}
|
|
18401
18500
|
__name(CouponEditor, "CouponEditor");
|
|
18402
18501
|
|
|
@@ -18431,10 +18530,10 @@ var CouponProvider = /* @__PURE__ */ __name(({ children, dehydratedCoupon, publi
|
|
|
18431
18530
|
const t = useTranslations74();
|
|
18432
18531
|
const generateUrl = usePageUrlGenerator();
|
|
18433
18532
|
const { hasRole } = useCurrentUserContext();
|
|
18434
|
-
const [coupon, setCoupon] =
|
|
18533
|
+
const [coupon, setCoupon] = useState64(
|
|
18435
18534
|
dehydratedCoupon ? rehydrate(Modules.StripeCoupon, dehydratedCoupon) : void 0
|
|
18436
18535
|
);
|
|
18437
|
-
const [catalogueVersion, setCatalogueVersion] =
|
|
18536
|
+
const [catalogueVersion, setCatalogueVersion] = useState64(0);
|
|
18438
18537
|
const refreshCatalogue = useCallback34(() => setCatalogueVersion((value2) => value2 + 1), []);
|
|
18439
18538
|
const reloadCoupon = useCallback34(async () => {
|
|
18440
18539
|
if (!coupon?.id) return;
|
|
@@ -18542,18 +18641,18 @@ var useCouponContext = /* @__PURE__ */ __name(() => useContext28(CouponContext)
|
|
|
18542
18641
|
// src/features/billing/stripe-coupon/components/widgets/CouponCodeActions.tsx
|
|
18543
18642
|
import { PowerIcon, RotateCcwIcon } from "lucide-react";
|
|
18544
18643
|
import { useTranslations as useTranslations75 } from "next-intl";
|
|
18545
|
-
import { useState as
|
|
18644
|
+
import { useState as useState65 } from "react";
|
|
18546
18645
|
import { jsx as jsx196, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
18547
18646
|
function CouponCodeActions({ code, status }) {
|
|
18548
18647
|
const t = useTranslations75();
|
|
18549
18648
|
const { updateCodeFlags } = useCouponContext();
|
|
18550
|
-
const [open, setOpen] =
|
|
18551
|
-
const [pending, setPending] =
|
|
18649
|
+
const [open, setOpen] = useState65(false);
|
|
18650
|
+
const [pending, setPending] = useState65(false);
|
|
18552
18651
|
const isDead = status === "expired" || status === "used_up";
|
|
18553
18652
|
const isInactive = !code.active;
|
|
18554
18653
|
const scope = isInactive ? "reactivate" : "deactivate";
|
|
18555
18654
|
return /* @__PURE__ */ jsxs105("div", { className: "flex items-center justify-end gap-x-4", children: [
|
|
18556
|
-
/* @__PURE__ */ jsxs105(
|
|
18655
|
+
/* @__PURE__ */ jsxs105(FieldLabel, { children: [
|
|
18557
18656
|
/* @__PURE__ */ jsx196(
|
|
18558
18657
|
Switch,
|
|
18559
18658
|
{
|
|
@@ -18603,8 +18702,8 @@ __name(CouponCodeActions, "CouponCodeActions");
|
|
|
18603
18702
|
|
|
18604
18703
|
// src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx
|
|
18605
18704
|
import { jsx as jsx197 } from "react/jsx-runtime";
|
|
18606
|
-
function couponCodeStatus(code, coupon) {
|
|
18607
|
-
if (code.expiresAt && code.expiresAt.getTime() <=
|
|
18705
|
+
function couponCodeStatus(code, coupon, now) {
|
|
18706
|
+
if (code.expiresAt && code.expiresAt.getTime() <= now.getTime()) return "expired";
|
|
18608
18707
|
const left = couponPlacesLeft(code, coupon ?? { maxRedemptions: void 0, timesRedeemed: 0 });
|
|
18609
18708
|
if (left === 0) return "used_up";
|
|
18610
18709
|
return code.active ? "active" : "inactive";
|
|
@@ -18620,6 +18719,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18620
18719
|
const t = useTranslations76();
|
|
18621
18720
|
const fmt = useBillingFormatOptions();
|
|
18622
18721
|
const { coupon } = useCouponContext();
|
|
18722
|
+
const [now] = useState66(() => /* @__PURE__ */ new Date());
|
|
18623
18723
|
const tableData = useMemo36(() => {
|
|
18624
18724
|
return params.data.map((code) => {
|
|
18625
18725
|
const entry = { jsonApiData: code };
|
|
@@ -18636,7 +18736,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18636
18736
|
header: t("billing.admin.coupons.fields.code"),
|
|
18637
18737
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
18638
18738
|
const code = row.original.jsonApiData;
|
|
18639
|
-
return /* @__PURE__ */ jsx197("span", { className: "text-xs
|
|
18739
|
+
return /* @__PURE__ */ jsx197("span", { className: "text-xs", children: code.code });
|
|
18640
18740
|
}, "cell"),
|
|
18641
18741
|
enableSorting: false,
|
|
18642
18742
|
enableHiding: false
|
|
@@ -18683,7 +18783,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18683
18783
|
header: t("billing.admin.coupons.fields.status"),
|
|
18684
18784
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
18685
18785
|
const code = row.original.jsonApiData;
|
|
18686
|
-
const status = couponCodeStatus(code, code.coupon ?? coupon);
|
|
18786
|
+
const status = couponCodeStatus(code, code.coupon ?? coupon, now);
|
|
18687
18787
|
return /* @__PURE__ */ jsx197(Badge, { variant: STATUS_VARIANT[status], children: t(`billing.admin.coupons.codes.status.${status}`) });
|
|
18688
18788
|
}, "cell"),
|
|
18689
18789
|
enableSorting: false,
|
|
@@ -18695,7 +18795,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18695
18795
|
header: "",
|
|
18696
18796
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
18697
18797
|
const code = row.original.jsonApiData;
|
|
18698
|
-
return /* @__PURE__ */ jsx197(CouponCodeActions, { code, status: couponCodeStatus(code, code.coupon ?? coupon) });
|
|
18798
|
+
return /* @__PURE__ */ jsx197(CouponCodeActions, { code, status: couponCodeStatus(code, code.coupon ?? coupon, now) });
|
|
18699
18799
|
}, "cell"),
|
|
18700
18800
|
enableSorting: false,
|
|
18701
18801
|
enableHiding: false
|
|
@@ -18703,7 +18803,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18703
18803
|
};
|
|
18704
18804
|
const columns = useMemo36(() => {
|
|
18705
18805
|
return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
|
|
18706
|
-
}, [params.fields, fieldColumnMap, t, coupon]);
|
|
18806
|
+
}, [params.fields, fieldColumnMap, t, coupon, now]);
|
|
18707
18807
|
return useMemo36(() => ({ data: tableData, columns }), [tableData, columns]);
|
|
18708
18808
|
}, "useStripeCouponCodeTableStructure");
|
|
18709
18809
|
registerTableGenerator("stripe-coupon-codes", useStripeCouponCodeTableStructure);
|
|
@@ -18849,7 +18949,7 @@ var useWaitlistTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18849
18949
|
// src/features/content/hooks/useContentTableStructure.tsx
|
|
18850
18950
|
import { useTranslations as useTranslations78 } from "next-intl";
|
|
18851
18951
|
import { useMemo as useMemo38 } from "react";
|
|
18852
|
-
import { Fragment as
|
|
18952
|
+
import { Fragment as Fragment29, jsx as jsx199, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
18853
18953
|
var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
18854
18954
|
const t = useTranslations78();
|
|
18855
18955
|
const generateUrl = usePageUrlGenerator();
|
|
@@ -18880,7 +18980,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18880
18980
|
const contentModule = content.contentType ? Modules.findByModelName(content.contentType) : void 0;
|
|
18881
18981
|
const link = contentModule ? generateUrl({ page: contentModule, id: content.id }) : "#";
|
|
18882
18982
|
return /* @__PURE__ */ jsxs107(Tooltip2, { children: [
|
|
18883
|
-
/* @__PURE__ */ jsx199(TooltipTrigger, { className: "flex items-center justify-start space-x-2", children: /* @__PURE__ */ jsxs107(
|
|
18983
|
+
/* @__PURE__ */ jsx199(TooltipTrigger, { className: "flex items-center justify-start space-x-2", children: /* @__PURE__ */ jsxs107(Fragment29, { children: [
|
|
18884
18984
|
contentModule && getIconByModule({ module: contentModule, className: "h-4 w-4" }),
|
|
18885
18985
|
/* @__PURE__ */ jsx199(Link, { href: link, children: content.name })
|
|
18886
18986
|
] }) }),
|
|
@@ -18896,7 +18996,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18896
18996
|
header: t(`common.relevance`),
|
|
18897
18997
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
18898
18998
|
const content = row.original.jsonApiData;
|
|
18899
|
-
if (!content.relevance) return /* @__PURE__ */ jsx199(
|
|
18999
|
+
if (!content.relevance) return /* @__PURE__ */ jsx199(Fragment29, {});
|
|
18900
19000
|
const response = `${content.relevance.toFixed(0)}%`;
|
|
18901
19001
|
return /* @__PURE__ */ jsxs107("div", { className: "relative flex h-5 w-20 items-center justify-center overflow-clip rounded border text-center", children: [
|
|
18902
19002
|
/* @__PURE__ */ jsx199(
|
|
@@ -19072,7 +19172,7 @@ __name(useOAuthClients, "useOAuthClients");
|
|
|
19072
19172
|
// src/features/oauth/hooks/useOAuthClient.ts
|
|
19073
19173
|
import { useTranslations as useTranslations80 } from "next-intl";
|
|
19074
19174
|
import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
|
|
19075
|
-
import { useCallback as useCallback36, useEffect as useEffect52, useRef as useRef34, useState as
|
|
19175
|
+
import { useCallback as useCallback36, useEffect as useEffect52, useRef as useRef34, useState as useState67 } from "react";
|
|
19076
19176
|
function useOAuthClient(clientId) {
|
|
19077
19177
|
const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
|
|
19078
19178
|
const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
|
|
@@ -19081,9 +19181,9 @@ function useOAuthClient(clientId) {
|
|
|
19081
19181
|
const t = useTranslations80();
|
|
19082
19182
|
const tRef = useRef34(t);
|
|
19083
19183
|
tRef.current = t;
|
|
19084
|
-
const [fetchedClient, setFetchedClient] =
|
|
19085
|
-
const [isLoading, setIsLoading] =
|
|
19086
|
-
const [error, setError] =
|
|
19184
|
+
const [fetchedClient, setFetchedClient] = useState67(null);
|
|
19185
|
+
const [isLoading, setIsLoading] = useState67(false);
|
|
19186
|
+
const [error, setError] = useState67(null);
|
|
19087
19187
|
const client = storedClient || fetchedClient;
|
|
19088
19188
|
const fetchClient = useCallback36(async () => {
|
|
19089
19189
|
if (!clientId) return;
|
|
@@ -19174,13 +19274,13 @@ __name(useOAuthClient, "useOAuthClient");
|
|
|
19174
19274
|
|
|
19175
19275
|
// src/features/oauth/hooks/useOAuthConsent.ts
|
|
19176
19276
|
import { useTranslations as useTranslations81 } from "next-intl";
|
|
19177
|
-
import { useCallback as useCallback37, useEffect as useEffect53, useRef as useRef35, useState as
|
|
19277
|
+
import { useCallback as useCallback37, useEffect as useEffect53, useRef as useRef35, useState as useState68 } from "react";
|
|
19178
19278
|
function useOAuthConsent(params, options) {
|
|
19179
|
-
const [clientInfo, setClientInfo] =
|
|
19180
|
-
const [isLoading, setIsLoading] =
|
|
19181
|
-
const [error, setError] =
|
|
19182
|
-
const [isSubmitting, setIsSubmitting] =
|
|
19183
|
-
const [companyId, setCompanyId] =
|
|
19279
|
+
const [clientInfo, setClientInfo] = useState68(null);
|
|
19280
|
+
const [isLoading, setIsLoading] = useState68(true);
|
|
19281
|
+
const [error, setError] = useState68(null);
|
|
19282
|
+
const [isSubmitting, setIsSubmitting] = useState68(false);
|
|
19283
|
+
const [companyId, setCompanyId] = useState68(void 0);
|
|
19184
19284
|
const contextCompanyId = useCurrentUserContextOptional()?.company?.id;
|
|
19185
19285
|
const currentCompanyId = options?.defaultCompanyId ?? contextCompanyId;
|
|
19186
19286
|
const t = useTranslations81();
|
|
@@ -19298,20 +19398,20 @@ registerTableGenerator("waitlists", useWaitlistTableStructure);
|
|
|
19298
19398
|
import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
|
|
19299
19399
|
import { ChevronLeft, ChevronRight, Loader2 as Loader23 } from "lucide-react";
|
|
19300
19400
|
import { useTranslations as useTranslations84 } from "next-intl";
|
|
19301
|
-
import React31, { memo, useMemo as useMemo39, useState as
|
|
19401
|
+
import React31, { memo, useMemo as useMemo39, useState as useState70 } from "react";
|
|
19302
19402
|
|
|
19303
19403
|
// src/components/tables/ContentTableSearch.tsx
|
|
19304
19404
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
19305
19405
|
import { useTranslations as useTranslations83 } from "next-intl";
|
|
19306
|
-
import { useCallback as useCallback39, useEffect as useEffect54, useRef as useRef36, useState as
|
|
19406
|
+
import { useCallback as useCallback39, useEffect as useEffect54, useRef as useRef36, useState as useState69 } from "react";
|
|
19307
19407
|
import { jsx as jsx200, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
19308
19408
|
function ContentTableSearch({ data }) {
|
|
19309
19409
|
const t = useTranslations83();
|
|
19310
19410
|
const searchTermRef = useRef36("");
|
|
19311
19411
|
const inputRef = useRef36(null);
|
|
19312
|
-
const [searchTerm, setSearchTerm] =
|
|
19313
|
-
const [isFocused, setIsFocused] =
|
|
19314
|
-
const [isSearching, setIsSearching] =
|
|
19412
|
+
const [searchTerm, setSearchTerm] = useState69("");
|
|
19413
|
+
const [isFocused, setIsFocused] = useState69(false);
|
|
19414
|
+
const [isSearching, setIsSearching] = useState69(false);
|
|
19315
19415
|
const isExpanded = isFocused || searchTerm.length > 0;
|
|
19316
19416
|
const search = useCallback39(
|
|
19317
19417
|
async (searchedTerm) => {
|
|
@@ -19406,7 +19506,7 @@ function ContentTableSearch({ data }) {
|
|
|
19406
19506
|
__name(ContentTableSearch, "ContentTableSearch");
|
|
19407
19507
|
|
|
19408
19508
|
// src/components/tables/ContentListTable.tsx
|
|
19409
|
-
import { Fragment as
|
|
19509
|
+
import { Fragment as Fragment30, jsx as jsx201, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
19410
19510
|
var EMPTY_ARRAY = [];
|
|
19411
19511
|
function getGroupKeys(item, field) {
|
|
19412
19512
|
const value = item.jsonApiData[field];
|
|
@@ -19421,7 +19521,7 @@ function getGroupKeys(item, field) {
|
|
|
19421
19521
|
__name(getGroupKeys, "getGroupKeys");
|
|
19422
19522
|
var isClassComponent = /* @__PURE__ */ __name((component) => typeof component === "function" && !!component.prototype?.isReactComponent, "isClassComponent");
|
|
19423
19523
|
function StableCell({ render, context }) {
|
|
19424
|
-
return /* @__PURE__ */ jsx201(
|
|
19524
|
+
return /* @__PURE__ */ jsx201(Fragment30, { children: render(context) });
|
|
19425
19525
|
}
|
|
19426
19526
|
__name(StableCell, "StableCell");
|
|
19427
19527
|
function renderCell(cellDef, context) {
|
|
@@ -19435,10 +19535,10 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
19435
19535
|
const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters, fullWidth, onRowClick } = props;
|
|
19436
19536
|
const t = useTranslations84();
|
|
19437
19537
|
const isMobile = useIsMobile();
|
|
19438
|
-
const [expanded, setExpanded] =
|
|
19538
|
+
const [expanded, setExpanded] = useState70(
|
|
19439
19539
|
props.defaultExpanded === true ? true : typeof props.defaultExpanded === "object" ? props.defaultExpanded : {}
|
|
19440
19540
|
);
|
|
19441
|
-
const [pendingDirection, setPendingDirection] =
|
|
19541
|
+
const [pendingDirection, setPendingDirection] = useState70(null);
|
|
19442
19542
|
React31.useEffect(() => {
|
|
19443
19543
|
if (data.isLoaded) setPendingDirection(null);
|
|
19444
19544
|
}, [data.isLoaded]);
|
|
@@ -19537,7 +19637,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
19537
19637
|
}
|
|
19538
19638
|
);
|
|
19539
19639
|
const hasTitleControls = !!(props.functions || props.filters || allowSearch);
|
|
19540
|
-
const titleControls = /* @__PURE__ */ jsxs109(
|
|
19640
|
+
const titleControls = /* @__PURE__ */ jsxs109(Fragment30, { children: [
|
|
19541
19641
|
props.filters,
|
|
19542
19642
|
props.functions,
|
|
19543
19643
|
allowSearch !== false && /* @__PURE__ */ jsx201(ContentTableSearch, { data })
|
|
@@ -19639,7 +19739,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
19639
19739
|
|
|
19640
19740
|
// src/components/grids/ContentListGrid.tsx
|
|
19641
19741
|
import { useEffect as useEffect55, useRef as useRef37 } from "react";
|
|
19642
|
-
import { Fragment as
|
|
19742
|
+
import { Fragment as Fragment31, jsx as jsx202, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
19643
19743
|
var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
|
|
19644
19744
|
function ContentListGrid(props) {
|
|
19645
19745
|
const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
|
|
@@ -19670,7 +19770,7 @@ function ContentListGrid(props) {
|
|
|
19670
19770
|
]
|
|
19671
19771
|
}
|
|
19672
19772
|
) }),
|
|
19673
|
-
(props.functions || props.filters || allowSearch) && /* @__PURE__ */ jsxs110(
|
|
19773
|
+
(props.functions || props.filters || allowSearch) && /* @__PURE__ */ jsxs110(Fragment31, { children: [
|
|
19674
19774
|
props.functions,
|
|
19675
19775
|
props.filters,
|
|
19676
19776
|
allowSearch && /* @__PURE__ */ jsx202(ContentTableSearch, { data })
|
|
@@ -19687,15 +19787,15 @@ __name(ContentListGrid, "ContentListGrid");
|
|
|
19687
19787
|
|
|
19688
19788
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
19689
19789
|
import { useTranslations as useTranslations85 } from "next-intl";
|
|
19690
|
-
import { forwardRef as forwardRef8, useCallback as useCallback40, useImperativeHandle as useImperativeHandle2, useRef as useRef38, useState as
|
|
19790
|
+
import { forwardRef as forwardRef8, useCallback as useCallback40, useImperativeHandle as useImperativeHandle2, useRef as useRef38, useState as useState71 } from "react";
|
|
19691
19791
|
import { z as z6 } from "zod";
|
|
19692
19792
|
import { jsx as jsx203, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
19693
19793
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
19694
19794
|
const t = useTranslations85();
|
|
19695
19795
|
const initialRef = useRef38(initialData);
|
|
19696
|
-
const [fiscalData, setFiscalData] =
|
|
19796
|
+
const [fiscalData, setFiscalData] = useState71(initialData);
|
|
19697
19797
|
const fiscalDataRef = useRef38(initialData);
|
|
19698
|
-
const [fiscalErrors, setFiscalErrors] =
|
|
19798
|
+
const [fiscalErrors, setFiscalErrors] = useState71({});
|
|
19699
19799
|
const updateFiscalField = useCallback40((key, value) => {
|
|
19700
19800
|
setFiscalData((prev) => {
|
|
19701
19801
|
const next = { ...prev, [key]: value };
|
|
@@ -19888,7 +19988,7 @@ __name(EntitySection, "EntitySection");
|
|
|
19888
19988
|
import Image8 from "next/image";
|
|
19889
19989
|
|
|
19890
19990
|
// src/features/auth/contexts/AuthContext.tsx
|
|
19891
|
-
import { createContext as createContext29, useContext as useContext29, useMemo as useMemo40, useState as
|
|
19991
|
+
import { createContext as createContext29, useContext as useContext29, useMemo as useMemo40, useState as useState73 } from "react";
|
|
19892
19992
|
|
|
19893
19993
|
// src/features/auth/components/forms/Register.tsx
|
|
19894
19994
|
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
@@ -19896,21 +19996,21 @@ import { Loader2 as Loader24 } from "lucide-react";
|
|
|
19896
19996
|
import { useTranslations as useTranslations87 } from "next-intl";
|
|
19897
19997
|
import Image7 from "next/image";
|
|
19898
19998
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
19899
|
-
import { useEffect as useEffect56, useState as
|
|
19999
|
+
import { useEffect as useEffect56, useState as useState72 } from "react";
|
|
19900
20000
|
import { useForm as useForm6 } from "react-hook-form";
|
|
19901
20001
|
import { v4 as v46 } from "uuid";
|
|
19902
20002
|
import { z as z7 } from "zod";
|
|
19903
20003
|
|
|
19904
20004
|
// src/features/auth/components/GdprConsentSection.tsx
|
|
19905
20005
|
import { useTranslations as useTranslations86 } from "next-intl";
|
|
19906
|
-
import { Fragment as
|
|
20006
|
+
import { Fragment as Fragment32, jsx as jsx209, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
19907
20007
|
function GdprConsentSection({
|
|
19908
20008
|
form,
|
|
19909
20009
|
termsCheckboxId = "termsAccepted",
|
|
19910
20010
|
marketingCheckboxId = "marketingConsent"
|
|
19911
20011
|
}) {
|
|
19912
20012
|
const t = useTranslations86("auth.gdpr");
|
|
19913
|
-
const termsLabel = /* @__PURE__ */ jsxs115(
|
|
20013
|
+
const termsLabel = /* @__PURE__ */ jsxs115(Fragment32, { children: [
|
|
19914
20014
|
t("terms_prefix"),
|
|
19915
20015
|
" ",
|
|
19916
20016
|
/* @__PURE__ */ jsx209(Link, { href: "/terms", target: "_blank", rel: "noopener", children: t("terms_of_service") }),
|
|
@@ -19935,7 +20035,7 @@ function GdprConsentSection({
|
|
|
19935
20035
|
__name(GdprConsentSection, "GdprConsentSection");
|
|
19936
20036
|
|
|
19937
20037
|
// src/features/auth/components/forms/Register.tsx
|
|
19938
|
-
import { Fragment as
|
|
20038
|
+
import { Fragment as Fragment33, jsx as jsx210, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
19939
20039
|
var REFERRAL_COOKIE_NAME = "referral_code";
|
|
19940
20040
|
function getReferralCode() {
|
|
19941
20041
|
if (typeof document === "undefined") return null;
|
|
@@ -19968,14 +20068,14 @@ function Register() {
|
|
|
19968
20068
|
const searchParams = useSearchParams2();
|
|
19969
20069
|
const inviteCode = searchParams.get("invite");
|
|
19970
20070
|
const registrationMode = getRegistrationMode();
|
|
19971
|
-
const [showConfirmation, setShowConfirmation] =
|
|
19972
|
-
const [inviteValidated, setInviteValidated] =
|
|
19973
|
-
const [inviteError, setInviteError] =
|
|
19974
|
-
const [isValidatingInvite, setIsValidatingInvite] =
|
|
20071
|
+
const [showConfirmation, setShowConfirmation] = useState72(false);
|
|
20072
|
+
const [inviteValidated, setInviteValidated] = useState72(false);
|
|
20073
|
+
const [inviteError, setInviteError] = useState72("");
|
|
20074
|
+
const [isValidatingInvite, setIsValidatingInvite] = useState72(
|
|
19975
20075
|
registrationMode === "waitlist" && !!inviteCode
|
|
19976
20076
|
);
|
|
19977
|
-
const [referralCode, setReferralCode2] =
|
|
19978
|
-
const [signupSource, setSignupSource] =
|
|
20077
|
+
const [referralCode, setReferralCode2] = useState72(null);
|
|
20078
|
+
const [signupSource, setSignupSource] = useState72(void 0);
|
|
19979
20079
|
useEffect56(() => {
|
|
19980
20080
|
const code = getReferralCode();
|
|
19981
20081
|
setReferralCode2(code);
|
|
@@ -20057,7 +20157,7 @@ function Register() {
|
|
|
20057
20157
|
}
|
|
20058
20158
|
}, "onSubmit");
|
|
20059
20159
|
if (registrationMode === "waitlist" && inviteCode && isValidatingInvite) {
|
|
20060
|
-
return /* @__PURE__ */ jsxs116(
|
|
20160
|
+
return /* @__PURE__ */ jsxs116(Fragment33, { children: [
|
|
20061
20161
|
/* @__PURE__ */ jsx210(CardHeader, { children: /* @__PURE__ */ jsxs116(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
20062
20162
|
/* @__PURE__ */ jsx210(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
20063
20163
|
t("waitlist.invite.validating_title")
|
|
@@ -20069,7 +20169,7 @@ function Register() {
|
|
|
20069
20169
|
] });
|
|
20070
20170
|
}
|
|
20071
20171
|
if (registrationMode === "waitlist" && inviteCode && inviteError) {
|
|
20072
|
-
return /* @__PURE__ */ jsxs116(
|
|
20172
|
+
return /* @__PURE__ */ jsxs116(Fragment33, { children: [
|
|
20073
20173
|
/* @__PURE__ */ jsx210(CardHeader, { children: /* @__PURE__ */ jsxs116(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
20074
20174
|
/* @__PURE__ */ jsx210(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
20075
20175
|
t("waitlist.invite.invalid_title")
|
|
@@ -20082,7 +20182,7 @@ function Register() {
|
|
|
20082
20182
|
] });
|
|
20083
20183
|
}
|
|
20084
20184
|
if (registrationMode === "waitlist" && !inviteCode) {
|
|
20085
|
-
return /* @__PURE__ */ jsxs116(
|
|
20185
|
+
return /* @__PURE__ */ jsxs116(Fragment33, { children: [
|
|
20086
20186
|
/* @__PURE__ */ jsx210(CardHeader, { children: /* @__PURE__ */ jsxs116(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
20087
20187
|
/* @__PURE__ */ jsx210(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
20088
20188
|
t("waitlist.invite.registration_title")
|
|
@@ -20095,13 +20195,13 @@ function Register() {
|
|
|
20095
20195
|
/* @__PURE__ */ jsx210(CardFooter, { className: "flex w-full flex-row justify-between", children: /* @__PURE__ */ jsx210(Link, { href: "#", className: "flex w-full justify-start", onClick: () => setComponentType(0 /* Login */), children: t("auth.buttons.login") }) })
|
|
20096
20196
|
] });
|
|
20097
20197
|
}
|
|
20098
|
-
return /* @__PURE__ */ jsxs116(
|
|
20198
|
+
return /* @__PURE__ */ jsxs116(Fragment33, { children: [
|
|
20099
20199
|
/* @__PURE__ */ jsxs116(CardHeader, { children: [
|
|
20100
20200
|
/* @__PURE__ */ jsxs116(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
20101
20201
|
/* @__PURE__ */ jsx210(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
20102
20202
|
t(`auth.buttons.register`)
|
|
20103
20203
|
] }),
|
|
20104
|
-
/* @__PURE__ */ jsx210(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx210(
|
|
20204
|
+
/* @__PURE__ */ jsx210(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx210(Fragment33, { children: " " }) : /* @__PURE__ */ jsx210(Fragment33, { children: t(`auth.register_description`) }) })
|
|
20105
20205
|
] }),
|
|
20106
20206
|
showConfirmation ? /* @__PURE__ */ jsx210(CardContent, { children: /* @__PURE__ */ jsx210(CardDescription, { className: "text-center text-xl", children: t("auth.register_confirmation") }) }) : /* @__PURE__ */ jsx210(Form, { ...form, children: /* @__PURE__ */ jsxs116("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
20107
20207
|
/* @__PURE__ */ jsxs116(CardContent, { children: [
|
|
@@ -20250,9 +20350,9 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
|
|
|
20250
20350
|
initialComponentType,
|
|
20251
20351
|
initialParams
|
|
20252
20352
|
}) => {
|
|
20253
|
-
const [componentType, setComponentType] =
|
|
20254
|
-
const [params, setParams] =
|
|
20255
|
-
const [pendingTwoFactor, setPendingTwoFactor] =
|
|
20353
|
+
const [componentType, setComponentType] = useState73(initialComponentType);
|
|
20354
|
+
const [params, setParams] = useState73(initialParams);
|
|
20355
|
+
const [pendingTwoFactor, setPendingTwoFactor] = useState73();
|
|
20256
20356
|
const activeComponent = useMemo40(() => {
|
|
20257
20357
|
if (componentType === void 0) return null;
|
|
20258
20358
|
switch (componentType) {
|
|
@@ -20314,20 +20414,20 @@ __name(InnerAuthContainer, "InnerAuthContainer");
|
|
|
20314
20414
|
// src/features/auth/components/two-factor/TwoFactorSettings.tsx
|
|
20315
20415
|
import { ShieldAlert, ShieldCheck } from "lucide-react";
|
|
20316
20416
|
import { useTranslations as useTranslations94 } from "next-intl";
|
|
20317
|
-
import { useCallback as useCallback41, useEffect as useEffect58, useState as
|
|
20417
|
+
import { useCallback as useCallback41, useEffect as useEffect58, useState as useState81 } from "react";
|
|
20318
20418
|
import { v4 as v49 } from "uuid";
|
|
20319
20419
|
|
|
20320
20420
|
// src/features/auth/components/two-factor/BackupCodesDialog.tsx
|
|
20321
20421
|
import { Copy, Download, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
20322
20422
|
import { useTranslations as useTranslations88 } from "next-intl";
|
|
20323
|
-
import { useState as
|
|
20423
|
+
import { useState as useState74 } from "react";
|
|
20324
20424
|
import { jsx as jsx213, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
20325
20425
|
function BackupCodesDialog({ remainingCodes, onRegenerate, trigger }) {
|
|
20326
20426
|
const t = useTranslations88();
|
|
20327
|
-
const [open, setOpen] =
|
|
20328
|
-
const [codes, setCodes] =
|
|
20329
|
-
const [isLoading, setIsLoading] =
|
|
20330
|
-
const [showCodes, setShowCodes] =
|
|
20427
|
+
const [open, setOpen] = useState74(false);
|
|
20428
|
+
const [codes, setCodes] = useState74([]);
|
|
20429
|
+
const [isLoading, setIsLoading] = useState74(false);
|
|
20430
|
+
const [showCodes, setShowCodes] = useState74(false);
|
|
20331
20431
|
const handleGenerate = /* @__PURE__ */ __name(async () => {
|
|
20332
20432
|
setIsLoading(true);
|
|
20333
20433
|
try {
|
|
@@ -20422,13 +20522,13 @@ __name(BackupCodesDialog, "BackupCodesDialog");
|
|
|
20422
20522
|
|
|
20423
20523
|
// src/features/auth/components/two-factor/DisableTwoFactorDialog.tsx
|
|
20424
20524
|
import { useTranslations as useTranslations89 } from "next-intl";
|
|
20425
|
-
import { useState as
|
|
20525
|
+
import { useState as useState76 } from "react";
|
|
20426
20526
|
|
|
20427
20527
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
20428
|
-
import { useEffect as useEffect57, useRef as useRef39, useState as
|
|
20528
|
+
import { useEffect as useEffect57, useRef as useRef39, useState as useState75 } from "react";
|
|
20429
20529
|
import { jsx as jsx214, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
20430
20530
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
20431
|
-
const [digits, setDigits] =
|
|
20531
|
+
const [digits, setDigits] = useState75(["", "", "", "", "", ""]);
|
|
20432
20532
|
const inputRefs = useRef39([]);
|
|
20433
20533
|
useEffect57(() => {
|
|
20434
20534
|
if (autoFocus && inputRefs.current[0]) {
|
|
@@ -20492,9 +20592,9 @@ __name(TotpInput, "TotpInput");
|
|
|
20492
20592
|
import { jsx as jsx215, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
20493
20593
|
function DisableTwoFactorDialog({ onSuccess, trigger }) {
|
|
20494
20594
|
const t = useTranslations89();
|
|
20495
|
-
const [open, setOpen] =
|
|
20496
|
-
const [isLoading, setIsLoading] =
|
|
20497
|
-
const [error, setError] =
|
|
20595
|
+
const [open, setOpen] = useState76(false);
|
|
20596
|
+
const [isLoading, setIsLoading] = useState76(false);
|
|
20597
|
+
const [error, setError] = useState76();
|
|
20498
20598
|
const handleVerify = /* @__PURE__ */ __name(async (code) => {
|
|
20499
20599
|
setIsLoading(true);
|
|
20500
20600
|
setError(void 0);
|
|
@@ -20535,15 +20635,15 @@ __name(DisableTwoFactorDialog, "DisableTwoFactorDialog");
|
|
|
20535
20635
|
// src/features/auth/components/two-factor/PasskeyList.tsx
|
|
20536
20636
|
import { Edit, Key, Trash2 } from "lucide-react";
|
|
20537
20637
|
import { useTranslations as useTranslations90 } from "next-intl";
|
|
20538
|
-
import { useState as
|
|
20539
|
-
import { Fragment as
|
|
20638
|
+
import { useState as useState77 } from "react";
|
|
20639
|
+
import { Fragment as Fragment34, jsx as jsx216, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
20540
20640
|
function PasskeyList({ passkeys, onRefresh }) {
|
|
20541
20641
|
const t = useTranslations90();
|
|
20542
20642
|
const locale = useI18nLocale();
|
|
20543
|
-
const [renameDialogOpen, setRenameDialogOpen] =
|
|
20544
|
-
const [selectedPasskey, setSelectedPasskey] =
|
|
20545
|
-
const [newName, setNewName] =
|
|
20546
|
-
const [isLoading, setIsLoading] =
|
|
20643
|
+
const [renameDialogOpen, setRenameDialogOpen] = useState77(false);
|
|
20644
|
+
const [selectedPasskey, setSelectedPasskey] = useState77(null);
|
|
20645
|
+
const [newName, setNewName] = useState77("");
|
|
20646
|
+
const [isLoading, setIsLoading] = useState77(false);
|
|
20547
20647
|
const handleDelete = /* @__PURE__ */ __name(async (passkey) => {
|
|
20548
20648
|
setIsLoading(true);
|
|
20549
20649
|
try {
|
|
@@ -20593,7 +20693,7 @@ function PasskeyList({ passkeys, onRefresh }) {
|
|
|
20593
20693
|
if (passkeys.length === 0) {
|
|
20594
20694
|
return /* @__PURE__ */ jsx216("p", { className: "text-sm text-muted-foreground text-center py-4", children: t("auth.two_factor.no_passkeys") });
|
|
20595
20695
|
}
|
|
20596
|
-
return /* @__PURE__ */ jsxs120(
|
|
20696
|
+
return /* @__PURE__ */ jsxs120(Fragment34, { children: [
|
|
20597
20697
|
/* @__PURE__ */ jsx216("div", { className: "space-y-2", children: passkeys.map((passkey) => /* @__PURE__ */ jsxs120("div", { className: "flex items-center justify-between p-3 border rounded-lg", children: [
|
|
20598
20698
|
/* @__PURE__ */ jsxs120("div", { className: "flex items-center gap-3", children: [
|
|
20599
20699
|
/* @__PURE__ */ jsx216(Key, { className: "h-5 w-5 text-muted-foreground" }),
|
|
@@ -20657,14 +20757,14 @@ __name(PasskeyList, "PasskeyList");
|
|
|
20657
20757
|
// src/features/auth/components/two-factor/PasskeySetupDialog.tsx
|
|
20658
20758
|
import { startRegistration } from "@simplewebauthn/browser";
|
|
20659
20759
|
import { useTranslations as useTranslations91 } from "next-intl";
|
|
20660
|
-
import { useState as
|
|
20760
|
+
import { useState as useState78 } from "react";
|
|
20661
20761
|
import { v4 as v47 } from "uuid";
|
|
20662
20762
|
import { jsx as jsx217, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
20663
20763
|
function PasskeySetupDialog({ open, onOpenChange, onSuccess }) {
|
|
20664
20764
|
const t = useTranslations91();
|
|
20665
20765
|
const { currentUser } = useCurrentUserContext();
|
|
20666
|
-
const [name, setName] =
|
|
20667
|
-
const [isLoading, setIsLoading] =
|
|
20766
|
+
const [name, setName] = useState78("");
|
|
20767
|
+
const [isLoading, setIsLoading] = useState78(false);
|
|
20668
20768
|
const handleRegister = /* @__PURE__ */ __name(async () => {
|
|
20669
20769
|
if (!name.trim()) return;
|
|
20670
20770
|
setIsLoading(true);
|
|
@@ -20728,12 +20828,12 @@ __name(PasskeySetupDialog, "PasskeySetupDialog");
|
|
|
20728
20828
|
// src/features/auth/components/two-factor/TotpAuthenticatorList.tsx
|
|
20729
20829
|
import { Smartphone, Trash2 as Trash22 } from "lucide-react";
|
|
20730
20830
|
import { useTranslations as useTranslations92 } from "next-intl";
|
|
20731
|
-
import { useState as
|
|
20831
|
+
import { useState as useState79 } from "react";
|
|
20732
20832
|
import { jsx as jsx218, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
20733
20833
|
function TotpAuthenticatorList({ authenticators, onDelete }) {
|
|
20734
20834
|
const t = useTranslations92();
|
|
20735
20835
|
const locale = useI18nLocale();
|
|
20736
|
-
const [deletingId, setDeletingId] =
|
|
20836
|
+
const [deletingId, setDeletingId] = useState79(null);
|
|
20737
20837
|
const handleDelete = /* @__PURE__ */ __name(async (id) => {
|
|
20738
20838
|
setDeletingId(id);
|
|
20739
20839
|
try {
|
|
@@ -20804,19 +20904,19 @@ __name(TotpAuthenticatorList, "TotpAuthenticatorList");
|
|
|
20804
20904
|
// src/features/auth/components/two-factor/TotpSetupDialog.tsx
|
|
20805
20905
|
import { useTranslations as useTranslations93 } from "next-intl";
|
|
20806
20906
|
import { QRCodeSVG } from "qrcode.react";
|
|
20807
|
-
import { useState as
|
|
20907
|
+
import { useState as useState80 } from "react";
|
|
20808
20908
|
import { v4 as v48 } from "uuid";
|
|
20809
20909
|
import { jsx as jsx219, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
20810
20910
|
function TotpSetupDialog({ onSuccess, trigger }) {
|
|
20811
20911
|
const t = useTranslations93();
|
|
20812
20912
|
const { currentUser } = useCurrentUserContext();
|
|
20813
|
-
const [open, setOpen] =
|
|
20814
|
-
const [step, setStep] =
|
|
20815
|
-
const [name, setName] =
|
|
20816
|
-
const [qrCodeUri, setQrCodeUri] =
|
|
20817
|
-
const [authenticatorId, setAuthenticatorId] =
|
|
20818
|
-
const [isLoading, setIsLoading] =
|
|
20819
|
-
const [verifyError, setVerifyError] =
|
|
20913
|
+
const [open, setOpen] = useState80(false);
|
|
20914
|
+
const [step, setStep] = useState80("name");
|
|
20915
|
+
const [name, setName] = useState80("");
|
|
20916
|
+
const [qrCodeUri, setQrCodeUri] = useState80("");
|
|
20917
|
+
const [authenticatorId, setAuthenticatorId] = useState80("");
|
|
20918
|
+
const [isLoading, setIsLoading] = useState80(false);
|
|
20919
|
+
const [verifyError, setVerifyError] = useState80();
|
|
20820
20920
|
const handleStartSetup = /* @__PURE__ */ __name(async () => {
|
|
20821
20921
|
if (!name.trim()) return;
|
|
20822
20922
|
setIsLoading(true);
|
|
@@ -20911,15 +21011,15 @@ function TotpSetupDialog({ onSuccess, trigger }) {
|
|
|
20911
21011
|
__name(TotpSetupDialog, "TotpSetupDialog");
|
|
20912
21012
|
|
|
20913
21013
|
// src/features/auth/components/two-factor/TwoFactorSettings.tsx
|
|
20914
|
-
import { Fragment as
|
|
21014
|
+
import { Fragment as Fragment35, jsx as jsx220, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
20915
21015
|
function TwoFactorSettings() {
|
|
20916
21016
|
const t = useTranslations94();
|
|
20917
|
-
const [status, setStatus] =
|
|
20918
|
-
const [authenticators, setAuthenticators] =
|
|
20919
|
-
const [passkeys, setPasskeys] =
|
|
20920
|
-
const [isLoading, setIsLoading] =
|
|
20921
|
-
const [isEnabling, setIsEnabling] =
|
|
20922
|
-
const [passkeyDialogOpen, setPasskeyDialogOpen] =
|
|
21017
|
+
const [status, setStatus] = useState81(null);
|
|
21018
|
+
const [authenticators, setAuthenticators] = useState81([]);
|
|
21019
|
+
const [passkeys, setPasskeys] = useState81([]);
|
|
21020
|
+
const [isLoading, setIsLoading] = useState81(true);
|
|
21021
|
+
const [isEnabling, setIsEnabling] = useState81(false);
|
|
21022
|
+
const [passkeyDialogOpen, setPasskeyDialogOpen] = useState81(false);
|
|
20923
21023
|
const loadStatus = useCallback41(async () => {
|
|
20924
21024
|
try {
|
|
20925
21025
|
const [statusData, authenticatorsList, passkeysList] = await Promise.all([
|
|
@@ -20998,7 +21098,7 @@ function TwoFactorSettings() {
|
|
|
20998
21098
|
] }),
|
|
20999
21099
|
/* @__PURE__ */ jsx220(BackupCodesDialog, { remainingCodes: status?.backupCodesCount ?? 0, onRegenerate: handleRefresh })
|
|
21000
21100
|
] }) }),
|
|
21001
|
-
!isEnabled && (authenticators.length > 0 || passkeys.length > 0) && /* @__PURE__ */ jsxs124(
|
|
21101
|
+
!isEnabled && (authenticators.length > 0 || passkeys.length > 0) && /* @__PURE__ */ jsxs124(Fragment35, { children: [
|
|
21002
21102
|
/* @__PURE__ */ jsx220(Separator, {}),
|
|
21003
21103
|
/* @__PURE__ */ jsxs124("div", { className: "flex items-center justify-between", children: [
|
|
21004
21104
|
/* @__PURE__ */ jsxs124("div", { children: [
|
|
@@ -21008,7 +21108,7 @@ function TwoFactorSettings() {
|
|
|
21008
21108
|
/* @__PURE__ */ jsx220(Button, { onClick: handleEnable2FA, disabled: isEnabling, children: isEnabling ? t("common.loading") : t("auth.two_factor.enable_button") })
|
|
21009
21109
|
] })
|
|
21010
21110
|
] }),
|
|
21011
|
-
isEnabled && /* @__PURE__ */ jsxs124(
|
|
21111
|
+
isEnabled && /* @__PURE__ */ jsxs124(Fragment35, { children: [
|
|
21012
21112
|
/* @__PURE__ */ jsx220(Separator, {}),
|
|
21013
21113
|
/* @__PURE__ */ jsxs124("div", { className: "flex items-center justify-between", children: [
|
|
21014
21114
|
/* @__PURE__ */ jsxs124("div", { children: [
|
|
@@ -21094,11 +21194,11 @@ function GoogleSignInButton({ referralCode, source }) {
|
|
|
21094
21194
|
__name(GoogleSignInButton, "GoogleSignInButton");
|
|
21095
21195
|
|
|
21096
21196
|
// src/features/auth/components/details/LandingComponent.tsx
|
|
21097
|
-
import { Fragment as
|
|
21197
|
+
import { Fragment as Fragment36, jsx as jsx223, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
21098
21198
|
function LandingComponent() {
|
|
21099
21199
|
const t = useTranslations96();
|
|
21100
21200
|
const { setComponentType } = useAuthContext();
|
|
21101
|
-
return /* @__PURE__ */ jsxs126(
|
|
21201
|
+
return /* @__PURE__ */ jsxs126(Fragment36, { children: [
|
|
21102
21202
|
/* @__PURE__ */ jsxs126(CardHeader, { className: "mb-4", "data-testid": "page-pre-login-container", children: [
|
|
21103
21203
|
/* @__PURE__ */ jsxs126(CardTitle, { className: "text-primary flex flex-col items-center gap-y-8 pb-8 text-4xl", children: [
|
|
21104
21204
|
/* @__PURE__ */ jsx223(Image9, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
@@ -21107,7 +21207,7 @@ function LandingComponent() {
|
|
|
21107
21207
|
/* @__PURE__ */ jsx223(CardDescription, { className: "flex w-full justify-center text-center text-sm", children: t(`common.description`) })
|
|
21108
21208
|
] }),
|
|
21109
21209
|
/* @__PURE__ */ jsxs126(CardFooter, { className: "mt-4 flex w-full flex-col justify-between gap-y-4", children: [
|
|
21110
|
-
isInternalAuthEnabled() && /* @__PURE__ */ jsxs126(
|
|
21210
|
+
isInternalAuthEnabled() && /* @__PURE__ */ jsxs126(Fragment36, { children: [
|
|
21111
21211
|
isRegistrationAllowed() && /* @__PURE__ */ jsx223(
|
|
21112
21212
|
Link,
|
|
21113
21213
|
{
|
|
@@ -21130,14 +21230,14 @@ __name(LandingComponent, "LandingComponent");
|
|
|
21130
21230
|
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
21131
21231
|
import { useTranslations as useTranslations97 } from "next-intl";
|
|
21132
21232
|
import Image10 from "next/image";
|
|
21133
|
-
import { useEffect as useEffect59, useState as
|
|
21233
|
+
import { useEffect as useEffect59, useState as useState82 } from "react";
|
|
21134
21234
|
import { useForm as useForm7 } from "react-hook-form";
|
|
21135
21235
|
import { z as z8 } from "zod";
|
|
21136
|
-
import { Fragment as
|
|
21236
|
+
import { Fragment as Fragment37, jsx as jsx224, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
21137
21237
|
function AcceptInvitation() {
|
|
21138
21238
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
21139
|
-
const [showConfirmation, setShowConfirmation] =
|
|
21140
|
-
const [error, setError] =
|
|
21239
|
+
const [showConfirmation, setShowConfirmation] = useState82(false);
|
|
21240
|
+
const [error, setError] = useState82(void 0);
|
|
21141
21241
|
const t = useTranslations97();
|
|
21142
21242
|
useEffect59(() => {
|
|
21143
21243
|
async function validateCode(code) {
|
|
@@ -21196,13 +21296,13 @@ function AcceptInvitation() {
|
|
|
21196
21296
|
errorToast({ title: t(`common.errors.error`), error });
|
|
21197
21297
|
}
|
|
21198
21298
|
}, "onSubmit");
|
|
21199
|
-
return /* @__PURE__ */ jsxs127(
|
|
21299
|
+
return /* @__PURE__ */ jsxs127(Fragment37, { children: [
|
|
21200
21300
|
/* @__PURE__ */ jsxs127(CardHeader, { children: [
|
|
21201
21301
|
/* @__PURE__ */ jsxs127(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21202
21302
|
/* @__PURE__ */ jsx224(Image10, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
21203
21303
|
t("auth.accept_invitation")
|
|
21204
21304
|
] }),
|
|
21205
|
-
/* @__PURE__ */ jsx224(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx224(
|
|
21305
|
+
/* @__PURE__ */ jsx224(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx224(Fragment37, { children: t("auth.errors.activating_account") }) : /* @__PURE__ */ jsx224(Fragment37, { children: t("auth.select_password") }) })
|
|
21206
21306
|
] }),
|
|
21207
21307
|
/* @__PURE__ */ jsx224(CardContent, { children: showConfirmation ? /* @__PURE__ */ jsx224(CardDescription, { className: "text-center text-xl", children: t("auth.activation_description") }) : error ? /* @__PURE__ */ jsx224(CardDescription, { className: "text-center text-xl", children: error }) : /* @__PURE__ */ jsx224(Form, { ...form, children: /* @__PURE__ */ jsxs127("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
21208
21308
|
/* @__PURE__ */ jsx224(
|
|
@@ -21232,12 +21332,12 @@ __name(AcceptInvitation, "AcceptInvitation");
|
|
|
21232
21332
|
// src/features/auth/components/forms/ActivateAccount.tsx
|
|
21233
21333
|
import { useTranslations as useTranslations98 } from "next-intl";
|
|
21234
21334
|
import Image11 from "next/image";
|
|
21235
|
-
import { useEffect as useEffect60, useState as
|
|
21236
|
-
import { Fragment as
|
|
21335
|
+
import { useEffect as useEffect60, useState as useState83 } from "react";
|
|
21336
|
+
import { Fragment as Fragment38, jsx as jsx225, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
21237
21337
|
function ActivateAccount() {
|
|
21238
21338
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
21239
|
-
const [showConfirmation, setShowConfirmation] =
|
|
21240
|
-
const [error, setError] =
|
|
21339
|
+
const [showConfirmation, setShowConfirmation] = useState83(false);
|
|
21340
|
+
const [error, setError] = useState83(void 0);
|
|
21241
21341
|
const t = useTranslations98();
|
|
21242
21342
|
useEffect60(() => {
|
|
21243
21343
|
async function ActivateAccount2(code) {
|
|
@@ -21266,25 +21366,25 @@ function ActivateAccount() {
|
|
|
21266
21366
|
setError(t(`auth.errors.invalid_invitation_code`));
|
|
21267
21367
|
}
|
|
21268
21368
|
}, []);
|
|
21269
|
-
return /* @__PURE__ */ jsxs128(
|
|
21369
|
+
return /* @__PURE__ */ jsxs128(Fragment38, { children: [
|
|
21270
21370
|
/* @__PURE__ */ jsxs128(CardHeader, { children: [
|
|
21271
21371
|
/* @__PURE__ */ jsxs128(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21272
21372
|
/* @__PURE__ */ jsx225(Image11, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
21273
21373
|
t("auth.accept_invitation")
|
|
21274
21374
|
] }),
|
|
21275
|
-
/* @__PURE__ */ jsx225(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx225(
|
|
21375
|
+
/* @__PURE__ */ jsx225(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx225(Fragment38, { children: t("auth.errors.activating_account") }) : /* @__PURE__ */ jsx225(Fragment38, { children: " " }) })
|
|
21276
21376
|
] }),
|
|
21277
|
-
/* @__PURE__ */ jsx225(CardContent, { children: /* @__PURE__ */ jsx225(CardDescription, { className: "text-center text-xl", children: showConfirmation ? /* @__PURE__ */ jsx225(
|
|
21377
|
+
/* @__PURE__ */ jsx225(CardContent, { children: /* @__PURE__ */ jsx225(CardDescription, { className: "text-center text-xl", children: showConfirmation ? /* @__PURE__ */ jsx225(Fragment38, { children: t("auth.activation_description") }) : error ? /* @__PURE__ */ jsx225(Fragment38, { children: error }) : /* @__PURE__ */ jsx225(Fragment38, { children: t("auth.activation_wait") }) }) })
|
|
21278
21378
|
] });
|
|
21279
21379
|
}
|
|
21280
21380
|
__name(ActivateAccount, "ActivateAccount");
|
|
21281
21381
|
|
|
21282
21382
|
// src/features/auth/components/forms/Cookies.tsx
|
|
21283
|
-
import { useEffect as useEffect61, useState as
|
|
21383
|
+
import { useEffect as useEffect61, useState as useState84 } from "react";
|
|
21284
21384
|
function Cookies({ dehydratedAuth, page }) {
|
|
21285
21385
|
const { setUser } = useCurrentUserContext();
|
|
21286
21386
|
const router = useI18nRouter();
|
|
21287
|
-
const [hasSaved, setHasSaved] =
|
|
21387
|
+
const [hasSaved, setHasSaved] = useState84(false);
|
|
21288
21388
|
useEffect61(() => {
|
|
21289
21389
|
if (hasSaved) return;
|
|
21290
21390
|
async function saveTokenOnServer() {
|
|
@@ -21308,14 +21408,14 @@ __name(Cookies, "Cookies");
|
|
|
21308
21408
|
import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
21309
21409
|
import { useTranslations as useTranslations99 } from "next-intl";
|
|
21310
21410
|
import Image12 from "next/image";
|
|
21311
|
-
import { useState as
|
|
21411
|
+
import { useState as useState85 } from "react";
|
|
21312
21412
|
import { useForm as useForm8 } from "react-hook-form";
|
|
21313
21413
|
import { z as z9 } from "zod";
|
|
21314
|
-
import { Fragment as
|
|
21414
|
+
import { Fragment as Fragment39, jsx as jsx226, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
21315
21415
|
function ForgotPassword() {
|
|
21316
21416
|
const t = useTranslations99();
|
|
21317
21417
|
const { setComponentType } = useAuthContext();
|
|
21318
|
-
const [showConfirmation, setShowConfirmation] =
|
|
21418
|
+
const [showConfirmation, setShowConfirmation] = useState85(false);
|
|
21319
21419
|
const formSchema = z9.object({
|
|
21320
21420
|
email: z9.string().email({
|
|
21321
21421
|
message: t(`common.errors.invalid_email`)
|
|
@@ -21338,13 +21438,13 @@ function ForgotPassword() {
|
|
|
21338
21438
|
errorToast({ title: t("common.errors.error"), error: e });
|
|
21339
21439
|
}
|
|
21340
21440
|
}, "onSubmit");
|
|
21341
|
-
return /* @__PURE__ */ jsxs129(
|
|
21441
|
+
return /* @__PURE__ */ jsxs129(Fragment39, { children: [
|
|
21342
21442
|
/* @__PURE__ */ jsxs129(CardHeader, { "data-testid": "page-forgot-password-container", children: [
|
|
21343
21443
|
/* @__PURE__ */ jsxs129(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21344
21444
|
/* @__PURE__ */ jsx226(Image12, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
21345
21445
|
t("auth.buttons.forgot_password")
|
|
21346
21446
|
] }),
|
|
21347
|
-
/* @__PURE__ */ jsx226(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx226(
|
|
21447
|
+
/* @__PURE__ */ jsx226(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx226(Fragment39, { children: " " }) : /* @__PURE__ */ jsx226(Fragment39, { children: t(`auth.add_email_to_reset`) }) })
|
|
21348
21448
|
] }),
|
|
21349
21449
|
showConfirmation ? /* @__PURE__ */ jsx226(CardContent, { children: /* @__PURE__ */ jsx226(CardDescription, { className: "text-center text-xl", children: t(`auth.reset_confirmation`) }) }) : /* @__PURE__ */ jsx226(Form, { ...form, children: /* @__PURE__ */ jsxs129("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
21350
21450
|
/* @__PURE__ */ jsxs129(CardContent, { children: [
|
|
@@ -21380,10 +21480,10 @@ import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
|
|
|
21380
21480
|
import { useTranslations as useTranslations100 } from "next-intl";
|
|
21381
21481
|
import Image13 from "next/image";
|
|
21382
21482
|
import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
21383
|
-
import { useEffect as useEffect62, useState as
|
|
21483
|
+
import { useEffect as useEffect62, useState as useState86 } from "react";
|
|
21384
21484
|
import { useForm as useForm9 } from "react-hook-form";
|
|
21385
21485
|
import { z as z10 } from "zod";
|
|
21386
|
-
import { Fragment as
|
|
21486
|
+
import { Fragment as Fragment40, jsx as jsx227, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
21387
21487
|
function Login() {
|
|
21388
21488
|
const t = useTranslations100();
|
|
21389
21489
|
const { setUser } = useCurrentUserContext();
|
|
@@ -21393,7 +21493,7 @@ function Login() {
|
|
|
21393
21493
|
const nativeRouter = useRouter();
|
|
21394
21494
|
const searchParams = useSearchParams3();
|
|
21395
21495
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
21396
|
-
const [referralCode, setReferralCode2] =
|
|
21496
|
+
const [referralCode, setReferralCode2] = useState86(null);
|
|
21397
21497
|
useEffect62(() => {
|
|
21398
21498
|
const cookies = document.cookie.split("; ");
|
|
21399
21499
|
for (const cookie of cookies) {
|
|
@@ -21449,7 +21549,7 @@ function Login() {
|
|
|
21449
21549
|
});
|
|
21450
21550
|
}
|
|
21451
21551
|
}, "onSubmit");
|
|
21452
|
-
return /* @__PURE__ */ jsxs130(
|
|
21552
|
+
return /* @__PURE__ */ jsxs130(Fragment40, { children: [
|
|
21453
21553
|
/* @__PURE__ */ jsxs130(CardHeader, { "data-testid": "page-login-container", children: [
|
|
21454
21554
|
/* @__PURE__ */ jsxs130(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21455
21555
|
/* @__PURE__ */ jsx227(Image13, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
@@ -21458,7 +21558,7 @@ function Login() {
|
|
|
21458
21558
|
/* @__PURE__ */ jsx227(CardDescription, { className: "text-sm", children: t(`auth.login_description`) })
|
|
21459
21559
|
] }),
|
|
21460
21560
|
/* @__PURE__ */ jsx227(Form, { ...form, children: /* @__PURE__ */ jsxs130("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
21461
|
-
/* @__PURE__ */ jsx227(CardContent, { children: isInternalAuthEnabled() && /* @__PURE__ */ jsxs130(
|
|
21561
|
+
/* @__PURE__ */ jsx227(CardContent, { children: isInternalAuthEnabled() && /* @__PURE__ */ jsxs130(Fragment40, { children: [
|
|
21462
21562
|
/* @__PURE__ */ jsx227(
|
|
21463
21563
|
FormInput,
|
|
21464
21564
|
{
|
|
@@ -21525,7 +21625,7 @@ function clearClientStorage(keys) {
|
|
|
21525
21625
|
__name(clearClientStorage, "clearClientStorage");
|
|
21526
21626
|
|
|
21527
21627
|
// src/features/auth/components/forms/Logout.tsx
|
|
21528
|
-
import { Fragment as
|
|
21628
|
+
import { Fragment as Fragment41, jsx as jsx228 } from "react/jsx-runtime";
|
|
21529
21629
|
function Logout({ storageKeys }) {
|
|
21530
21630
|
const generateUrl = usePageUrlGenerator();
|
|
21531
21631
|
useEffect63(() => {
|
|
@@ -21536,7 +21636,7 @@ function Logout({ storageKeys }) {
|
|
|
21536
21636
|
}, "logOut");
|
|
21537
21637
|
logOut();
|
|
21538
21638
|
}, []);
|
|
21539
|
-
return /* @__PURE__ */ jsx228(
|
|
21639
|
+
return /* @__PURE__ */ jsx228(Fragment41, {});
|
|
21540
21640
|
}
|
|
21541
21641
|
__name(Logout, "Logout");
|
|
21542
21642
|
|
|
@@ -21574,14 +21674,14 @@ __name(RefreshUser, "RefreshUser");
|
|
|
21574
21674
|
import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
|
|
21575
21675
|
import { useTranslations as useTranslations101 } from "next-intl";
|
|
21576
21676
|
import Image14 from "next/image";
|
|
21577
|
-
import { useEffect as useEffect65, useState as
|
|
21677
|
+
import { useEffect as useEffect65, useState as useState87 } from "react";
|
|
21578
21678
|
import { useForm as useForm10 } from "react-hook-form";
|
|
21579
21679
|
import { z as z11 } from "zod";
|
|
21580
|
-
import { Fragment as
|
|
21680
|
+
import { Fragment as Fragment42, jsx as jsx229, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
21581
21681
|
function ResetPassword() {
|
|
21582
21682
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
21583
|
-
const [showConfirmation, setShowConfirmation] =
|
|
21584
|
-
const [error, setError] =
|
|
21683
|
+
const [showConfirmation, setShowConfirmation] = useState87(false);
|
|
21684
|
+
const [error, setError] = useState87(void 0);
|
|
21585
21685
|
const t = useTranslations101();
|
|
21586
21686
|
useEffect65(() => {
|
|
21587
21687
|
async function validateResetPasswordCode(code) {
|
|
@@ -21640,13 +21740,13 @@ function ResetPassword() {
|
|
|
21640
21740
|
errorToast({ title: t(`common.errors.error`), error });
|
|
21641
21741
|
}
|
|
21642
21742
|
}, "onSubmit");
|
|
21643
|
-
return /* @__PURE__ */ jsxs131(
|
|
21743
|
+
return /* @__PURE__ */ jsxs131(Fragment42, { children: [
|
|
21644
21744
|
/* @__PURE__ */ jsxs131(CardHeader, { children: [
|
|
21645
21745
|
/* @__PURE__ */ jsxs131(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21646
21746
|
/* @__PURE__ */ jsx229(Image14, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
21647
21747
|
t(`auth.password_reset`)
|
|
21648
21748
|
] }),
|
|
21649
|
-
/* @__PURE__ */ jsx229(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx229(
|
|
21749
|
+
/* @__PURE__ */ jsx229(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx229(Fragment42, { children: t(`auth.errors.password_reset_error`) }) : /* @__PURE__ */ jsx229(Fragment42, { children: t(`auth.reset_password`) }) })
|
|
21650
21750
|
] }),
|
|
21651
21751
|
/* @__PURE__ */ jsx229(CardContent, { children: showConfirmation ? /* @__PURE__ */ jsx229(CardDescription, { className: "text-center text-xl", children: t(`auth.reset_success_description`) }) : error ? /* @__PURE__ */ jsx229(CardDescription, { className: "text-center text-xl", children: error }) : /* @__PURE__ */ jsx229(Form, { ...form, children: /* @__PURE__ */ jsxs131("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
21652
21752
|
/* @__PURE__ */ jsx229(FormPassword, { form, id: "password", name: t(`user.fields.password.label`) }),
|
|
@@ -21660,18 +21760,18 @@ __name(ResetPassword, "ResetPassword");
|
|
|
21660
21760
|
// src/features/auth/components/forms/TwoFactorChallenge.tsx
|
|
21661
21761
|
import { useTranslations as useTranslations103 } from "next-intl";
|
|
21662
21762
|
import { useRouter as useRouter2, useSearchParams as useSearchParams4 } from "next/navigation";
|
|
21663
|
-
import { useState as
|
|
21763
|
+
import { useState as useState89 } from "react";
|
|
21664
21764
|
import { v4 as v411 } from "uuid";
|
|
21665
21765
|
|
|
21666
21766
|
// src/features/auth/components/two-factor/PasskeyButton.tsx
|
|
21667
21767
|
import { startAuthentication } from "@simplewebauthn/browser";
|
|
21668
21768
|
import { useTranslations as useTranslations102 } from "next-intl";
|
|
21669
|
-
import { useState as
|
|
21769
|
+
import { useState as useState88 } from "react";
|
|
21670
21770
|
import { v4 as v410 } from "uuid";
|
|
21671
21771
|
import { jsx as jsx230 } from "react/jsx-runtime";
|
|
21672
21772
|
function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
|
|
21673
21773
|
const t = useTranslations102();
|
|
21674
|
-
const [isLoading, setIsLoading] =
|
|
21774
|
+
const [isLoading, setIsLoading] = useState88(false);
|
|
21675
21775
|
const handleClick = /* @__PURE__ */ __name(async () => {
|
|
21676
21776
|
setIsLoading(true);
|
|
21677
21777
|
try {
|
|
@@ -21706,7 +21806,7 @@ function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
|
|
|
21706
21806
|
__name(PasskeyButton, "PasskeyButton");
|
|
21707
21807
|
|
|
21708
21808
|
// src/features/auth/components/forms/TwoFactorChallenge.tsx
|
|
21709
|
-
import { Fragment as
|
|
21809
|
+
import { Fragment as Fragment43, jsx as jsx231, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
21710
21810
|
function TwoFactorChallenge() {
|
|
21711
21811
|
const t = useTranslations103();
|
|
21712
21812
|
const { setUser } = useCurrentUserContext();
|
|
@@ -21716,10 +21816,10 @@ function TwoFactorChallenge() {
|
|
|
21716
21816
|
const nativeRouter = useRouter2();
|
|
21717
21817
|
const searchParams = useSearchParams4();
|
|
21718
21818
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
21719
|
-
const [isVerifying, setIsVerifying] =
|
|
21720
|
-
const [totpError, setTotpError] =
|
|
21721
|
-
const [backupCode, setBackupCode] =
|
|
21722
|
-
const [backupError, setBackupError] =
|
|
21819
|
+
const [isVerifying, setIsVerifying] = useState89(false);
|
|
21820
|
+
const [totpError, setTotpError] = useState89();
|
|
21821
|
+
const [backupCode, setBackupCode] = useState89("");
|
|
21822
|
+
const [backupError, setBackupError] = useState89();
|
|
21723
21823
|
if (!pendingTwoFactor) {
|
|
21724
21824
|
return null;
|
|
21725
21825
|
}
|
|
@@ -21786,7 +21886,7 @@ function TwoFactorChallenge() {
|
|
|
21786
21886
|
const hasTotp = availableMethods.includes("totp");
|
|
21787
21887
|
const hasPasskey = availableMethods.includes("passkey");
|
|
21788
21888
|
const hasBackup = availableMethods.includes("backup");
|
|
21789
|
-
return /* @__PURE__ */ jsxs132(
|
|
21889
|
+
return /* @__PURE__ */ jsxs132(Fragment43, { children: [
|
|
21790
21890
|
/* @__PURE__ */ jsxs132(CardHeader, { "data-testid": "page-2fa-challenge", children: [
|
|
21791
21891
|
/* @__PURE__ */ jsx231(CardTitle, { className: "text-primary", children: t("auth.two_factor.verification_required") }),
|
|
21792
21892
|
/* @__PURE__ */ jsx231(CardDescription, { children: t("auth.two_factor.enter_verification_code") })
|
|
@@ -22025,7 +22125,7 @@ var AI_CONNECTIONS_I18N_KEYS = [
|
|
|
22025
22125
|
|
|
22026
22126
|
// src/features/ai-connection/contexts/AiConnectionsContext.tsx
|
|
22027
22127
|
import { useTranslations as useTranslations105 } from "next-intl";
|
|
22028
|
-
import { createContext as createContext30, useCallback as useCallback42, useContext as useContext30, useEffect as useEffect66, useMemo as useMemo41, useState as
|
|
22128
|
+
import { createContext as createContext30, useCallback as useCallback42, useContext as useContext30, useEffect as useEffect66, useMemo as useMemo41, useState as useState90 } from "react";
|
|
22029
22129
|
import { jsx as jsx233 } from "react/jsx-runtime";
|
|
22030
22130
|
var defaultContextValue4 = {
|
|
22031
22131
|
connections: [],
|
|
@@ -22041,11 +22141,11 @@ var defaultContextValue4 = {
|
|
|
22041
22141
|
var AiConnectionsContext = createContext30(void 0);
|
|
22042
22142
|
var AiConnectionsProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
22043
22143
|
const t = useTranslations105();
|
|
22044
|
-
const [connections, setConnections] =
|
|
22045
|
-
const [providerRegistry, setProviderRegistry] =
|
|
22046
|
-
const [envDefaults, setEnvDefaults] =
|
|
22047
|
-
const [scopeCompanyId, setScopeCompanyId] =
|
|
22048
|
-
const [isLoading, setIsLoading] =
|
|
22144
|
+
const [connections, setConnections] = useState90([]);
|
|
22145
|
+
const [providerRegistry, setProviderRegistry] = useState90({});
|
|
22146
|
+
const [envDefaults, setEnvDefaults] = useState90({});
|
|
22147
|
+
const [scopeCompanyId, setScopeCompanyId] = useState90(null);
|
|
22148
|
+
const [isLoading, setIsLoading] = useState90(true);
|
|
22049
22149
|
const refresh = useCallback42(async () => {
|
|
22050
22150
|
setIsLoading(true);
|
|
22051
22151
|
try {
|
|
@@ -22079,7 +22179,7 @@ var useAiConnections = /* @__PURE__ */ __name(() => useContext30(AiConnectionsCo
|
|
|
22079
22179
|
|
|
22080
22180
|
// src/features/ai-connection/components/containers/AiConnectionsContainer.tsx
|
|
22081
22181
|
import { useTranslations as useTranslations109 } from "next-intl";
|
|
22082
|
-
import { useEffect as useEffect68, useMemo as useMemo44, useState as
|
|
22182
|
+
import { useEffect as useEffect68, useMemo as useMemo44, useState as useState92 } from "react";
|
|
22083
22183
|
|
|
22084
22184
|
// src/features/ai-connection/components/lists/AiConnectionTypeCard.tsx
|
|
22085
22185
|
import { ChevronDownIcon as ChevronDownIcon10, ChevronUpIcon as ChevronUpIcon3, PlusIcon as PlusIcon2 } from "lucide-react";
|
|
@@ -22089,13 +22189,13 @@ import { useMemo as useMemo43 } from "react";
|
|
|
22089
22189
|
// src/features/ai-connection/components/forms/AiConnectionDeleter.tsx
|
|
22090
22190
|
import { TrashIcon } from "lucide-react";
|
|
22091
22191
|
import { useTranslations as useTranslations106 } from "next-intl";
|
|
22092
|
-
import { useState as
|
|
22093
|
-
import { Fragment as
|
|
22192
|
+
import { useState as useState91 } from "react";
|
|
22193
|
+
import { Fragment as Fragment44, jsx as jsx234, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
22094
22194
|
function AiConnectionDeleter({ connection }) {
|
|
22095
22195
|
const t = useTranslations106();
|
|
22096
22196
|
const { refresh } = useAiConnections();
|
|
22097
|
-
const [open, setOpen] =
|
|
22098
|
-
return /* @__PURE__ */ jsxs134(
|
|
22197
|
+
const [open, setOpen] = useState91(false);
|
|
22198
|
+
return /* @__PURE__ */ jsxs134(Fragment44, { children: [
|
|
22099
22199
|
/* @__PURE__ */ jsx234(
|
|
22100
22200
|
Button,
|
|
22101
22201
|
{
|
|
@@ -22375,7 +22475,7 @@ function AiConnectionEditor({
|
|
|
22375
22475
|
__name(AiConnectionEditor, "AiConnectionEditor");
|
|
22376
22476
|
|
|
22377
22477
|
// src/features/ai-connection/components/lists/AiConnectionTypeCard.tsx
|
|
22378
|
-
import { Fragment as
|
|
22478
|
+
import { Fragment as Fragment45, jsx as jsx236, jsxs as jsxs136 } from "react/jsx-runtime";
|
|
22379
22479
|
function toInput(connection, overrides) {
|
|
22380
22480
|
return {
|
|
22381
22481
|
id: connection.id,
|
|
@@ -22498,7 +22598,7 @@ function AiConnectionTypeCard({ connectionType }) {
|
|
|
22498
22598
|
children: /* @__PURE__ */ jsx236(ChevronDownIcon10, {})
|
|
22499
22599
|
}
|
|
22500
22600
|
),
|
|
22501
|
-
!readOnly && /* @__PURE__ */ jsxs136(
|
|
22601
|
+
!readOnly && /* @__PURE__ */ jsxs136(Fragment45, { children: [
|
|
22502
22602
|
/* @__PURE__ */ jsx236(
|
|
22503
22603
|
AiConnectionEditor,
|
|
22504
22604
|
{
|
|
@@ -22573,7 +22673,7 @@ __name(AiConnectionsContainer, "AiConnectionsContainer");
|
|
|
22573
22673
|
function AiConnectionsBody() {
|
|
22574
22674
|
const t = useTranslations109();
|
|
22575
22675
|
const { scopeCompanyId, setScopeCompanyId } = useAiConnections();
|
|
22576
|
-
const [companies, setCompanies] =
|
|
22676
|
+
const [companies, setCompanies] = useState92([]);
|
|
22577
22677
|
useEffect68(() => {
|
|
22578
22678
|
let active = true;
|
|
22579
22679
|
CompanyService.findMany({}).then((response) => {
|
|
@@ -22691,7 +22791,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
22691
22791
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
22692
22792
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
22693
22793
|
import { useTranslations as useTranslations114 } from "next-intl";
|
|
22694
|
-
import { useCallback as useCallback44, useEffect as useEffect69, useMemo as useMemo46, useRef as useRef40, useState as
|
|
22794
|
+
import { useCallback as useCallback44, useEffect as useEffect69, useMemo as useMemo46, useRef as useRef40, useState as useState93 } from "react";
|
|
22695
22795
|
|
|
22696
22796
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
22697
22797
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -22804,7 +22904,7 @@ function HowToCommandViewer({ howTo, onBack, onStartChat }) {
|
|
|
22804
22904
|
__name(HowToCommandViewer, "HowToCommandViewer");
|
|
22805
22905
|
|
|
22806
22906
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
22807
|
-
import { Fragment as
|
|
22907
|
+
import { Fragment as Fragment46, jsx as jsx242, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
22808
22908
|
function matchPage(pathname, pattern) {
|
|
22809
22909
|
if (pattern.includes(":")) {
|
|
22810
22910
|
const pathSegments = pathname.split("/").filter(Boolean);
|
|
@@ -22817,10 +22917,10 @@ function matchPage(pathname, pattern) {
|
|
|
22817
22917
|
__name(matchPage, "matchPage");
|
|
22818
22918
|
function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
22819
22919
|
const t = useTranslations114();
|
|
22820
|
-
const [dialogOpen, setDialogOpen] =
|
|
22821
|
-
const [selectedHowTo, setSelectedHowTo] =
|
|
22920
|
+
const [dialogOpen, setDialogOpen] = useState93(false);
|
|
22921
|
+
const [selectedHowTo, setSelectedHowTo] = useState93(null);
|
|
22822
22922
|
const searchTermRef = useRef40("");
|
|
22823
|
-
const [searchTerm, setSearchTerm] =
|
|
22923
|
+
const [searchTerm, setSearchTerm] = useState93("");
|
|
22824
22924
|
const data = useDataListRetriever({
|
|
22825
22925
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
22826
22926
|
return HowToService.findMany(params);
|
|
@@ -22875,7 +22975,7 @@ function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
|
22875
22975
|
setSelectedHowTo(null);
|
|
22876
22976
|
if (onStartChat) onStartChat();
|
|
22877
22977
|
}, "handleStartChat");
|
|
22878
|
-
return /* @__PURE__ */ jsxs140(
|
|
22978
|
+
return /* @__PURE__ */ jsxs140(Fragment46, { children: [
|
|
22879
22979
|
/* @__PURE__ */ jsxs140(
|
|
22880
22980
|
SidebarMenuButton,
|
|
22881
22981
|
{
|
|
@@ -23043,7 +23143,7 @@ import { useTranslations as useTranslations118 } from "next-intl";
|
|
|
23043
23143
|
// src/features/how-to/hooks/useHowToTableStructure.tsx
|
|
23044
23144
|
import { useTranslations as useTranslations116 } from "next-intl";
|
|
23045
23145
|
import { useMemo as useMemo47 } from "react";
|
|
23046
|
-
import { Fragment as
|
|
23146
|
+
import { Fragment as Fragment47, jsx as jsx246 } from "react/jsx-runtime";
|
|
23047
23147
|
var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
|
|
23048
23148
|
const t = useTranslations116();
|
|
23049
23149
|
const generateUrl = usePageUrlGenerator();
|
|
@@ -23080,7 +23180,7 @@ var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
23080
23180
|
id: "description",
|
|
23081
23181
|
accessorKey: "description",
|
|
23082
23182
|
header: t(`howto.fields.description.label`),
|
|
23083
|
-
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246(
|
|
23183
|
+
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246(Fragment47, { children: row.getValue("description") }), "cell"),
|
|
23084
23184
|
enableSorting: false,
|
|
23085
23185
|
enableHiding: false
|
|
23086
23186
|
}),
|
|
@@ -23088,7 +23188,7 @@ var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
23088
23188
|
id: "pages",
|
|
23089
23189
|
accessorKey: "pages",
|
|
23090
23190
|
header: t(`howto.fields.pages.label`),
|
|
23091
|
-
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246(
|
|
23191
|
+
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246(Fragment47, { children: row.getValue("pages") }), "cell"),
|
|
23092
23192
|
enableSorting: false,
|
|
23093
23193
|
enableHiding: false
|
|
23094
23194
|
}),
|
|
@@ -23110,11 +23210,11 @@ registerTableGenerator("howtos", useHowToTableStructure);
|
|
|
23110
23210
|
|
|
23111
23211
|
// src/features/how-to/components/forms/HowToReindexButton.tsx
|
|
23112
23212
|
import { useTranslations as useTranslations117 } from "next-intl";
|
|
23113
|
-
import { useState as
|
|
23213
|
+
import { useState as useState94 } from "react";
|
|
23114
23214
|
import { jsx as jsx247 } from "react/jsx-runtime";
|
|
23115
23215
|
function HowToReindexButton({ refresh }) {
|
|
23116
23216
|
const t = useTranslations117();
|
|
23117
|
-
const [isReindexing, setIsReindexing] =
|
|
23217
|
+
const [isReindexing, setIsReindexing] = useState94(false);
|
|
23118
23218
|
const onReindex = /* @__PURE__ */ __name(async () => {
|
|
23119
23219
|
setIsReindexing(true);
|
|
23120
23220
|
try {
|
|
@@ -23173,8 +23273,8 @@ __name(HowToListContainer, "HowToListContainer");
|
|
|
23173
23273
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
23174
23274
|
import { CircleX as CircleX3, RefreshCwIcon as RefreshCwIcon5, SearchIcon as SearchIcon7, XIcon as XIcon11 } from "lucide-react";
|
|
23175
23275
|
import { useTranslations as useTranslations119 } from "next-intl";
|
|
23176
|
-
import { useCallback as useCallback45, useEffect as useEffect70, useRef as useRef41, useState as
|
|
23177
|
-
import { Fragment as
|
|
23276
|
+
import { useCallback as useCallback45, useEffect as useEffect70, useRef as useRef41, useState as useState95 } from "react";
|
|
23277
|
+
import { Fragment as Fragment48, jsx as jsx250, jsxs as jsxs142 } from "react/jsx-runtime";
|
|
23178
23278
|
function HowToSelector({
|
|
23179
23279
|
id,
|
|
23180
23280
|
form,
|
|
@@ -23184,10 +23284,10 @@ function HowToSelector({
|
|
|
23184
23284
|
isRequired = false
|
|
23185
23285
|
}) {
|
|
23186
23286
|
const t = useTranslations119();
|
|
23187
|
-
const [open, setOpen] =
|
|
23287
|
+
const [open, setOpen] = useState95(false);
|
|
23188
23288
|
const searchTermRef = useRef41("");
|
|
23189
|
-
const [searchTerm, setSearchTerm] =
|
|
23190
|
-
const [isSearching, setIsSearching] =
|
|
23289
|
+
const [searchTerm, setSearchTerm] = useState95("");
|
|
23290
|
+
const [isSearching, setIsSearching] = useState95(false);
|
|
23191
23291
|
const data = useDataListRetriever({
|
|
23192
23292
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
23193
23293
|
return HowToService.findMany(params);
|
|
@@ -23259,7 +23359,7 @@ function HowToSelector({
|
|
|
23259
23359
|
search("");
|
|
23260
23360
|
}
|
|
23261
23361
|
}
|
|
23262
|
-
) : /* @__PURE__ */ jsx250(
|
|
23362
|
+
) : /* @__PURE__ */ jsx250(Fragment48, {})
|
|
23263
23363
|
] }),
|
|
23264
23364
|
/* @__PURE__ */ jsx250(CommandList, { children: data.data && data.data.length > 0 && data.data.map((howTo) => /* @__PURE__ */ jsx250(
|
|
23265
23365
|
CommandItem,
|
|
@@ -23278,7 +23378,7 @@ __name(HowToSelector, "HowToSelector");
|
|
|
23278
23378
|
|
|
23279
23379
|
// src/features/handbook/components/lists/HandbookContents.tsx
|
|
23280
23380
|
import { useTranslations as useTranslations135 } from "next-intl";
|
|
23281
|
-
import { useCallback as useCallback49, useEffect as useEffect74, useMemo as useMemo53, useState as
|
|
23381
|
+
import { useCallback as useCallback49, useEffect as useEffect74, useMemo as useMemo53, useState as useState103 } from "react";
|
|
23282
23382
|
|
|
23283
23383
|
// src/features/handbook/contexts/HandbookContext.tsx
|
|
23284
23384
|
import { useTranslations as useTranslations120 } from "next-intl";
|
|
@@ -23333,10 +23433,10 @@ var HandbookProvider = /* @__PURE__ */ __name(({ children, page, section, functi
|
|
|
23333
23433
|
import { MessagesSquareIcon, Sparkles as Sparkles2 } from "lucide-react";
|
|
23334
23434
|
import { useTranslations as useTranslations132 } from "next-intl";
|
|
23335
23435
|
import Link5 from "next/link";
|
|
23336
|
-
import { useCallback as useCallback48, useState as
|
|
23436
|
+
import { useCallback as useCallback48, useState as useState101 } from "react";
|
|
23337
23437
|
|
|
23338
23438
|
// src/features/assistant/components/parts/AssistantComposer.tsx
|
|
23339
|
-
import { useState as
|
|
23439
|
+
import { useState as useState96 } from "react";
|
|
23340
23440
|
import { useTranslations as useTranslations121 } from "next-intl";
|
|
23341
23441
|
import { ArrowUp } from "lucide-react";
|
|
23342
23442
|
import { jsx as jsx252, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
@@ -23350,7 +23450,7 @@ function AssistantComposer({
|
|
|
23350
23450
|
leading
|
|
23351
23451
|
}) {
|
|
23352
23452
|
const t = useTranslations121();
|
|
23353
|
-
const [internal, setInternal] =
|
|
23453
|
+
const [internal, setInternal] = useState96("");
|
|
23354
23454
|
const value = controlled ?? internal;
|
|
23355
23455
|
const setValue = onValueChange ?? setInternal;
|
|
23356
23456
|
const canSend = value.trim().length > 0 && !disabled;
|
|
@@ -23410,10 +23510,10 @@ import ReactMarkdown3, { defaultUrlTransform } from "react-markdown";
|
|
|
23410
23510
|
import remarkGfm3 from "remark-gfm";
|
|
23411
23511
|
|
|
23412
23512
|
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
23413
|
-
import { useEffect as useEffect71, useMemo as useMemo49, useState as
|
|
23513
|
+
import { useEffect as useEffect71, useMemo as useMemo49, useState as useState99 } from "react";
|
|
23414
23514
|
|
|
23415
23515
|
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
23416
|
-
import { useMemo as useMemo48, useState as
|
|
23516
|
+
import { useMemo as useMemo48, useState as useState98 } from "react";
|
|
23417
23517
|
import { useTranslations as useTranslations128 } from "next-intl";
|
|
23418
23518
|
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
23419
23519
|
|
|
@@ -23472,7 +23572,7 @@ function ReferencesTab({ references }) {
|
|
|
23472
23572
|
__name(ReferencesTab, "ReferencesTab");
|
|
23473
23573
|
|
|
23474
23574
|
// src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
|
|
23475
|
-
import { Fragment as
|
|
23575
|
+
import { Fragment as Fragment49, useState as useState97 } from "react";
|
|
23476
23576
|
import { useTranslations as useTranslations125 } from "next-intl";
|
|
23477
23577
|
import { ChevronDown as ChevronDown3, HelpCircle } from "lucide-react";
|
|
23478
23578
|
import ReactMarkdown2 from "react-markdown";
|
|
@@ -23515,7 +23615,7 @@ function CitationsTab({ citations, sources }) {
|
|
|
23515
23615
|
const t = useTranslations125();
|
|
23516
23616
|
const entityLabel = useEntityLabel();
|
|
23517
23617
|
const isMobile = useIsMobile();
|
|
23518
|
-
const [expanded, setExpanded] =
|
|
23618
|
+
const [expanded, setExpanded] = useState97(/* @__PURE__ */ new Set());
|
|
23519
23619
|
if (citations.length === 0) return null;
|
|
23520
23620
|
const sorted = [...citations].sort((a, b) => (b.relevance ?? 0) - (a.relevance ?? 0));
|
|
23521
23621
|
const toggle = /* @__PURE__ */ __name((id) => {
|
|
@@ -23537,7 +23637,7 @@ function CitationsTab({ citations, sources }) {
|
|
|
23537
23637
|
const typeLabel = chunk.nodeType ? entityLabel(chunk.nodeType) : t("features.assistant.message.sources.source");
|
|
23538
23638
|
const fallbackName = chunk.nodeId ? `${typeLabel} ${chunk.nodeId.slice(0, 8)}` : typeLabel;
|
|
23539
23639
|
const sourceName = resolved?.name ?? fallbackName;
|
|
23540
|
-
return /* @__PURE__ */ jsxs146(
|
|
23640
|
+
return /* @__PURE__ */ jsxs146(Fragment49, { children: [
|
|
23541
23641
|
/* @__PURE__ */ jsxs146(TableRow, { children: [
|
|
23542
23642
|
/* @__PURE__ */ jsx255(TableCell, { children: /* @__PURE__ */ jsxs146(
|
|
23543
23643
|
"div",
|
|
@@ -23782,8 +23882,8 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
|
|
|
23782
23882
|
if (usersCount > 0) visibleTabs.push("users");
|
|
23783
23883
|
const autoOpen = isLatestAssistant && suggestionsCount > 0;
|
|
23784
23884
|
const initialTab = autoOpen ? "suggested" : visibleTabs[0];
|
|
23785
|
-
const [open, setOpen] =
|
|
23786
|
-
const [active, setActive] =
|
|
23885
|
+
const [open, setOpen] = useState98(autoOpen);
|
|
23886
|
+
const [active, setActive] = useState98(initialTab);
|
|
23787
23887
|
if (total === 0) return null;
|
|
23788
23888
|
const panelId = `sources-panel-${message.id}`;
|
|
23789
23889
|
return /* @__PURE__ */ jsxs149("div", { className: "mt-2 w-full min-w-0", children: [
|
|
@@ -23865,7 +23965,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
23865
23965
|
}
|
|
23866
23966
|
return parts.sort().join("|");
|
|
23867
23967
|
}, [groups]);
|
|
23868
|
-
const [resolved, setResolved] =
|
|
23968
|
+
const [resolved, setResolved] = useState99([]);
|
|
23869
23969
|
useEffect71(() => {
|
|
23870
23970
|
if (groups.size === 0) {
|
|
23871
23971
|
setResolved((current) => current.length === 0 ? current : []);
|
|
@@ -23933,7 +24033,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
23933
24033
|
__name(MessageSourcesContainer, "MessageSourcesContainer");
|
|
23934
24034
|
|
|
23935
24035
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
23936
|
-
import { Fragment as
|
|
24036
|
+
import { Fragment as Fragment50, jsx as jsx261, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
23937
24037
|
var MENTION_HREF = /^mention:\/\/([^/]+)\/(.+)$/;
|
|
23938
24038
|
function mentionUrlTransform(url) {
|
|
23939
24039
|
return MENTION_HREF.test(url) ? url : defaultUrlTransform(url);
|
|
@@ -23956,7 +24056,7 @@ function MessageItem({
|
|
|
23956
24056
|
a: /* @__PURE__ */ __name(({ href, children }) => {
|
|
23957
24057
|
const match = href ? MENTION_HREF.exec(href) : null;
|
|
23958
24058
|
if (!match || !renderMention) return /* @__PURE__ */ jsx261("a", { href, children });
|
|
23959
|
-
return /* @__PURE__ */ jsx261(
|
|
24059
|
+
return /* @__PURE__ */ jsx261(Fragment50, { children: renderMention({ type: match[1], id: match[2], alias: String(children ?? "") }) });
|
|
23960
24060
|
}, "a")
|
|
23961
24061
|
}),
|
|
23962
24062
|
[renderMention]
|
|
@@ -24080,7 +24180,7 @@ __name(AssistantThread, "AssistantThread");
|
|
|
24080
24180
|
|
|
24081
24181
|
// src/features/handbook/hooks/useHandbookAsk.ts
|
|
24082
24182
|
import { useTranslations as useTranslations131 } from "next-intl";
|
|
24083
|
-
import { useCallback as useCallback47, useEffect as useEffect73, useState as
|
|
24183
|
+
import { useCallback as useCallback47, useEffect as useEffect73, useState as useState100 } from "react";
|
|
24084
24184
|
import { v4 as v413 } from "uuid";
|
|
24085
24185
|
function withSources(messages, label) {
|
|
24086
24186
|
return messages.map((message) => withSourcesInContent(message, label));
|
|
@@ -24108,10 +24208,10 @@ function useHandbookAsk(params) {
|
|
|
24108
24208
|
const generateUrl = usePageUrlGenerator();
|
|
24109
24209
|
const shouldSyncUrl = params?.syncUrl ?? true;
|
|
24110
24210
|
const handbookThreadId = params?.handbookThreadId;
|
|
24111
|
-
const [threads, setThreads] =
|
|
24112
|
-
const [thread, setThread] =
|
|
24113
|
-
const [messages, setMessages] =
|
|
24114
|
-
const [sending, setSending] =
|
|
24211
|
+
const [threads, setThreads] = useState100([]);
|
|
24212
|
+
const [thread, setThread] = useState100(void 0);
|
|
24213
|
+
const [messages, setMessages] = useState100([]);
|
|
24214
|
+
const [sending, setSending] = useState100(false);
|
|
24115
24215
|
const sourcesLabel = t("handbook.chat.sources");
|
|
24116
24216
|
useEffect73(() => {
|
|
24117
24217
|
let cancelled = false;
|
|
@@ -24216,7 +24316,7 @@ function HandbookAskSheet({ handbookPageId } = {}) {
|
|
|
24216
24316
|
const t = useTranslations132();
|
|
24217
24317
|
const generateUrl = usePageUrlGenerator();
|
|
24218
24318
|
const { threads, thread, messages, sending, ask, selectThread } = useHandbookAsk({ syncUrl: false });
|
|
24219
|
-
const [scoped, setScoped] =
|
|
24319
|
+
const [scoped, setScoped] = useState101(false);
|
|
24220
24320
|
const chatUrl = `${generateUrl({ page: Modules.HandbookPage })}/chat`;
|
|
24221
24321
|
const showThread = !!thread || sending || messages.length > 0;
|
|
24222
24322
|
const send = useCallback48(
|
|
@@ -24277,11 +24377,11 @@ __name(HandbookAskSheet, "HandbookAskSheet");
|
|
|
24277
24377
|
|
|
24278
24378
|
// src/features/handbook/components/forms/HandbookSyncButton.tsx
|
|
24279
24379
|
import { useTranslations as useTranslations133 } from "next-intl";
|
|
24280
|
-
import { useState as
|
|
24380
|
+
import { useState as useState102 } from "react";
|
|
24281
24381
|
import { jsx as jsx266 } from "react/jsx-runtime";
|
|
24282
24382
|
function HandbookSyncButton({ refresh }) {
|
|
24283
24383
|
const t = useTranslations133();
|
|
24284
|
-
const [isSyncing, setIsSyncing] =
|
|
24384
|
+
const [isSyncing, setIsSyncing] = useState102(false);
|
|
24285
24385
|
const onSync = /* @__PURE__ */ __name(async () => {
|
|
24286
24386
|
setIsSyncing(true);
|
|
24287
24387
|
try {
|
|
@@ -24395,13 +24495,13 @@ function splitByNesting(pages) {
|
|
|
24395
24495
|
__name(splitByNesting, "splitByNesting");
|
|
24396
24496
|
|
|
24397
24497
|
// src/features/handbook/components/lists/HandbookContents.tsx
|
|
24398
|
-
import { Fragment as
|
|
24498
|
+
import { Fragment as Fragment51, jsx as jsx269, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
24399
24499
|
function HandbookContents() {
|
|
24400
24500
|
const t = useTranslations135();
|
|
24401
|
-
const [pages, setPages] =
|
|
24402
|
-
const [sections, setSections] =
|
|
24403
|
-
const [isLoading, setIsLoading] =
|
|
24404
|
-
const [reloadToken, setReloadToken] =
|
|
24501
|
+
const [pages, setPages] = useState103([]);
|
|
24502
|
+
const [sections, setSections] = useState103([]);
|
|
24503
|
+
const [isLoading, setIsLoading] = useState103(true);
|
|
24504
|
+
const [reloadToken, setReloadToken] = useState103(0);
|
|
24405
24505
|
useEffect74(() => {
|
|
24406
24506
|
let cancelled = false;
|
|
24407
24507
|
const load = /* @__PURE__ */ __name(async () => {
|
|
@@ -24434,7 +24534,7 @@ function HandbookContents() {
|
|
|
24434
24534
|
return /* @__PURE__ */ jsx269(
|
|
24435
24535
|
HandbookProvider,
|
|
24436
24536
|
{
|
|
24437
|
-
functions: /* @__PURE__ */ jsxs156(
|
|
24537
|
+
functions: /* @__PURE__ */ jsxs156(Fragment51, { children: [
|
|
24438
24538
|
/* @__PURE__ */ jsx269(HandbookAskSheet, {}),
|
|
24439
24539
|
/* @__PURE__ */ jsx269(HandbookSyncButton, { refresh }),
|
|
24440
24540
|
/* @__PURE__ */ jsx269(HandbookIndexStatus, { pages })
|
|
@@ -24492,7 +24592,7 @@ __name(HandbookAdminContainer, "HandbookAdminContainer");
|
|
|
24492
24592
|
|
|
24493
24593
|
// src/features/handbook/components/containers/HandbookPageContainer.tsx
|
|
24494
24594
|
import { useTranslations as useTranslations139 } from "next-intl";
|
|
24495
|
-
import { useEffect as useEffect77, useMemo as useMemo56, useState as
|
|
24595
|
+
import { useEffect as useEffect77, useMemo as useMemo56, useState as useState105 } from "react";
|
|
24496
24596
|
|
|
24497
24597
|
// src/features/handbook/components/details/HandbookPageDetails.tsx
|
|
24498
24598
|
import { jsx as jsx271 } from "react/jsx-runtime";
|
|
@@ -24548,13 +24648,13 @@ __name(HandbookPageNeighbours, "HandbookPageNeighbours");
|
|
|
24548
24648
|
// src/features/handbook/components/details/HandbookPageToc.tsx
|
|
24549
24649
|
import { List } from "lucide-react";
|
|
24550
24650
|
import { useTranslations as useTranslations137 } from "next-intl";
|
|
24551
|
-
import { useCallback as useCallback50, useEffect as useEffect75, useState as
|
|
24651
|
+
import { useCallback as useCallback50, useEffect as useEffect75, useState as useState104 } from "react";
|
|
24552
24652
|
import { jsx as jsx273, jsxs as jsxs158 } from "react/jsx-runtime";
|
|
24553
24653
|
function HandbookPageToc({ containerId }) {
|
|
24554
24654
|
const t = useTranslations137();
|
|
24555
|
-
const [activeId, setActiveId] =
|
|
24556
|
-
const [headings, setHeadings] =
|
|
24557
|
-
const [headingsWithIds, setHeadingsWithIds] =
|
|
24655
|
+
const [activeId, setActiveId] = useState104(null);
|
|
24656
|
+
const [headings, setHeadings] = useState104([]);
|
|
24657
|
+
const [headingsWithIds, setHeadingsWithIds] = useState104(/* @__PURE__ */ new Map());
|
|
24558
24658
|
useEffect75(() => {
|
|
24559
24659
|
const contentPanel = document.getElementById(containerId);
|
|
24560
24660
|
if (!contentPanel) return;
|
|
@@ -24719,10 +24819,10 @@ import { jsx as jsx275, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
|
24719
24819
|
var CONTENT_CONTAINER_ID = "handbook-page-content";
|
|
24720
24820
|
function HandbookPageContainer({ handbookPageId }) {
|
|
24721
24821
|
const t = useTranslations139();
|
|
24722
|
-
const [handbookPage, setHandbookPage] =
|
|
24723
|
-
const [pages, setPages] =
|
|
24724
|
-
const [sections, setSections] =
|
|
24725
|
-
const [isLoading, setIsLoading] =
|
|
24822
|
+
const [handbookPage, setHandbookPage] = useState105(void 0);
|
|
24823
|
+
const [pages, setPages] = useState105([]);
|
|
24824
|
+
const [sections, setSections] = useState105([]);
|
|
24825
|
+
const [isLoading, setIsLoading] = useState105(true);
|
|
24726
24826
|
useEffect77(() => {
|
|
24727
24827
|
let cancelled = false;
|
|
24728
24828
|
const load = /* @__PURE__ */ __name(async () => {
|
|
@@ -24825,7 +24925,7 @@ function groupThreadsByBucket(threads) {
|
|
|
24825
24925
|
__name(groupThreadsByBucket, "groupThreadsByBucket");
|
|
24826
24926
|
|
|
24827
24927
|
// src/features/assistant/components/parts/AssistantSidebar.tsx
|
|
24828
|
-
import { Fragment as
|
|
24928
|
+
import { Fragment as Fragment52, jsx as jsx276, jsxs as jsxs161 } from "react/jsx-runtime";
|
|
24829
24929
|
function AssistantSidebar({
|
|
24830
24930
|
threads,
|
|
24831
24931
|
activeId,
|
|
@@ -24862,7 +24962,7 @@ function AssistantSidebar({
|
|
|
24862
24962
|
" ",
|
|
24863
24963
|
newLabel ?? t("features.assistant.new")
|
|
24864
24964
|
] }) }),
|
|
24865
|
-
/* @__PURE__ */ jsx276("div", { className: "flex-1 overflow-y-auto p-2", children: threads.length === 0 ? /* @__PURE__ */ jsx276("div", { className: "text-muted-foreground mt-6 text-center text-xs", children: emptyLabel ?? t("features.assistant.empty_sidebar") }) : /* @__PURE__ */ jsxs161(
|
|
24965
|
+
/* @__PURE__ */ jsx276("div", { className: "flex-1 overflow-y-auto p-2", children: threads.length === 0 ? /* @__PURE__ */ jsx276("div", { className: "text-muted-foreground mt-6 text-center text-xs", children: emptyLabel ?? t("features.assistant.empty_sidebar") }) : /* @__PURE__ */ jsxs161(Fragment52, { children: [
|
|
24866
24966
|
renderSection(t("features.assistant.bucket_today"), groups.today),
|
|
24867
24967
|
renderSection(t("features.assistant.bucket_week"), groups.thisWeek),
|
|
24868
24968
|
renderSection(t("features.assistant.bucket_earlier"), groups.earlier)
|
|
@@ -24872,7 +24972,7 @@ function AssistantSidebar({
|
|
|
24872
24972
|
__name(AssistantSidebar, "AssistantSidebar");
|
|
24873
24973
|
|
|
24874
24974
|
// src/features/handbook/components/containers/HandbookAskContainer.tsx
|
|
24875
|
-
import { Fragment as
|
|
24975
|
+
import { Fragment as Fragment53, jsx as jsx277, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
24876
24976
|
function HandbookAskContainer({ handbookThreadId } = {}) {
|
|
24877
24977
|
const t = useTranslations141();
|
|
24878
24978
|
const { threads, thread, messages, sending, ask, selectThread, startNew } = useHandbookAsk({ handbookThreadId });
|
|
@@ -24913,7 +25013,7 @@ function HandbookAskContainer({ handbookThreadId } = {}) {
|
|
|
24913
25013
|
detailsIcon: /* @__PURE__ */ jsx277(MessagesSquareIcon2, {}),
|
|
24914
25014
|
details,
|
|
24915
25015
|
children: /* @__PURE__ */ jsxs162("div", { className: "flex h-full min-h-0 w-full flex-col overflow-hidden", children: [
|
|
24916
|
-
showThread ? /* @__PURE__ */ jsx277(
|
|
25016
|
+
showThread ? /* @__PURE__ */ jsx277(Fragment53, { children: /* @__PURE__ */ jsx277(
|
|
24917
25017
|
AssistantThread,
|
|
24918
25018
|
{
|
|
24919
25019
|
messages,
|
|
@@ -24948,30 +25048,30 @@ import { useTranslations as useTranslations144 } from "next-intl";
|
|
|
24948
25048
|
import { useMemo as useMemo58 } from "react";
|
|
24949
25049
|
|
|
24950
25050
|
// src/features/assistant-message/components/EntityMentionLink.tsx
|
|
24951
|
-
import { Fragment as
|
|
25051
|
+
import { Fragment as Fragment54, jsx as jsx278 } from "react/jsx-runtime";
|
|
24952
25052
|
function EntityMentionLinkView({ type, id, alias }) {
|
|
24953
25053
|
const generate = usePageUrlGenerator();
|
|
24954
25054
|
let module;
|
|
24955
25055
|
try {
|
|
24956
25056
|
module = ModuleRegistry.findByName(type);
|
|
24957
25057
|
} catch {
|
|
24958
|
-
return /* @__PURE__ */ jsx278(
|
|
25058
|
+
return /* @__PURE__ */ jsx278(Fragment54, { children: alias });
|
|
24959
25059
|
}
|
|
24960
|
-
if (!module?.pageUrl) return /* @__PURE__ */ jsx278(
|
|
25060
|
+
if (!module?.pageUrl) return /* @__PURE__ */ jsx278(Fragment54, { children: alias });
|
|
24961
25061
|
return /* @__PURE__ */ jsx278(Link, { href: generate({ page: module, id }), children: alias });
|
|
24962
25062
|
}
|
|
24963
25063
|
__name(EntityMentionLinkView, "EntityMentionLinkView");
|
|
24964
25064
|
var EntityMentionLink = /* @__PURE__ */ __name((p) => /* @__PURE__ */ jsx278(EntityMentionLinkView, { ...p }), "EntityMentionLink");
|
|
24965
25065
|
|
|
24966
25066
|
// src/features/assistant/components/parts/AssistantEmptyState.tsx
|
|
24967
|
-
import { useState as
|
|
25067
|
+
import { useState as useState106 } from "react";
|
|
24968
25068
|
import { useTranslations as useTranslations142 } from "next-intl";
|
|
24969
25069
|
import { Sparkles as Sparkles4 } from "lucide-react";
|
|
24970
25070
|
import { jsx as jsx279, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
24971
25071
|
var STARTER_KEYS = ["a", "b", "c", "d"];
|
|
24972
25072
|
function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChange, composerLeading }) {
|
|
24973
25073
|
const t = useTranslations142();
|
|
24974
|
-
const [draft, setDraft] =
|
|
25074
|
+
const [draft, setDraft] = useState106("");
|
|
24975
25075
|
return /* @__PURE__ */ jsx279("div", { className: "flex h-full w-full items-center justify-center p-10", children: /* @__PURE__ */ jsxs163("div", { className: "flex w-full max-w-2xl flex-col gap-6", children: [
|
|
24976
25076
|
/* @__PURE__ */ jsxs163("div", { className: "text-center", children: [
|
|
24977
25077
|
/* @__PURE__ */ jsx279("div", { className: "mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-blue-400 to-violet-500 text-white", children: /* @__PURE__ */ jsx279(Sparkles4, { className: "h-5 w-5" }) }),
|
|
@@ -25009,14 +25109,14 @@ function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChang
|
|
|
25009
25109
|
__name(AssistantEmptyState, "AssistantEmptyState");
|
|
25010
25110
|
|
|
25011
25111
|
// src/features/assistant/components/parts/AssistantThreadHeader.tsx
|
|
25012
|
-
import { useState as
|
|
25112
|
+
import { useState as useState107 } from "react";
|
|
25013
25113
|
import { useTranslations as useTranslations143 } from "next-intl";
|
|
25014
25114
|
import { jsx as jsx280, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
25015
25115
|
function AssistantThreadHeader({ assistant, onRename, onDelete, renamePlaceholder, deleteConfirmLabel }) {
|
|
25016
25116
|
const t = useTranslations143();
|
|
25017
|
-
const [renameValue, setRenameValue] =
|
|
25018
|
-
const [renameOpen, setRenameOpen] =
|
|
25019
|
-
const [deleteOpen, setDeleteOpen] =
|
|
25117
|
+
const [renameValue, setRenameValue] = useState107(assistant.title);
|
|
25118
|
+
const [renameOpen, setRenameOpen] = useState107(false);
|
|
25119
|
+
const [deleteOpen, setDeleteOpen] = useState107(false);
|
|
25020
25120
|
const handleRename = /* @__PURE__ */ __name(async () => {
|
|
25021
25121
|
const trimmed = renameValue.trim() || assistant.title;
|
|
25022
25122
|
await onRename(trimmed);
|
|
@@ -25069,7 +25169,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete, renamePlaceholde
|
|
|
25069
25169
|
__name(AssistantThreadHeader, "AssistantThreadHeader");
|
|
25070
25170
|
|
|
25071
25171
|
// src/features/assistant/components/containers/AssistantContainer.tsx
|
|
25072
|
-
import { Fragment as
|
|
25172
|
+
import { Fragment as Fragment55, jsx as jsx281, jsxs as jsxs165 } from "react/jsx-runtime";
|
|
25073
25173
|
function AssistantContainer({
|
|
25074
25174
|
renderApprovalAction,
|
|
25075
25175
|
renderMention,
|
|
@@ -25097,7 +25197,7 @@ function AssistantContainer({
|
|
|
25097
25197
|
),
|
|
25098
25198
|
[ctx.threads, ctx.assistant?.id, ctx.selectThread, renderThreadBadge]
|
|
25099
25199
|
);
|
|
25100
|
-
const thread = /* @__PURE__ */ jsx281(
|
|
25200
|
+
const thread = /* @__PURE__ */ jsx281(Fragment55, { children: !showThread ? /* @__PURE__ */ jsx281(
|
|
25101
25201
|
AssistantEmptyState,
|
|
25102
25202
|
{
|
|
25103
25203
|
onSend: ctx.sendMessage,
|
|
@@ -25105,7 +25205,7 @@ function AssistantContainer({
|
|
|
25105
25205
|
onOperatorModeChange: showOperatorToggle ? ctx.setOperatorMode : void 0,
|
|
25106
25206
|
composerLeading: renderScopePicker?.()
|
|
25107
25207
|
}
|
|
25108
|
-
) : /* @__PURE__ */ jsxs165(
|
|
25208
|
+
) : /* @__PURE__ */ jsxs165(Fragment55, { children: [
|
|
25109
25209
|
ctx.assistant ? /* @__PURE__ */ jsx281(
|
|
25110
25210
|
AssistantThreadHeader,
|
|
25111
25211
|
{
|
|
@@ -25168,7 +25268,7 @@ import { useTranslations as useTranslations146 } from "next-intl";
|
|
|
25168
25268
|
// src/features/assistant/components/parts/AssistantBlockNoteComposer.tsx
|
|
25169
25269
|
import { ArrowUp as ArrowUp2 } from "lucide-react";
|
|
25170
25270
|
import { useTranslations as useTranslations145 } from "next-intl";
|
|
25171
|
-
import { useCallback as useCallback51, useId as useId5, useState as
|
|
25271
|
+
import { useCallback as useCallback51, useId as useId5, useState as useState108 } from "react";
|
|
25172
25272
|
import { jsx as jsx282, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
25173
25273
|
function flattenBlocks(blocks) {
|
|
25174
25274
|
const lines = [];
|
|
@@ -25206,9 +25306,9 @@ function AssistantBlockNoteComposer({
|
|
|
25206
25306
|
}) {
|
|
25207
25307
|
const t = useTranslations145();
|
|
25208
25308
|
const editorId = useId5().replace(/[^a-zA-Z0-9]/g, "");
|
|
25209
|
-
const [blocks, setBlocks] =
|
|
25210
|
-
const [isEmpty, setIsEmpty] =
|
|
25211
|
-
const [resetKey, setResetKey] =
|
|
25309
|
+
const [blocks, setBlocks] = useState108([]);
|
|
25310
|
+
const [isEmpty, setIsEmpty] = useState108(true);
|
|
25311
|
+
const [resetKey, setResetKey] = useState108(0);
|
|
25212
25312
|
const canSend = !isEmpty && !disabled;
|
|
25213
25313
|
const submit = useCallback51(async () => {
|
|
25214
25314
|
if (isEmpty || disabled) return;
|
|
@@ -25261,7 +25361,7 @@ function AssistantBlockNoteComposer({
|
|
|
25261
25361
|
__name(AssistantBlockNoteComposer, "AssistantBlockNoteComposer");
|
|
25262
25362
|
|
|
25263
25363
|
// src/features/assistant/components/containers/AssistantPageContainer.tsx
|
|
25264
|
-
import { Fragment as
|
|
25364
|
+
import { Fragment as Fragment56, jsx as jsx283, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
25265
25365
|
function AssistantPageContainer({
|
|
25266
25366
|
renderApprovalAction,
|
|
25267
25367
|
renderMention,
|
|
@@ -25299,7 +25399,7 @@ function AssistantPageContainer({
|
|
|
25299
25399
|
) })
|
|
25300
25400
|
),
|
|
25301
25401
|
children: /* @__PURE__ */ jsxs167("div", { className: "bg-background flex h-full w-full flex-col overflow-hidden rounded-lg border", children: [
|
|
25302
|
-
showThread ? /* @__PURE__ */ jsxs167(
|
|
25402
|
+
showThread ? /* @__PURE__ */ jsxs167(Fragment56, { children: [
|
|
25303
25403
|
ctx.assistant ? /* @__PURE__ */ jsx283(
|
|
25304
25404
|
AssistantThreadHeader,
|
|
25305
25405
|
{
|
|
@@ -25346,7 +25446,7 @@ __name(AssistantPageContainer, "AssistantPageContainer");
|
|
|
25346
25446
|
// src/features/assistant-action/components/ApprovalActionCard.tsx
|
|
25347
25447
|
import { ShieldAlert as ShieldAlert2 } from "lucide-react";
|
|
25348
25448
|
import { useTranslations as useTranslations147 } from "next-intl";
|
|
25349
|
-
import { Fragment as
|
|
25449
|
+
import { Fragment as Fragment57, useEffect as useEffect78, useMemo as useMemo59, useState as useState109 } from "react";
|
|
25350
25450
|
import { jsx as jsx284, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
25351
25451
|
var STATUS_VARIANT2 = {
|
|
25352
25452
|
pending: "softBlue",
|
|
@@ -25538,13 +25638,13 @@ function parseLegacyProposal(toolArgs) {
|
|
|
25538
25638
|
__name(parseLegacyProposal, "parseLegacyProposal");
|
|
25539
25639
|
function ApprovalActionCard({ actionId, summary, onResolved, hiddenRelationshipKeys }) {
|
|
25540
25640
|
const t = useTranslations147();
|
|
25541
|
-
const [status, setStatus] =
|
|
25542
|
-
const [actionSummary, setActionSummary] =
|
|
25543
|
-
const [toolName, setToolName] =
|
|
25544
|
-
const [toolArgs, setToolArgs] =
|
|
25545
|
-
const [actionProposal, setActionProposal] =
|
|
25546
|
-
const [busy, setBusy] =
|
|
25547
|
-
const [failed, setFailed] =
|
|
25641
|
+
const [status, setStatus] = useState109(void 0);
|
|
25642
|
+
const [actionSummary, setActionSummary] = useState109(void 0);
|
|
25643
|
+
const [toolName, setToolName] = useState109(void 0);
|
|
25644
|
+
const [toolArgs, setToolArgs] = useState109(void 0);
|
|
25645
|
+
const [actionProposal, setActionProposal] = useState109(void 0);
|
|
25646
|
+
const [busy, setBusy] = useState109(false);
|
|
25647
|
+
const [failed, setFailed] = useState109(false);
|
|
25548
25648
|
useEffect78(() => {
|
|
25549
25649
|
let cancelled = false;
|
|
25550
25650
|
(async () => {
|
|
@@ -25633,7 +25733,7 @@ function ApprovalActionCard({ actionId, summary, onResolved, hiddenRelationshipK
|
|
|
25633
25733
|
/* @__PURE__ */ jsx284("span", { children: isUpdate ? t("features.assistant.approval.proposal.updateHeading", { entity: entityLabel }) : t("features.assistant.approval.proposal.heading", { entity: entityLabel }) }),
|
|
25634
25734
|
targetLabel !== "" && /* @__PURE__ */ jsx284("span", { className: "text-foreground tracking-normal normal-case", children: targetLabel })
|
|
25635
25735
|
] }),
|
|
25636
|
-
/* @__PURE__ */ jsx284("dl", { className: "grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(0,10rem)_minmax(0,1fr)]", children: rows.map((row) => /* @__PURE__ */ jsxs168(
|
|
25736
|
+
/* @__PURE__ */ jsx284("dl", { className: "grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(0,10rem)_minmax(0,1fr)]", children: rows.map((row) => /* @__PURE__ */ jsxs168(Fragment57, { children: [
|
|
25637
25737
|
/* @__PURE__ */ jsx284("dt", { className: "text-muted-foreground text-xs leading-relaxed break-words sm:text-sm", children: row.label }),
|
|
25638
25738
|
/* @__PURE__ */ jsx284("dd", { className: "text-foreground text-sm leading-relaxed break-words whitespace-pre-wrap", children: row.value })
|
|
25639
25739
|
] }, row.key)) })
|
|
@@ -25715,7 +25815,7 @@ var NotificationErrorBoundary = class extends Component {
|
|
|
25715
25815
|
// src/features/notification/components/containers/NotificationsListContainer.tsx
|
|
25716
25816
|
import { useTranslations as useTranslations152 } from "next-intl";
|
|
25717
25817
|
import { useSearchParams as useSearchParams5 } from "next/navigation";
|
|
25718
|
-
import { useState as
|
|
25818
|
+
import { useState as useState110 } from "react";
|
|
25719
25819
|
|
|
25720
25820
|
// src/features/notification/components/filters/NotificationViewSwitcher.tsx
|
|
25721
25821
|
import { useTranslations as useTranslations149 } from "next-intl";
|
|
@@ -25915,7 +26015,7 @@ function NotificationsListContainerContent() {
|
|
|
25915
26015
|
const searchParams = useSearchParams5();
|
|
25916
26016
|
const { error } = useNotificationContext();
|
|
25917
26017
|
const tabParam = searchParams.get("tab");
|
|
25918
|
-
const [mode, setMode] =
|
|
26018
|
+
const [mode, setMode] = useState110(tabParam === "archived" ? "archived" : "inbox");
|
|
25919
26019
|
if (error) {
|
|
25920
26020
|
return /* @__PURE__ */ jsx290("div", { className: "flex items-center justify-center p-8 text-center", children: /* @__PURE__ */ jsxs171("div", { className: "text-destructive text-xs/relaxed", children: [
|
|
25921
26021
|
/* @__PURE__ */ jsx290("p", { children: t("notification.ui.list.error_loading", { error }) }),
|
|
@@ -25952,7 +26052,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
25952
26052
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
25953
26053
|
import { BellIcon as BellIcon2, ExternalLinkIcon } from "lucide-react";
|
|
25954
26054
|
import { useTranslations as useTranslations153 } from "next-intl";
|
|
25955
|
-
import { Fragment as
|
|
26055
|
+
import { Fragment as Fragment58, useCallback as useCallback52, useEffect as useEffect80, useMemo as useMemo61, useRef as useRef45, useState as useState111 } from "react";
|
|
25956
26056
|
import { jsx as jsx291, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
25957
26057
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
25958
26058
|
const _instanceId = useRef45(Math.random().toString(36).substr(2, 9));
|
|
@@ -25974,7 +26074,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
25974
26074
|
} = useSocketContext();
|
|
25975
26075
|
const t = useTranslations153();
|
|
25976
26076
|
const generateUrl = usePageUrlGenerator();
|
|
25977
|
-
const [newNotifications, setNewNotifications] =
|
|
26077
|
+
const [newNotifications, setNewNotifications] = useState111(false);
|
|
25978
26078
|
const preventAutoClose = useRef45(false);
|
|
25979
26079
|
const circuitBreakerRef = useRef45({
|
|
25980
26080
|
count: 0,
|
|
@@ -26141,7 +26241,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
26141
26241
|
] }),
|
|
26142
26242
|
isLoading && /* @__PURE__ */ jsx291("div", { className: "text-muted-foreground px-3 py-2 text-xs", children: t(`common.loading`) }),
|
|
26143
26243
|
error && /* @__PURE__ */ jsx291("div", { className: "text-destructive px-3 py-2 text-xs", children: error }),
|
|
26144
|
-
/* @__PURE__ */ jsx291(ScrollArea, { className: "[&_[data-slot=scroll-area-scrollbar]]:w-2.5 [&_[data-slot=scroll-area-thumb]]:bg-muted-foreground/40 [&>[data-slot=scroll-area-viewport]]:max-h-[min(32rem,calc(var(--available-height,32rem)-3.5rem))]", children: notifications.length > 0 ? /* @__PURE__ */ jsx291("div", { className: "divide-border divide-y", children: notifications.map((notification) => /* @__PURE__ */ jsx291(
|
|
26244
|
+
/* @__PURE__ */ jsx291(ScrollArea, { className: "[&_[data-slot=scroll-area-scrollbar]]:w-2.5 [&_[data-slot=scroll-area-thumb]]:bg-muted-foreground/40 [&>[data-slot=scroll-area-viewport]]:max-h-[min(32rem,calc(var(--available-height,32rem)-3.5rem))]", children: notifications.length > 0 ? /* @__PURE__ */ jsx291("div", { className: "divide-border divide-y", children: notifications.map((notification) => /* @__PURE__ */ jsx291(Fragment58, { children: generateNotification(notification, () => setIsOpen(false)) }, notification.id)) }) : /* @__PURE__ */ jsx291("div", { className: "text-muted-foreground p-6 text-center text-sm", children: t(`notification.empty`) }) })
|
|
26145
26245
|
] })
|
|
26146
26246
|
] });
|
|
26147
26247
|
}
|
|
@@ -26152,11 +26252,11 @@ function NotificationModal(props) {
|
|
|
26152
26252
|
__name(NotificationModal, "NotificationModal");
|
|
26153
26253
|
|
|
26154
26254
|
// src/features/notification/components/notifications/PushNotificationProvider.tsx
|
|
26155
|
-
import { Fragment as
|
|
26255
|
+
import { Fragment as Fragment59, jsx as jsx292 } from "react/jsx-runtime";
|
|
26156
26256
|
function PushNotificationProvider({ children }) {
|
|
26157
26257
|
const { currentUser, hasRole } = useCurrentUserContext();
|
|
26158
26258
|
usePushNotifications_default({ currentUser: currentUser ?? void 0, canSubscribe: !hasRole(getRoleId().Administrator) });
|
|
26159
|
-
return /* @__PURE__ */ jsx292(
|
|
26259
|
+
return /* @__PURE__ */ jsx292(Fragment59, { children });
|
|
26160
26260
|
}
|
|
26161
26261
|
__name(PushNotificationProvider, "PushNotificationProvider");
|
|
26162
26262
|
|
|
@@ -26206,14 +26306,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
26206
26306
|
|
|
26207
26307
|
// src/features/referral/components/ReferralWidget.tsx
|
|
26208
26308
|
import { Copy as Copy2, Loader2 as Loader26, Mail, Users } from "lucide-react";
|
|
26209
|
-
import { useCallback as useCallback53, useRef as useRef46, useState as
|
|
26309
|
+
import { useCallback as useCallback53, useRef as useRef46, useState as useState114 } from "react";
|
|
26210
26310
|
|
|
26211
26311
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
26212
|
-
import { useState as
|
|
26312
|
+
import { useState as useState112 } from "react";
|
|
26213
26313
|
function useReferralInvite() {
|
|
26214
|
-
const [sending, setSending] =
|
|
26215
|
-
const [error, setError] =
|
|
26216
|
-
const [success, setSuccess] =
|
|
26314
|
+
const [sending, setSending] = useState112(false);
|
|
26315
|
+
const [error, setError] = useState112(null);
|
|
26316
|
+
const [success, setSuccess] = useState112(false);
|
|
26217
26317
|
const sendInvite = /* @__PURE__ */ __name(async (email) => {
|
|
26218
26318
|
if (!isReferralEnabled()) {
|
|
26219
26319
|
return;
|
|
@@ -26235,11 +26335,11 @@ function useReferralInvite() {
|
|
|
26235
26335
|
__name(useReferralInvite, "useReferralInvite");
|
|
26236
26336
|
|
|
26237
26337
|
// src/features/referral/hooks/useReferralStats.ts
|
|
26238
|
-
import { useEffect as useEffect82, useState as
|
|
26338
|
+
import { useEffect as useEffect82, useState as useState113 } from "react";
|
|
26239
26339
|
function useReferralStats() {
|
|
26240
|
-
const [stats, setStats] =
|
|
26241
|
-
const [loading, setLoading] =
|
|
26242
|
-
const [error, setError] =
|
|
26340
|
+
const [stats, setStats] = useState113(null);
|
|
26341
|
+
const [loading, setLoading] = useState113(true);
|
|
26342
|
+
const [error, setError] = useState113(null);
|
|
26243
26343
|
useEffect82(() => {
|
|
26244
26344
|
if (!isReferralEnabled()) {
|
|
26245
26345
|
setLoading(false);
|
|
@@ -26310,8 +26410,8 @@ function ReferralWidget({
|
|
|
26310
26410
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
26311
26411
|
const { stats, loading, error } = useReferralStats();
|
|
26312
26412
|
const { sendInvite, sending } = useReferralInvite();
|
|
26313
|
-
const [email, setEmail] =
|
|
26314
|
-
const [copied, setCopied] =
|
|
26413
|
+
const [email, setEmail] = useState114("");
|
|
26414
|
+
const [copied, setCopied] = useState114(false);
|
|
26315
26415
|
const linkInputRef = useRef46(null);
|
|
26316
26416
|
const config = getReferralConfig();
|
|
26317
26417
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
@@ -26489,11 +26589,11 @@ function RoleDetails() {
|
|
|
26489
26589
|
__name(RoleDetails, "RoleDetails");
|
|
26490
26590
|
|
|
26491
26591
|
// src/features/role/components/containers/RoleContainer.tsx
|
|
26492
|
-
import { Fragment as
|
|
26592
|
+
import { Fragment as Fragment60, jsx as jsx296, jsxs as jsxs175 } from "react/jsx-runtime";
|
|
26493
26593
|
function RoleContainer() {
|
|
26494
26594
|
const { role } = useRoleContext();
|
|
26495
26595
|
if (!role) return null;
|
|
26496
|
-
return /* @__PURE__ */ jsxs175(
|
|
26596
|
+
return /* @__PURE__ */ jsxs175(Fragment60, { children: [
|
|
26497
26597
|
/* @__PURE__ */ jsx296(RoleDetails, {}),
|
|
26498
26598
|
/* @__PURE__ */ jsx296(RoleUsersList, { role })
|
|
26499
26599
|
] });
|
|
@@ -26537,11 +26637,11 @@ __name(FormRoles, "FormRoles");
|
|
|
26537
26637
|
|
|
26538
26638
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
26539
26639
|
import { useTranslations as useTranslations156 } from "next-intl";
|
|
26540
|
-
import { useEffect as useEffect84, useState as
|
|
26541
|
-
import { Fragment as
|
|
26640
|
+
import { useEffect as useEffect84, useState as useState115 } from "react";
|
|
26641
|
+
import { Fragment as Fragment61, jsx as jsx298, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
26542
26642
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
26543
|
-
const [open, setOpen] =
|
|
26544
|
-
const [canRemove, setCanRemove] =
|
|
26643
|
+
const [open, setOpen] = useState115(false);
|
|
26644
|
+
const [canRemove, setCanRemove] = useState115(false);
|
|
26545
26645
|
const t = useTranslations156();
|
|
26546
26646
|
useEffect84(() => {
|
|
26547
26647
|
async function checkCompanyAdminDeletability() {
|
|
@@ -26587,7 +26687,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
26587
26687
|
/* @__PURE__ */ jsx298(DialogTitle, { children: t(`role.remove_user.title`) }),
|
|
26588
26688
|
/* @__PURE__ */ jsx298(DialogDescription, { children: canRemove ? t(`role.remove_user.subtitle_allowed`) : t(`role.remove_user.subtitle_not_allowed`) })
|
|
26589
26689
|
] }),
|
|
26590
|
-
canRemove ? /* @__PURE__ */ jsxs177(
|
|
26690
|
+
canRemove ? /* @__PURE__ */ jsxs177(Fragment61, { children: [
|
|
26591
26691
|
t(`role.remove_user.description_allowed`, { role: roleName, user: user.name }),
|
|
26592
26692
|
/* @__PURE__ */ jsxs177("div", { className: "flex justify-end", children: [
|
|
26593
26693
|
/* @__PURE__ */ jsx298(Button, { className: "me-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`ui.buttons.cancel`) }),
|
|
@@ -26604,7 +26704,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
26604
26704
|
}
|
|
26605
26705
|
)
|
|
26606
26706
|
] })
|
|
26607
|
-
] }) : /* @__PURE__ */ jsx298(
|
|
26707
|
+
] }) : /* @__PURE__ */ jsx298(Fragment61, { children: t(`role.remove_user.description_not_allowed`, { role: roleName, user: user.name }) })
|
|
26608
26708
|
] })
|
|
26609
26709
|
] });
|
|
26610
26710
|
}
|
|
@@ -26613,13 +26713,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
26613
26713
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
26614
26714
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
26615
26715
|
import { useTranslations as useTranslations157 } from "next-intl";
|
|
26616
|
-
import { useCallback as useCallback54, useEffect as useEffect85, useRef as useRef47, useState as
|
|
26617
|
-
import { Fragment as
|
|
26716
|
+
import { useCallback as useCallback54, useEffect as useEffect85, useRef as useRef47, useState as useState116 } from "react";
|
|
26717
|
+
import { Fragment as Fragment62, jsx as jsx299, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
26618
26718
|
function UserRoleAdd({ user, refresh }) {
|
|
26619
|
-
const [open, setOpen] =
|
|
26719
|
+
const [open, setOpen] = useState116(false);
|
|
26620
26720
|
const inputRef = useRef47(null);
|
|
26621
|
-
const [searchTerm, setSearchTerm] =
|
|
26622
|
-
const [roles, setRoles] =
|
|
26721
|
+
const [searchTerm, setSearchTerm] = useState116("");
|
|
26722
|
+
const [roles, setRoles] = useState116([]);
|
|
26623
26723
|
const t = useTranslations157();
|
|
26624
26724
|
const addUserToRole = /* @__PURE__ */ __name(async (role) => {
|
|
26625
26725
|
await RoleService.addUserToRole({
|
|
@@ -26661,7 +26761,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
26661
26761
|
useEffect85(() => {
|
|
26662
26762
|
if (open) searchRoles("");
|
|
26663
26763
|
}, [open]);
|
|
26664
|
-
return /* @__PURE__ */ jsxs178(
|
|
26764
|
+
return /* @__PURE__ */ jsxs178(Fragment62, { children: [
|
|
26665
26765
|
/* @__PURE__ */ jsxs178(Button, { size: "sm", onClick: () => setOpen(true), children: [
|
|
26666
26766
|
/* @__PURE__ */ jsx299(PlusCircle2, { className: "me-3 h-3.5 w-3.5" }),
|
|
26667
26767
|
t(`common.association.label`, {
|
|
@@ -26934,12 +27034,12 @@ __name(OAuthScopeSelector, "OAuthScopeSelector");
|
|
|
26934
27034
|
|
|
26935
27035
|
// src/features/oauth/components/OAuthClientSecretDisplay.tsx
|
|
26936
27036
|
import { useTranslations as useTranslations162 } from "next-intl";
|
|
26937
|
-
import { useState as
|
|
27037
|
+
import { useState as useState117, useCallback as useCallback57 } from "react";
|
|
26938
27038
|
import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
|
|
26939
27039
|
import { jsx as jsx304, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
26940
27040
|
function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
26941
27041
|
const t = useTranslations162();
|
|
26942
|
-
const [copied, setCopied] =
|
|
27042
|
+
const [copied, setCopied] = useState117(false);
|
|
26943
27043
|
const handleCopy = useCallback57(async () => {
|
|
26944
27044
|
try {
|
|
26945
27045
|
await navigator.clipboard.writeText(secret);
|
|
@@ -27137,7 +27237,7 @@ __name(OAuthClientList, "OAuthClientList");
|
|
|
27137
27237
|
|
|
27138
27238
|
// src/features/oauth/components/OAuthClientForm.tsx
|
|
27139
27239
|
import { useTranslations as useTranslations165 } from "next-intl";
|
|
27140
|
-
import { useState as
|
|
27240
|
+
import { useState as useState118, useCallback as useCallback58 } from "react";
|
|
27141
27241
|
import { jsx as jsx307, jsxs as jsxs184 } from "react/jsx-runtime";
|
|
27142
27242
|
function OAuthClientForm({
|
|
27143
27243
|
client,
|
|
@@ -27149,14 +27249,14 @@ function OAuthClientForm({
|
|
|
27149
27249
|
}) {
|
|
27150
27250
|
const t = useTranslations165();
|
|
27151
27251
|
const isEditMode = !!client;
|
|
27152
|
-
const [formState, setFormState] =
|
|
27252
|
+
const [formState, setFormState] = useState118({
|
|
27153
27253
|
name: client?.name || "",
|
|
27154
27254
|
description: client?.description || "",
|
|
27155
27255
|
redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
|
|
27156
27256
|
allowedScopes: client ? client.allowedScopes || [] : defaultScopes,
|
|
27157
27257
|
isConfidential: client?.isConfidential ?? true
|
|
27158
27258
|
});
|
|
27159
|
-
const [errors, setErrors] =
|
|
27259
|
+
const [errors, setErrors] = useState118({});
|
|
27160
27260
|
const validate = useCallback58(() => {
|
|
27161
27261
|
const newErrors = {};
|
|
27162
27262
|
if (!formState.name.trim()) {
|
|
@@ -27284,9 +27384,9 @@ __name(OAuthClientForm, "OAuthClientForm");
|
|
|
27284
27384
|
|
|
27285
27385
|
// src/features/oauth/components/OAuthClientDetail.tsx
|
|
27286
27386
|
import { useTranslations as useTranslations166 } from "next-intl";
|
|
27287
|
-
import { useState as
|
|
27387
|
+
import { useState as useState119, useCallback as useCallback59 } from "react";
|
|
27288
27388
|
import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
|
|
27289
|
-
import { Fragment as
|
|
27389
|
+
import { Fragment as Fragment63, jsx as jsx308, jsxs as jsxs185 } from "react/jsx-runtime";
|
|
27290
27390
|
function OAuthClientDetail({
|
|
27291
27391
|
client,
|
|
27292
27392
|
isLoading = false,
|
|
@@ -27297,11 +27397,11 @@ function OAuthClientDetail({
|
|
|
27297
27397
|
const t = useTranslations166();
|
|
27298
27398
|
const locale = useI18nLocale();
|
|
27299
27399
|
const scopeText = useOAuthScopeText();
|
|
27300
|
-
const [copiedField, setCopiedField] =
|
|
27301
|
-
const [showDeleteConfirm, setShowDeleteConfirm] =
|
|
27302
|
-
const [showRegenerateConfirm, setShowRegenerateConfirm] =
|
|
27303
|
-
const [isDeleting, setIsDeleting] =
|
|
27304
|
-
const [isRegenerating, setIsRegenerating] =
|
|
27400
|
+
const [copiedField, setCopiedField] = useState119(null);
|
|
27401
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState119(false);
|
|
27402
|
+
const [showRegenerateConfirm, setShowRegenerateConfirm] = useState119(false);
|
|
27403
|
+
const [isDeleting, setIsDeleting] = useState119(false);
|
|
27404
|
+
const [isRegenerating, setIsRegenerating] = useState119(false);
|
|
27305
27405
|
const copyToClipboard2 = useCallback59(async (text, field) => {
|
|
27306
27406
|
try {
|
|
27307
27407
|
await navigator.clipboard.writeText(text);
|
|
@@ -27332,7 +27432,7 @@ function OAuthClientDetail({
|
|
|
27332
27432
|
}
|
|
27333
27433
|
}, [onRegenerateSecret]);
|
|
27334
27434
|
const createdDate = client.createdAt ? new Date(client.createdAt).toLocaleDateString(locale, { dateStyle: "long" }) : t("oauth.ui.card.unknown");
|
|
27335
|
-
return /* @__PURE__ */ jsxs185(
|
|
27435
|
+
return /* @__PURE__ */ jsxs185(Fragment63, { children: [
|
|
27336
27436
|
/* @__PURE__ */ jsxs185(Card, { children: [
|
|
27337
27437
|
/* @__PURE__ */ jsx308(CardHeader, { children: /* @__PURE__ */ jsxs185("div", { className: "flex items-start justify-between", children: [
|
|
27338
27438
|
/* @__PURE__ */ jsxs185("div", { children: [
|
|
@@ -27541,7 +27641,7 @@ function OAuthCompanySelector({ companies, value, onChange }) {
|
|
|
27541
27641
|
__name(OAuthCompanySelector, "OAuthCompanySelector");
|
|
27542
27642
|
|
|
27543
27643
|
// src/features/oauth/components/consent/OAuthConsentScreen.tsx
|
|
27544
|
-
import { Fragment as
|
|
27644
|
+
import { Fragment as Fragment64, jsx as jsx313, jsxs as jsxs190 } from "react/jsx-runtime";
|
|
27545
27645
|
function OAuthConsentScreen({
|
|
27546
27646
|
params,
|
|
27547
27647
|
logoUrl,
|
|
@@ -27575,7 +27675,7 @@ function OAuthConsentScreen({
|
|
|
27575
27675
|
/* @__PURE__ */ jsx313(Separator, {}),
|
|
27576
27676
|
/* @__PURE__ */ jsx313(OAuthScopeList, { scopes }),
|
|
27577
27677
|
/* @__PURE__ */ jsx313(Separator, {}),
|
|
27578
|
-
companies.length > 1 && /* @__PURE__ */ jsxs190(
|
|
27678
|
+
companies.length > 1 && /* @__PURE__ */ jsxs190(Fragment64, { children: [
|
|
27579
27679
|
/* @__PURE__ */ jsx313(OAuthCompanySelector, { companies, value: companyId, onChange: setCompanyId }),
|
|
27580
27680
|
/* @__PURE__ */ jsx313(Separator, {})
|
|
27581
27681
|
] }),
|
|
@@ -27606,7 +27706,7 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
|
|
|
27606
27706
|
import { zodResolver as zodResolver12 } from "@hookform/resolvers/zod";
|
|
27607
27707
|
import { CheckCircle, Mail as Mail2 } from "lucide-react";
|
|
27608
27708
|
import { useTranslations as useTranslations172 } from "next-intl";
|
|
27609
|
-
import { useState as
|
|
27709
|
+
import { useState as useState120 } from "react";
|
|
27610
27710
|
import { useForm as useForm12 } from "react-hook-form";
|
|
27611
27711
|
import { v4 as v414 } from "uuid";
|
|
27612
27712
|
import { z as z13 } from "zod";
|
|
@@ -27705,11 +27805,11 @@ function WaitlistQuestionnaireRenderer({
|
|
|
27705
27805
|
__name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
|
|
27706
27806
|
|
|
27707
27807
|
// src/features/waitlist/components/forms/WaitlistForm.tsx
|
|
27708
|
-
import { Fragment as
|
|
27808
|
+
import { Fragment as Fragment65, jsx as jsx315, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
27709
27809
|
function WaitlistForm({ onSuccess }) {
|
|
27710
27810
|
const t = useTranslations172();
|
|
27711
|
-
const [isSubmitting, setIsSubmitting] =
|
|
27712
|
-
const [isSuccess, setIsSuccess] =
|
|
27811
|
+
const [isSubmitting, setIsSubmitting] = useState120(false);
|
|
27812
|
+
const [isSuccess, setIsSuccess] = useState120(false);
|
|
27713
27813
|
const config = getWaitlistConfig();
|
|
27714
27814
|
const questionnaireFields = config.questionnaire ?? [];
|
|
27715
27815
|
const questionnaireSchema = questionnaireFields.reduce(
|
|
@@ -27825,7 +27925,7 @@ function WaitlistForm({ onSuccess }) {
|
|
|
27825
27925
|
{
|
|
27826
27926
|
form,
|
|
27827
27927
|
id: "gdprConsent",
|
|
27828
|
-
label: /* @__PURE__ */ jsxs192(
|
|
27928
|
+
label: /* @__PURE__ */ jsxs192(Fragment65, { children: [
|
|
27829
27929
|
t("auth.gdpr.terms_prefix"),
|
|
27830
27930
|
/* @__PURE__ */ jsx315(Link, { href: "/terms", target: "_blank", rel: "noopener", children: t("auth.gdpr.terms_of_service") }),
|
|
27831
27931
|
t("auth.gdpr.and"),
|
|
@@ -27890,12 +27990,12 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
|
27890
27990
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
27891
27991
|
import { CheckCircle as CheckCircle4, Loader2 as Loader28, XCircle as XCircle2 } from "lucide-react";
|
|
27892
27992
|
import { useTranslations as useTranslations174 } from "next-intl";
|
|
27893
|
-
import { useEffect as useEffect86, useState as
|
|
27993
|
+
import { useEffect as useEffect86, useState as useState121 } from "react";
|
|
27894
27994
|
import { jsx as jsx318, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
27895
27995
|
function WaitlistConfirmation({ code }) {
|
|
27896
27996
|
const t = useTranslations174();
|
|
27897
|
-
const [state, setState] =
|
|
27898
|
-
const [errorMessage, setErrorMessage] =
|
|
27997
|
+
const [state, setState] = useState121("loading");
|
|
27998
|
+
const [errorMessage, setErrorMessage] = useState121("");
|
|
27899
27999
|
useEffect86(() => {
|
|
27900
28000
|
async function confirmEmail() {
|
|
27901
28001
|
try {
|
|
@@ -27935,12 +28035,12 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
|
27935
28035
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
27936
28036
|
import { RefreshCw as RefreshCw4 } from "lucide-react";
|
|
27937
28037
|
import { useTranslations as useTranslations175 } from "next-intl";
|
|
27938
|
-
import { useCallback as useCallback60, useEffect as useEffect87, useMemo as useMemo63, useState as
|
|
28038
|
+
import { useCallback as useCallback60, useEffect as useEffect87, useMemo as useMemo63, useState as useState122 } from "react";
|
|
27939
28039
|
import { jsx as jsx319, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
27940
28040
|
function WaitlistList({ fullWidth } = {}) {
|
|
27941
28041
|
const t = useTranslations175();
|
|
27942
|
-
const [statusFilter, setStatusFilter] =
|
|
27943
|
-
const [stats, setStats] =
|
|
28042
|
+
const [statusFilter, setStatusFilter] = useState122("all");
|
|
28043
|
+
const [stats, setStats] = useState122(void 0);
|
|
27944
28044
|
const data = useDataListRetriever({
|
|
27945
28045
|
retriever: /* @__PURE__ */ __name((params) => WaitlistService.findMany(params), "retriever"),
|
|
27946
28046
|
retrieverParams: {},
|
|
@@ -28037,7 +28137,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
28037
28137
|
// src/features/rbac/components/RbacContainer.tsx
|
|
28038
28138
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
28039
28139
|
import { useTranslations as useTranslations177 } from "next-intl";
|
|
28040
|
-
import { memo as memo2, useCallback as useCallback62, useEffect as useEffect89, useMemo as useMemo64, useRef as useRef48, useState as
|
|
28140
|
+
import { memo as memo2, useCallback as useCallback62, useEffect as useEffect89, useMemo as useMemo64, useRef as useRef48, useState as useState124 } from "react";
|
|
28041
28141
|
|
|
28042
28142
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
28043
28143
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
|
|
@@ -28118,8 +28218,8 @@ __name(RbacPermissionCell, "RbacPermissionCell");
|
|
|
28118
28218
|
import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
|
|
28119
28219
|
import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon13 } from "lucide-react";
|
|
28120
28220
|
import { useTranslations as useTranslations176 } from "next-intl";
|
|
28121
|
-
import { useCallback as useCallback61, useEffect as useEffect88, useState as
|
|
28122
|
-
import { Fragment as
|
|
28221
|
+
import { useCallback as useCallback61, useEffect as useEffect88, useState as useState123 } from "react";
|
|
28222
|
+
import { Fragment as Fragment66, jsx as jsx321, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
28123
28223
|
function RbacPermissionPicker({
|
|
28124
28224
|
open,
|
|
28125
28225
|
anchor,
|
|
@@ -28131,7 +28231,7 @@ function RbacPermissionPicker({
|
|
|
28131
28231
|
onClose
|
|
28132
28232
|
}) {
|
|
28133
28233
|
const t = useTranslations176();
|
|
28134
|
-
const [customSegment, setCustomSegment] =
|
|
28234
|
+
const [customSegment, setCustomSegment] = useState123("");
|
|
28135
28235
|
useEffect88(() => {
|
|
28136
28236
|
if (!open) setCustomSegment("");
|
|
28137
28237
|
}, [open]);
|
|
@@ -28205,7 +28305,7 @@ function RbacPermissionPicker({
|
|
|
28205
28305
|
)
|
|
28206
28306
|
] })
|
|
28207
28307
|
] }),
|
|
28208
|
-
isRoleColumn && onClear && /* @__PURE__ */ jsxs198(
|
|
28308
|
+
isRoleColumn && onClear && /* @__PURE__ */ jsxs198(Fragment66, { children: [
|
|
28209
28309
|
/* @__PURE__ */ jsx321(Separator, {}),
|
|
28210
28310
|
/* @__PURE__ */ jsxs198(
|
|
28211
28311
|
Button,
|
|
@@ -28380,8 +28480,8 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
|
|
|
28380
28480
|
function RbacContainer() {
|
|
28381
28481
|
const t = useTranslations177();
|
|
28382
28482
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
28383
|
-
const [selectedModuleId, setSelectedModuleId] =
|
|
28384
|
-
const [activePicker, setActivePicker] =
|
|
28483
|
+
const [selectedModuleId, setSelectedModuleId] = useState124(null);
|
|
28484
|
+
const [activePicker, setActivePicker] = useState124(null);
|
|
28385
28485
|
const openPicker = useCallback62((picker) => {
|
|
28386
28486
|
setActivePicker(picker);
|
|
28387
28487
|
}, []);
|
|
@@ -28492,7 +28592,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
28492
28592
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
28493
28593
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
28494
28594
|
import { useTranslations as useTranslations178 } from "next-intl";
|
|
28495
|
-
import { Fragment as
|
|
28595
|
+
import { Fragment as Fragment67, memo as memo3, useCallback as useCallback63, useEffect as useEffect90, useMemo as useMemo65, useRef as useRef49, useState as useState125 } from "react";
|
|
28496
28596
|
import { jsx as jsx323, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
28497
28597
|
function findToken2(tokens, action) {
|
|
28498
28598
|
if (!tokens) return void 0;
|
|
@@ -28530,8 +28630,8 @@ var ACTION_LABEL_KEYS2 = {
|
|
|
28530
28630
|
function RbacByRoleContainer() {
|
|
28531
28631
|
const t = useTranslations178();
|
|
28532
28632
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
28533
|
-
const [selectedRoleId, setSelectedRoleId] =
|
|
28534
|
-
const [activePicker, setActivePicker] =
|
|
28633
|
+
const [selectedRoleId, setSelectedRoleId] = useState125(null);
|
|
28634
|
+
const [activePicker, setActivePicker] = useState125(null);
|
|
28535
28635
|
const openPicker = useCallback63((picker) => {
|
|
28536
28636
|
setActivePicker(picker);
|
|
28537
28637
|
}, []);
|
|
@@ -28618,7 +28718,7 @@ function RbacByRoleContainer() {
|
|
|
28618
28718
|
const defaultTokens = block.default ?? [];
|
|
28619
28719
|
const roleTokens = block[selectedRoleId];
|
|
28620
28720
|
const moduleLabel = moduleNames?.[moduleId] ?? moduleId;
|
|
28621
|
-
return /* @__PURE__ */ jsxs200(
|
|
28721
|
+
return /* @__PURE__ */ jsxs200(Fragment67, { children: [
|
|
28622
28722
|
/* @__PURE__ */ jsx323("tr", { className: "border-b bg-muted/40", children: /* @__PURE__ */ jsx323(
|
|
28623
28723
|
"td",
|
|
28624
28724
|
{
|
|
@@ -29276,6 +29376,8 @@ export {
|
|
|
29276
29376
|
subscriptionDiscount,
|
|
29277
29377
|
applyDiscount,
|
|
29278
29378
|
CouponRefresher,
|
|
29379
|
+
parseOptionalPositiveInt,
|
|
29380
|
+
parseOptionalDecimal,
|
|
29279
29381
|
optionalPositiveInt,
|
|
29280
29382
|
optionalDecimal,
|
|
29281
29383
|
optionalDate,
|
|
@@ -29292,4 +29394,4 @@ export {
|
|
|
29292
29394
|
useOAuthClients,
|
|
29293
29395
|
useOAuthClient
|
|
29294
29396
|
};
|
|
29295
|
-
//# sourceMappingURL=chunk-
|
|
29397
|
+
//# sourceMappingURL=chunk-CFB6FHIY.mjs.map
|