Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

254 lines
8.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Extracted from browser-delivered Turbopack chunk: 2cd465e94e439d21.d295534e06.js
* Module id: 212546
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(325528),
r = e.i(396805),
o = e.i(505e3);
e.i(135623);
var n = e.i(168823);
let i = (0, r.createWithEqualityFn)(() => ({ exportWidthAIWaterMark: -1 }));
function a() {
let e = (0, n.getCookie)(o.USER_TOKEN_COOKIE_KEY);
return "string" == typeof e ? e : "";
}
async function s(e) {
try {
let r = e || a();
if (!r) return;
let o = await fetch(
`${t.config.apiHost}/api/www/user/remove-watermark/get`,
{
method: "POST",
headers: {
Accept: "application/json, text/plain, */*",
"Content-Type": "application/json",
token: r,
},
},
);
if (!o.ok) return;
let n = await o.json(),
s = n?.data?.removeWatermark;
(-1 === s || 0 === s || 1 === s) &&
i.setState({ exportWidthAIWaterMark: s });
} catch (e) {
console.error("[initWatermarkPreference] 初始化失败:", e);
}
}
async function l(e) {
i.setState({ exportWidthAIWaterMark: e });
try {
let r = a();
if (!r) return;
await fetch(`${t.config.apiHost}/api/www/user/remove-watermark/set`, {
method: "POST",
headers: {
Accept: "application/json, text/plain, */*",
"Content-Type": "application/json",
token: r,
},
body: JSON.stringify({ removeWatermark: e }),
});
} catch (e) {
console.error("[setWatermarkPreference] 同步后端失败:", e);
}
}
function c() {
return i.getState().exportWidthAIWaterMark;
}
e.s(
[
"getWatermarkPreference",
() => c,
"initWatermarkPreference",
() => s,
"setWatermarkPreference",
() => l,
],
840984,
);
var u = e.i(462214),
d = e.i(358379),
f = e.i(524961),
p = e.i(734911),
g = e.i(384916);
let m = null;
function h(e) {
m = e;
}
async function b() {
return (await s(), m)
? m.open()
: (console.error(
"[openWatermarkSettingModal] WatermarkSettingModal 未挂载",
),
null);
}
let y = (0, d.forwardRef)((e, t) => {
let [r, o] = (0, d.useState)(!1),
[n, i] = (0, d.useState)(!1),
[a, s] = (0, d.useState)(null),
m = (0, d.useCallback)(
() => (
i(1 === c()),
o(!0),
new Promise((e) => {
s(() => e);
})
),
[],
),
h = (0, d.useCallback)(
(e) => {
o(!1), a?.(e), s(null);
},
[a],
),
b = (0, d.useCallback)(async () => {
let e = +!!n;
h(e), await l(e);
}, [n, h]),
y = (0, d.useCallback)(() => {
h(null);
}, [h]);
return (
(0, d.useImperativeHandle)(t, () => ({ open: m })),
(0, u.jsx)(p.Modal, {
opened: r,
onClose: y,
title: "AI 生成内容水印管理规则",
centered: !0,
withCloseButton: !1,
closeOnClickOutside: !1,
closeOnEscape: !1,
size: 740,
styles: {
overlay: { zIndex: 800 },
inner: { zIndex: 801 },
content: { borderRadius: 24, backgroundColor: "var(--bg-surface)" },
header: {
padding: 24,
paddingBottom: 8,
backgroundColor: "transparent",
},
title: {
fontSize: 18,
fontWeight: 500,
color: "var(--fg-default)",
},
body: { padding: 24, paddingTop: 0 },
},
children: (0, u.jsxs)("div", {
className: "text-fg-secondary",
children: [
(0, u.jsxs)("div", {
className: "max-h-[500px] overflow-y-auto text-xs leading-5",
children: [
(0, u.jsx)("p", {
children: "欢迎您使用LiblibAI的产品和服务!",
}),
(0, u.jsx)("p", {
className: "indent-8",
children:
'您申请我们向您提供没有添加显式标识(以下或称"水印")的AI生成合成内容之前,亦即您使用"去水印"功能之前,请您务必认真阅读并充分理解本规则。您知悉、同意并遵守以下内容的,方可使用本功能。',
}),
(0, u.jsxs)("p", {
className: "indent-8",
children: [
"经您提出申请,LiblibAI平台可向您提供未添加前述显式标识的AI生成合成内容。请注意:您在使用网络信息内容传播服务发布该等AI生成合成内容时,需主动作出声明,并通过传播LiblibAI平台提供的标识功能完成标识操作。您确认已知晓并承诺:若您未依据法律法规要求在AI生成合成内容中添加显式标识,进而引发公众混淆或误认,由此产生的全部后果及法律责任均由您自行承担。更详细的说明见",
(0, u.jsx)("a", {
href: "https://liblibai.feishu.cn/docx/WpIqdL8fToZJJcxJ5cpcHzIgnEL",
target: "_blank",
rel: "noopener noreferrer",
className: "cursor-pointer text-[#1F6DFF] underline",
children: "LiblibAI水印规范",
}),
"。",
],
}),
(0, u.jsx)("p", {
className: "indent-8",
children:
'当您开启"去除水印"功能开关后,您通过本账号创作、生成的AI生成合成内容,将不再添加"AI生成"明水印。',
}),
],
}),
(0, u.jsxs)("div", {
className: "mt-6 flex items-center gap-3",
children: [
(0, u.jsx)(g.Switch, {
checked: n,
onChange: (e) => {
i(e.currentTarget.checked);
},
}),
(0, u.jsx)("div", {
className: "text-fg-default text-sm font-medium",
children: "去 AI 水印",
}),
],
}),
(0, u.jsx)("div", {
className: "mt-2 text-xs opacity-60",
children:
'开启本功能开关并点击 "保存设置" 按钮,即视为您已充分知悉并同意本规则全部内容。后续您可通过 "头像 - AI水印设置" 路径调整本功能配置。',
}),
(0, u.jsx)("div", {
className: "mt-8 flex justify-end",
children: (0, u.jsx)(f.Button, {
radius: 8,
style: {
height: 44,
paddingLeft: 32,
paddingRight: 32,
backgroundColor: "#1F6DFF",
fontSize: 16,
fontWeight: 500,
},
onClick: () => void b(),
children: "保存设置",
}),
}),
],
}),
})
);
});
async function x() {
let e = c();
return 0 === e || 1 === e ? e : b();
}
function v() {
let e = (0, d.useRef)(null);
return (
(0, d.useEffect)(() => {
e.current && (m = e.current);
}, []),
(0, u.jsx)(y, { ref: e })
);
}
(y.displayName = "WatermarkSettingModal"),
e.s(
[
"default",
0,
y,
"openWatermarkSettingModal",
() => b,
"setWatermarkModalRef",
() => h,
],
579959,
),
e.s(["ensureWatermarkPreference", () => x], 317286),
e.s(["default", () => v], 212546),
e.s([], 204347);
};
export default moduleFactory;