@ezychat/web 0.1.53 → 0.1.54
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-lib/chunks/{admin--JrgNbTg.js → admin-8p_RQIvq.js} +23 -15
- package/dist-lib/chunks/{admin-DW7w-AN8.js → admin-Bsz90faH.js} +23 -15
- package/dist-lib/ezychat-web.css +1 -1
- package/dist-lib/index.js +775 -716
- package/dist-lib/types/api/queries.d.ts +3 -0
- package/dist-lib/types/i18n/resources.d.ts +10 -2
- package/package.json +2 -2
package/dist-lib/index.js
CHANGED
|
@@ -343,11 +343,17 @@ var Gr = {
|
|
|
343
343
|
turnedOff: "AI assistant access turned off"
|
|
344
344
|
},
|
|
345
345
|
connectApp: {
|
|
346
|
-
title: "Connect
|
|
347
|
-
|
|
348
|
-
|
|
346
|
+
title: "Connect an AI app",
|
|
347
|
+
recommended: "Recommended",
|
|
348
|
+
apps: "claude.ai, ChatGPT or Claude Desktop",
|
|
349
|
+
step1: "In your AI app, add a custom connector.",
|
|
350
|
+
step2: "Paste this address:",
|
|
351
|
+
step3: "{{product}} opens. Sign in and click Approve.",
|
|
352
|
+
noToken: "You do not need a token. The app then shows under Connected apps.",
|
|
349
353
|
copy: "Copy address",
|
|
350
|
-
needsTunnel: "claude.ai and ChatGPT run in the cloud, so they need the tunnel address. Turn on Phone access first."
|
|
354
|
+
needsTunnel: "claude.ai and ChatGPT run in the cloud, so they need the tunnel address. Turn on Phone access first.",
|
|
355
|
+
developerToggle: "For developer tools (Claude Code, Gemini CLI, Cursor, scripts): use an access token",
|
|
356
|
+
developerBody: "Use this only if your tool asks for a token or an \"Authorization\" header. Create a token, then paste it into the tool. Keep it private: anyone with it can read the inbox."
|
|
351
357
|
},
|
|
352
358
|
noTunnel: {
|
|
353
359
|
title: "No tunnel is running",
|
|
@@ -355,24 +361,26 @@ var Gr = {
|
|
|
355
361
|
link: "Open Phone access"
|
|
356
362
|
},
|
|
357
363
|
tokens: {
|
|
358
|
-
title: "
|
|
359
|
-
description: "
|
|
364
|
+
title: "Connected apps",
|
|
365
|
+
description: "Every AI app or token that can use this inbox. Remove one to disconnect it.",
|
|
360
366
|
create: "Create token",
|
|
361
|
-
empty: "No
|
|
367
|
+
empty: "No apps connected yet.",
|
|
362
368
|
created: "Created {{date}}",
|
|
363
369
|
lastUsed: "Used {{when}}",
|
|
364
370
|
neverUsed: "Never used",
|
|
365
371
|
expires: "Expires {{date}}",
|
|
366
372
|
neverExpires: "Never expires",
|
|
367
373
|
expired: "Expired {{date}}",
|
|
368
|
-
revoke: "
|
|
369
|
-
revokeLabel: "
|
|
370
|
-
revokeTitle: "
|
|
371
|
-
revokeBody: "
|
|
372
|
-
revokeConfirm: "
|
|
373
|
-
revoked: "
|
|
374
|
+
revoke: "Remove",
|
|
375
|
+
revokeLabel: "Remove {{name}}",
|
|
376
|
+
revokeTitle: "Remove “{{name}}”?",
|
|
377
|
+
revokeBody: "The app or tool stops working with this inbox right away. To use it again, connect it again.",
|
|
378
|
+
revokeConfirm: "Remove",
|
|
379
|
+
revoked: "Removed",
|
|
374
380
|
canSendBadge: "Can send",
|
|
375
|
-
canNewBadge: "New numbers"
|
|
381
|
+
canNewBadge: "New numbers",
|
|
382
|
+
signedInBadge: "Signed in",
|
|
383
|
+
tokenBadge: "Token"
|
|
376
384
|
},
|
|
377
385
|
create: {
|
|
378
386
|
title: "Create access token",
|
|
@@ -413,7 +421,7 @@ var Gr = {
|
|
|
413
421
|
copyUrl: "Copy URL",
|
|
414
422
|
copyHeader: "Copy header",
|
|
415
423
|
otherHint: "Use these in any MCP app that accepts a server URL and a header (for example Codex CLI, Cursor or VS Code).",
|
|
416
|
-
oauthHint: "Apps that sign in by themselves, such as claude.ai and ChatGPT
|
|
424
|
+
oauthHint: "Apps that sign in by themselves, such as claude.ai and ChatGPT, need no token: use the steps under “Connect an AI app” instead.",
|
|
417
425
|
localOnly: "This address works only on the computer running {{product}}. Start a tunnel to connect from elsewhere.",
|
|
418
426
|
askHint: "Then ask things like “Which chats are waiting for a reply?”"
|
|
419
427
|
},
|
|
@@ -1638,13 +1646,13 @@ var Gr = {
|
|
|
1638
1646
|
admin: Gr,
|
|
1639
1647
|
errors: Yr
|
|
1640
1648
|
}, $r = /* #__PURE__ */ Object.assign({
|
|
1641
|
-
"./locales/ms/admin.json": () => import("./chunks/admin-
|
|
1649
|
+
"./locales/ms/admin.json": () => import("./chunks/admin-Bsz90faH.js"),
|
|
1642
1650
|
"./locales/ms/app.json": () => import("./chunks/app-BXBt4xNx.js"),
|
|
1643
1651
|
"./locales/ms/auth.json": () => import("./chunks/auth-BZaZVdYG.js"),
|
|
1644
1652
|
"./locales/ms/common.json": () => import("./chunks/common-C66WoZaM.js"),
|
|
1645
1653
|
"./locales/ms/errors.json": () => import("./chunks/errors-DHAXUg11.js"),
|
|
1646
1654
|
"./locales/ms/inbox.json": () => import("./chunks/inbox-B1klfpnJ.js"),
|
|
1647
|
-
"./locales/zh-CN/admin.json": () => import("./chunks/admin
|
|
1655
|
+
"./locales/zh-CN/admin.json": () => import("./chunks/admin-8p_RQIvq.js"),
|
|
1648
1656
|
"./locales/zh-CN/app.json": () => import("./chunks/app-Zoharwle.js"),
|
|
1649
1657
|
"./locales/zh-CN/auth.json": () => import("./chunks/auth-DYIZVf-5.js"),
|
|
1650
1658
|
"./locales/zh-CN/common.json": () => import("./chunks/common-CEBPnKob.js"),
|
|
@@ -15258,35 +15266,10 @@ function Rx() {
|
|
|
15258
15266
|
]
|
|
15259
15267
|
})
|
|
15260
15268
|
}),
|
|
15261
|
-
o && /* @__PURE__ */
|
|
15262
|
-
|
|
15263
|
-
|
|
15264
|
-
|
|
15265
|
-
className: "mt-1.5",
|
|
15266
|
-
children: e("integrations.connectApp.description")
|
|
15267
|
-
})] }), /* @__PURE__ */ B(b_, {
|
|
15268
|
-
className: "flex min-w-0 flex-col gap-2",
|
|
15269
|
-
children: [
|
|
15270
|
-
/* @__PURE__ */ z("p", {
|
|
15271
|
-
className: "text-sm font-medium",
|
|
15272
|
-
children: e("integrations.connectApp.address")
|
|
15273
|
-
}),
|
|
15274
|
-
/* @__PURE__ */ z("code", {
|
|
15275
|
-
"data-testid": "connect-app-url",
|
|
15276
|
-
className: "rounded-md border bg-muted px-3 py-2.5 font-mono text-xs [overflow-wrap:anywhere]",
|
|
15277
|
-
children: d
|
|
15278
|
-
}),
|
|
15279
|
-
/* @__PURE__ */ z(Ev, {
|
|
15280
|
-
text: d,
|
|
15281
|
-
label: e("integrations.connectApp.copy"),
|
|
15282
|
-
className: "self-start"
|
|
15283
|
-
}),
|
|
15284
|
-
!s && /* @__PURE__ */ z("p", {
|
|
15285
|
-
className: "text-sm text-muted-foreground",
|
|
15286
|
-
children: e("integrations.connectApp.needsTunnel")
|
|
15287
|
-
})
|
|
15288
|
-
]
|
|
15289
|
-
})]
|
|
15269
|
+
o && /* @__PURE__ */ z(zx, {
|
|
15270
|
+
endpoint: d,
|
|
15271
|
+
localOnly: !s,
|
|
15272
|
+
onCreateToken: () => a(!0)
|
|
15290
15273
|
}),
|
|
15291
15274
|
!s && /* @__PURE__ */ B(Y, {
|
|
15292
15275
|
tone: "warning",
|
|
@@ -15299,21 +15282,10 @@ function Rx() {
|
|
|
15299
15282
|
}),
|
|
15300
15283
|
/* @__PURE__ */ B(Q, {
|
|
15301
15284
|
className: "gap-4",
|
|
15302
|
-
children: [/* @__PURE__ */ B(g_, {
|
|
15303
|
-
className: "
|
|
15304
|
-
children:
|
|
15305
|
-
|
|
15306
|
-
children: [/* @__PURE__ */ z(__, { children: e("integrations.tokens.title") }), /* @__PURE__ */ z(v_, {
|
|
15307
|
-
className: "mt-1.5",
|
|
15308
|
-
children: e("integrations.tokens.description")
|
|
15309
|
-
})]
|
|
15310
|
-
}), /* @__PURE__ */ B(K, {
|
|
15311
|
-
size: "touch",
|
|
15312
|
-
className: "md:min-h-9",
|
|
15313
|
-
onClick: () => a(!0),
|
|
15314
|
-
children: [/* @__PURE__ */ z(Dn, { "aria-hidden": !0 }), e("integrations.tokens.create")]
|
|
15315
|
-
})]
|
|
15316
|
-
}), /* @__PURE__ */ z(b_, { children: /* @__PURE__ */ z(zx, {}) })]
|
|
15285
|
+
children: [/* @__PURE__ */ B(g_, { children: [/* @__PURE__ */ z(__, { children: e("integrations.tokens.title") }), /* @__PURE__ */ z(v_, {
|
|
15286
|
+
className: "mt-1.5",
|
|
15287
|
+
children: e("integrations.tokens.description")
|
|
15288
|
+
})] }), /* @__PURE__ */ z(b_, { children: /* @__PURE__ */ z(Bx, {}) })]
|
|
15317
15289
|
}),
|
|
15318
15290
|
/* @__PURE__ */ z(Px, {
|
|
15319
15291
|
open: i,
|
|
@@ -15324,7 +15296,89 @@ function Rx() {
|
|
|
15324
15296
|
]
|
|
15325
15297
|
});
|
|
15326
15298
|
}
|
|
15327
|
-
function zx() {
|
|
15299
|
+
function zx({ endpoint: e, localOnly: t, onCreateToken: n }) {
|
|
15300
|
+
let { t: r } = I("admin"), [i, a] = m(!1), o = u();
|
|
15301
|
+
return /* @__PURE__ */ B(Q, {
|
|
15302
|
+
className: "gap-4",
|
|
15303
|
+
"data-testid": "connect-app-card",
|
|
15304
|
+
children: [/* @__PURE__ */ z(g_, { children: /* @__PURE__ */ z(__, { children: r("integrations.connectApp.title") }) }), /* @__PURE__ */ B(b_, {
|
|
15305
|
+
className: "flex min-w-0 flex-col gap-4",
|
|
15306
|
+
children: [
|
|
15307
|
+
/* @__PURE__ */ B("section", {
|
|
15308
|
+
className: "flex min-w-0 flex-col gap-3",
|
|
15309
|
+
"data-testid": "connect-app-signin",
|
|
15310
|
+
children: [
|
|
15311
|
+
/* @__PURE__ */ B("div", {
|
|
15312
|
+
className: "flex flex-wrap items-center gap-2",
|
|
15313
|
+
children: [/* @__PURE__ */ z(q, { children: r("integrations.connectApp.recommended") }), /* @__PURE__ */ z("h3", {
|
|
15314
|
+
className: "text-sm font-medium",
|
|
15315
|
+
children: r("integrations.connectApp.apps")
|
|
15316
|
+
})]
|
|
15317
|
+
}),
|
|
15318
|
+
/* @__PURE__ */ B("ol", {
|
|
15319
|
+
className: "flex list-decimal flex-col gap-2 ps-5 text-sm",
|
|
15320
|
+
children: [
|
|
15321
|
+
/* @__PURE__ */ z("li", { children: r("integrations.connectApp.step1") }),
|
|
15322
|
+
/* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("div", {
|
|
15323
|
+
className: "flex flex-col gap-2",
|
|
15324
|
+
children: [
|
|
15325
|
+
/* @__PURE__ */ z("span", { children: r("integrations.connectApp.step2") }),
|
|
15326
|
+
/* @__PURE__ */ z("code", {
|
|
15327
|
+
"data-testid": "connect-app-url",
|
|
15328
|
+
className: "rounded-md border bg-muted px-3 py-2.5 font-mono text-xs [overflow-wrap:anywhere]",
|
|
15329
|
+
children: e
|
|
15330
|
+
}),
|
|
15331
|
+
/* @__PURE__ */ z(Ev, {
|
|
15332
|
+
text: e,
|
|
15333
|
+
label: r("integrations.connectApp.copy"),
|
|
15334
|
+
className: "self-start"
|
|
15335
|
+
})
|
|
15336
|
+
]
|
|
15337
|
+
}) }),
|
|
15338
|
+
/* @__PURE__ */ z("li", { children: r("integrations.connectApp.step3") })
|
|
15339
|
+
]
|
|
15340
|
+
}),
|
|
15341
|
+
/* @__PURE__ */ z("p", {
|
|
15342
|
+
className: "text-sm text-muted-foreground",
|
|
15343
|
+
children: r("integrations.connectApp.noToken")
|
|
15344
|
+
}),
|
|
15345
|
+
t && /* @__PURE__ */ z("p", {
|
|
15346
|
+
className: "text-sm text-muted-foreground",
|
|
15347
|
+
children: r("integrations.connectApp.needsTunnel")
|
|
15348
|
+
})
|
|
15349
|
+
]
|
|
15350
|
+
}),
|
|
15351
|
+
/* @__PURE__ */ z(e_, {}),
|
|
15352
|
+
/* @__PURE__ */ B("section", {
|
|
15353
|
+
className: "flex min-w-0 flex-col gap-3",
|
|
15354
|
+
children: [/* @__PURE__ */ B(K, {
|
|
15355
|
+
type: "button",
|
|
15356
|
+
variant: "ghost",
|
|
15357
|
+
size: "touch",
|
|
15358
|
+
className: "-mx-2 h-auto justify-start px-2 text-start whitespace-normal md:min-h-9",
|
|
15359
|
+
"aria-expanded": i,
|
|
15360
|
+
"aria-controls": o,
|
|
15361
|
+
onClick: () => a((e) => !e),
|
|
15362
|
+
children: [z(i ? kt : Mt, {
|
|
15363
|
+
"aria-hidden": !0,
|
|
15364
|
+
className: "shrink-0"
|
|
15365
|
+
}), r("integrations.connectApp.developerToggle")]
|
|
15366
|
+
}), i && /* @__PURE__ */ B("div", {
|
|
15367
|
+
id: o,
|
|
15368
|
+
className: "flex flex-col gap-3 text-sm text-muted-foreground",
|
|
15369
|
+
children: [/* @__PURE__ */ z("p", { children: r("integrations.connectApp.developerBody") }), /* @__PURE__ */ B(K, {
|
|
15370
|
+
size: "touch",
|
|
15371
|
+
className: "self-start md:min-h-9",
|
|
15372
|
+
onClick: n,
|
|
15373
|
+
children: [/* @__PURE__ */ z(Dn, { "aria-hidden": !0 }), r("integrations.tokens.create")]
|
|
15374
|
+
})]
|
|
15375
|
+
})]
|
|
15376
|
+
})
|
|
15377
|
+
]
|
|
15378
|
+
})]
|
|
15379
|
+
});
|
|
15380
|
+
}
|
|
15381
|
+
function Bx() {
|
|
15328
15382
|
let { t: e } = I("admin"), t = $a(), n = no(), r = Xi(), [i, a] = m(null), [o, s] = m(null);
|
|
15329
15383
|
if (!t.data) return t.isError ? /* @__PURE__ */ z(Av, {
|
|
15330
15384
|
error: t.error,
|
|
@@ -15341,7 +15395,7 @@ function zx() {
|
|
|
15341
15395
|
/* @__PURE__ */ z("ul", {
|
|
15342
15396
|
className: "flex flex-col divide-y",
|
|
15343
15397
|
"aria-label": e("integrations.tokens.title"),
|
|
15344
|
-
children: t.data.map((e) => /* @__PURE__ */ z(
|
|
15398
|
+
children: t.data.map((e) => /* @__PURE__ */ z(Vx, {
|
|
15345
15399
|
token: e,
|
|
15346
15400
|
now: c,
|
|
15347
15401
|
onEdit: e.userId === r.data?.id ? () => s(e) : void 0,
|
|
@@ -15371,7 +15425,7 @@ function zx() {
|
|
|
15371
15425
|
})
|
|
15372
15426
|
] });
|
|
15373
15427
|
}
|
|
15374
|
-
function
|
|
15428
|
+
function Vx({ token: e, now: t, onEdit: n, onRevoke: r }) {
|
|
15375
15429
|
let { t: i } = I("admin"), a = e.expiresAt !== null && e.expiresAt <= t, o = e.lastUsedAt === null ? i("integrations.tokens.neverUsed") : i("integrations.tokens.lastUsed", { when: t - e.lastUsedAt < Ix ? ms(e.lastUsedAt) : ds(e.lastUsedAt) });
|
|
15376
15430
|
return /* @__PURE__ */ B("li", {
|
|
15377
15431
|
"data-testid": "api-token-row",
|
|
@@ -15404,6 +15458,11 @@ function Bx({ token: e, now: t, onEdit: n, onRevoke: r }) {
|
|
|
15404
15458
|
/* @__PURE__ */ B("div", {
|
|
15405
15459
|
className: "col-span-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground tabular-nums",
|
|
15406
15460
|
children: [
|
|
15461
|
+
/* @__PURE__ */ z(q, {
|
|
15462
|
+
variant: "outline",
|
|
15463
|
+
"data-testid": "token-kind",
|
|
15464
|
+
children: e.connectedApp ? i("integrations.tokens.signedInBadge") : i("integrations.tokens.tokenBadge")
|
|
15465
|
+
}),
|
|
15407
15466
|
/* @__PURE__ */ B("code", {
|
|
15408
15467
|
className: "rounded bg-muted px-1.5 font-mono text-xs text-foreground",
|
|
15409
15468
|
children: [e.prefix, "…"]
|
|
@@ -15436,23 +15495,23 @@ function Bx({ token: e, now: t, onEdit: n, onRevoke: r }) {
|
|
|
15436
15495
|
});
|
|
15437
15496
|
}
|
|
15438
15497
|
// src/admin/SettingsPage.tsx
|
|
15439
|
-
var
|
|
15498
|
+
var Hx = [
|
|
15440
15499
|
"general",
|
|
15441
15500
|
"ai",
|
|
15442
15501
|
"integrations",
|
|
15443
15502
|
"device",
|
|
15444
15503
|
"maintenance"
|
|
15445
|
-
],
|
|
15504
|
+
], Ux = {
|
|
15446
15505
|
general: "settings.tabs.general",
|
|
15447
15506
|
ai: "settings.tabs.ai",
|
|
15448
15507
|
integrations: "settings.tabs.integrations",
|
|
15449
15508
|
device: "settings.tabs.device",
|
|
15450
15509
|
maintenance: "settings.tabs.maintenance"
|
|
15451
15510
|
};
|
|
15452
|
-
function
|
|
15453
|
-
return
|
|
15511
|
+
function Wx(e) {
|
|
15512
|
+
return Hx.some((t) => t === e);
|
|
15454
15513
|
}
|
|
15455
|
-
function
|
|
15514
|
+
function Gx({ labelId: e, label: t, hintId: n, hint: r, children: i, below: a }) {
|
|
15456
15515
|
return /* @__PURE__ */ B("div", {
|
|
15457
15516
|
className: "flex flex-col gap-2",
|
|
15458
15517
|
children: [/* @__PURE__ */ B("div", {
|
|
@@ -15475,7 +15534,7 @@ function Wx({ labelId: e, label: t, hintId: n, hint: r, children: i, below: a })
|
|
|
15475
15534
|
}), a]
|
|
15476
15535
|
});
|
|
15477
15536
|
}
|
|
15478
|
-
function
|
|
15537
|
+
function Kx() {
|
|
15479
15538
|
let e = $s(), t = tc();
|
|
15480
15539
|
return e.flatMap((e) => (e.settingsSections ?? []).map((n) => {
|
|
15481
15540
|
let r = `settings-ext-${e.name}-${n.id}`;
|
|
@@ -15490,9 +15549,9 @@ function Gx() {
|
|
|
15490
15549
|
}, r);
|
|
15491
15550
|
}));
|
|
15492
15551
|
}
|
|
15493
|
-
function
|
|
15552
|
+
function qx() {
|
|
15494
15553
|
let e = Ka(), t = qa(), { theme: n, setTheme: r } = ax(), { locale: i, changeLocale: a } = $b(), o = ee(), s = te()["*"], { t: c } = I(["admin", "common"]), [l, u] = m(), [d, f] = m(), [p, h] = m(), [g, _] = m(!1);
|
|
15495
|
-
if (!
|
|
15554
|
+
if (!Wx(s)) return /* @__PURE__ */ z(E, {
|
|
15496
15555
|
to: "/admin/settings/general",
|
|
15497
15556
|
replace: !0
|
|
15498
15557
|
});
|
|
@@ -15528,10 +15587,10 @@ function Kx() {
|
|
|
15528
15587
|
children: /* @__PURE__ */ z(Gb, {
|
|
15529
15588
|
variant: "line",
|
|
15530
15589
|
className: "w-max justify-start",
|
|
15531
|
-
children:
|
|
15590
|
+
children: Hx.map((e) => /* @__PURE__ */ z(Kb, {
|
|
15532
15591
|
value: e,
|
|
15533
15592
|
className: "flex-none px-3",
|
|
15534
|
-
children: c(
|
|
15593
|
+
children: c(Ux[e])
|
|
15535
15594
|
}, e))
|
|
15536
15595
|
})
|
|
15537
15596
|
}),
|
|
@@ -15676,7 +15735,7 @@ function Kx() {
|
|
|
15676
15735
|
/* @__PURE__ */ B(qb, {
|
|
15677
15736
|
value: "integrations",
|
|
15678
15737
|
className: "flex flex-col gap-4",
|
|
15679
|
-
children: [/* @__PURE__ */ z(Rx, {}), /* @__PURE__ */ z(
|
|
15738
|
+
children: [/* @__PURE__ */ z(Rx, {}), /* @__PURE__ */ z(Kx, {})]
|
|
15680
15739
|
}),
|
|
15681
15740
|
/* @__PURE__ */ B(qb, {
|
|
15682
15741
|
value: "device",
|
|
@@ -15685,7 +15744,7 @@ function Kx() {
|
|
|
15685
15744
|
className: "gap-4",
|
|
15686
15745
|
children: [/* @__PURE__ */ B(g_, { children: [/* @__PURE__ */ z(__, { children: c("settings.device.title") }), /* @__PURE__ */ z(v_, { children: c("settings.device.description") })] }), /* @__PURE__ */ B(b_, {
|
|
15687
15746
|
className: "flex flex-col gap-5",
|
|
15688
|
-
children: [/* @__PURE__ */ z(
|
|
15747
|
+
children: [/* @__PURE__ */ z(Gx, {
|
|
15689
15748
|
labelId: "settings-theme-label",
|
|
15690
15749
|
label: c("common:theme.label"),
|
|
15691
15750
|
hintId: "settings-theme-desc",
|
|
@@ -15702,7 +15761,7 @@ function Kx() {
|
|
|
15702
15761
|
})
|
|
15703
15762
|
}), /* @__PURE__ */ z($g, {
|
|
15704
15763
|
labelledBy: "settings-notifications-label",
|
|
15705
|
-
children: ({ control: e, notes: t }) => /* @__PURE__ */ z(
|
|
15764
|
+
children: ({ control: e, notes: t }) => /* @__PURE__ */ z(Gx, {
|
|
15706
15765
|
labelId: "settings-notifications-label",
|
|
15707
15766
|
label: c("settings.device.notifications"),
|
|
15708
15767
|
hintId: "settings-notifications-desc",
|
|
@@ -15716,7 +15775,7 @@ function Kx() {
|
|
|
15716
15775
|
className: "gap-4",
|
|
15717
15776
|
children: [/* @__PURE__ */ B(g_, { children: [/* @__PURE__ */ z(__, { children: c("settings.account.title") }), /* @__PURE__ */ z(v_, { children: c("settings.account.description") })] }), /* @__PURE__ */ z(b_, {
|
|
15718
15777
|
className: "flex flex-col gap-5",
|
|
15719
|
-
children: /* @__PURE__ */ z(
|
|
15778
|
+
children: /* @__PURE__ */ z(Gx, {
|
|
15720
15779
|
labelId: "settings-language-label",
|
|
15721
15780
|
label: c("common:language.label"),
|
|
15722
15781
|
hintId: "settings-language-desc",
|
|
@@ -15744,7 +15803,7 @@ function Kx() {
|
|
|
15744
15803
|
});
|
|
15745
15804
|
}
|
|
15746
15805
|
// src/components/ui/scroll-area.tsx
|
|
15747
|
-
function
|
|
15806
|
+
function Jx({ className: e, children: t, ...n }) {
|
|
15748
15807
|
return /* @__PURE__ */ B(yr.Root, {
|
|
15749
15808
|
"data-slot": "scroll-area",
|
|
15750
15809
|
className: L("relative", e),
|
|
@@ -15755,12 +15814,12 @@ function qx({ className: e, children: t, ...n }) {
|
|
|
15755
15814
|
className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
|
|
15756
15815
|
children: t
|
|
15757
15816
|
}),
|
|
15758
|
-
/* @__PURE__ */ z(
|
|
15817
|
+
/* @__PURE__ */ z(Yx, {}),
|
|
15759
15818
|
/* @__PURE__ */ z(yr.Corner, {})
|
|
15760
15819
|
]
|
|
15761
15820
|
});
|
|
15762
15821
|
}
|
|
15763
|
-
function
|
|
15822
|
+
function Yx({ className: e, orientation: t = "vertical", ...n }) {
|
|
15764
15823
|
return /* @__PURE__ */ z(yr.ScrollAreaScrollbar, {
|
|
15765
15824
|
"data-slot": "scroll-area-scrollbar",
|
|
15766
15825
|
orientation: t,
|
|
@@ -15773,8 +15832,8 @@ function Jx({ className: e, orientation: t = "vertical", ...n }) {
|
|
|
15773
15832
|
});
|
|
15774
15833
|
}
|
|
15775
15834
|
// src/admin/CloudflareSetup.tsx
|
|
15776
|
-
var
|
|
15777
|
-
function
|
|
15835
|
+
var Xx = "inbox", Zx = "wa-team-inbox";
|
|
15836
|
+
function Qx(e) {
|
|
15778
15837
|
if (!e) return null;
|
|
15779
15838
|
try {
|
|
15780
15839
|
let t = new URL(e);
|
|
@@ -15783,8 +15842,8 @@ function Zx(e) {
|
|
|
15783
15842
|
return null;
|
|
15784
15843
|
}
|
|
15785
15844
|
}
|
|
15786
|
-
function
|
|
15787
|
-
let t = Va(), n = Ha(), r = Ua(), { t: i } = I("admin"), [a, o] = m(""), [s, c] = m(
|
|
15845
|
+
function $x({ tunnel: e }) {
|
|
15846
|
+
let t = Va(), n = Ha(), r = Ua(), { t: i } = I("admin"), [a, o] = m(""), [s, c] = m(Xx), [l, u] = m(Zx), [d, f] = m(null), [p, h] = m(!1), g = () => {
|
|
15788
15847
|
f(null), n.reset(), r.reset();
|
|
15789
15848
|
}, _ = (e) => {
|
|
15790
15849
|
g(), n.mutate(e);
|
|
@@ -15797,7 +15856,7 @@ function Qx({ tunnel: e }) {
|
|
|
15797
15856
|
error: t.error,
|
|
15798
15857
|
onRetry: () => void t.refetch()
|
|
15799
15858
|
});
|
|
15800
|
-
let v = t.data, y = v.state === "signing_in" || v.state === "awaiting_approval", b = n.isPending ? n.variables : null, x = v.busy || n.isPending || r.isPending, S = v.domains.find((e) => e.id === a) ?? v.domains.find((e) => v.managed?.hostname.endsWith(`.${e.name}`)) ?? v.domains[0], C = S ? `https://${s.trim().toLowerCase()}.${S.name}` : null, w =
|
|
15859
|
+
let v = t.data, y = v.state === "signing_in" || v.state === "awaiting_approval", b = n.isPending ? n.variables : null, x = v.busy || n.isPending || r.isPending, S = v.domains.find((e) => e.id === a) ?? v.domains.find((e) => v.managed?.hostname.endsWith(`.${e.name}`)) ?? v.domains[0], C = S ? `https://${s.trim().toLowerCase()}.${S.name}` : null, w = Qx(v.loginUrl), T = v.loginUrl && !w ? i("cloudflare.invalidApproval") : null, E = n.error ?? r.error, D = v.state === "connected", O = v.managed?.hostname ?? r.data?.hostname, k = v.managed?.name ?? r.variables?.tunnelName, A = C === `https://${O}` && l.trim() === k;
|
|
15801
15860
|
if (O && !p && !y) {
|
|
15802
15861
|
let t = e.mode === "named" && e.hostname === O, r = t && e.state === "running", a = t && e.state === "starting";
|
|
15803
15862
|
return /* @__PURE__ */ B("section", {
|
|
@@ -15816,7 +15875,7 @@ function Qx({ tunnel: e }) {
|
|
|
15816
15875
|
disabled: x,
|
|
15817
15876
|
onClick: () => {
|
|
15818
15877
|
let e = v.domains.find((e) => O.endsWith(`.${e.name}`));
|
|
15819
|
-
e && (o(e.id), c(O.slice(0, -(e.name.length + 1)))), u(k ??
|
|
15878
|
+
e && (o(e.id), c(O.slice(0, -(e.name.length + 1)))), u(k ?? Zx), f(null), n.reset(), h(!0);
|
|
15820
15879
|
},
|
|
15821
15880
|
children: i("cloudflare.saved.change")
|
|
15822
15881
|
})]
|
|
@@ -15973,7 +16032,7 @@ function Qx({ tunnel: e }) {
|
|
|
15973
16032
|
autoCapitalize: "none",
|
|
15974
16033
|
autoCorrect: "off",
|
|
15975
16034
|
spellCheck: !1,
|
|
15976
|
-
placeholder:
|
|
16035
|
+
placeholder: Xx
|
|
15977
16036
|
})
|
|
15978
16037
|
}),
|
|
15979
16038
|
C && /* @__PURE__ */ B("div", {
|
|
@@ -15997,7 +16056,7 @@ function Qx({ tunnel: e }) {
|
|
|
15997
16056
|
maxLength: 64,
|
|
15998
16057
|
onChange: (e) => u(e.target.value),
|
|
15999
16058
|
disabled: x,
|
|
16000
|
-
placeholder:
|
|
16059
|
+
placeholder: Zx
|
|
16001
16060
|
})
|
|
16002
16061
|
}),
|
|
16003
16062
|
/* @__PURE__ */ B("div", {
|
|
@@ -16039,12 +16098,12 @@ function Qx({ tunnel: e }) {
|
|
|
16039
16098
|
});
|
|
16040
16099
|
}
|
|
16041
16100
|
// src/admin/TunnelPage.tsx
|
|
16042
|
-
var
|
|
16101
|
+
var eS = {
|
|
16043
16102
|
stopped: "tunnel.state.stopped",
|
|
16044
16103
|
starting: "tunnel.state.starting",
|
|
16045
16104
|
running: "tunnel.state.running",
|
|
16046
16105
|
error: "tunnel.state.error"
|
|
16047
|
-
},
|
|
16106
|
+
}, tS = [
|
|
16048
16107
|
{
|
|
16049
16108
|
value: "off",
|
|
16050
16109
|
labelKey: "tunnel.modes.off",
|
|
@@ -16060,8 +16119,8 @@ var $x = {
|
|
|
16060
16119
|
labelKey: "tunnel.modes.named",
|
|
16061
16120
|
hintKey: "tunnel.modes.namedHint"
|
|
16062
16121
|
}
|
|
16063
|
-
],
|
|
16064
|
-
function
|
|
16122
|
+
], nS = "eyJh…", rS = "inbox.example.com";
|
|
16123
|
+
function iS() {
|
|
16065
16124
|
let e = Ba(), t = Ka(), n = Wa(), r = Ga(), { t: i } = I("admin"), [a, o] = m("off"), [s, c] = m(""), [u, d] = m(""), [f, h] = m(null), [g, _] = m(!1), v = p(!1);
|
|
16066
16125
|
l(() => {
|
|
16067
16126
|
!v.current && e.data && (v.current = !0, o(e.data.mode), d(e.data.hostname ?? t.data?.namedTunnelHostname ?? ""));
|
|
@@ -16102,7 +16161,7 @@ function rS() {
|
|
|
16102
16161
|
r && (t.hostname = r);
|
|
16103
16162
|
}
|
|
16104
16163
|
n.mutate(t, { onSuccess: () => c("") });
|
|
16105
|
-
}, O = n.error ?? r.error, k =
|
|
16164
|
+
}, O = n.error ?? r.error, k = eS[b.state], A = k ? i(k) : b.state, j = tS.find((e) => e.value === b.mode), ee = j ? i(j.labelKey) : b.mode;
|
|
16106
16165
|
return /* @__PURE__ */ B("div", {
|
|
16107
16166
|
className: "flex flex-col gap-4",
|
|
16108
16167
|
children: [
|
|
@@ -16194,7 +16253,7 @@ function rS() {
|
|
|
16194
16253
|
},
|
|
16195
16254
|
className: "grid gap-2 sm:grid-cols-3",
|
|
16196
16255
|
"aria-label": i("tunnel.remoteAccessMode"),
|
|
16197
|
-
children:
|
|
16256
|
+
children: tS.map((e) => {
|
|
16198
16257
|
let t = `tunnel-mode-${e.value}`;
|
|
16199
16258
|
return /* @__PURE__ */ B(J, {
|
|
16200
16259
|
htmlFor: t,
|
|
@@ -16215,7 +16274,7 @@ function rS() {
|
|
|
16215
16274
|
}),
|
|
16216
16275
|
a === "named" && /* @__PURE__ */ B("div", {
|
|
16217
16276
|
className: "flex flex-col gap-4",
|
|
16218
|
-
children: [/* @__PURE__ */ z(
|
|
16277
|
+
children: [/* @__PURE__ */ z($x, { tunnel: b }), /* @__PURE__ */ B("div", {
|
|
16219
16278
|
className: "border-t pt-4",
|
|
16220
16279
|
children: [/* @__PURE__ */ z(K, {
|
|
16221
16280
|
variant: "ghost",
|
|
@@ -16245,7 +16304,7 @@ function rS() {
|
|
|
16245
16304
|
value: s,
|
|
16246
16305
|
onChange: (e) => c(e.target.value),
|
|
16247
16306
|
autoComplete: "off",
|
|
16248
|
-
placeholder: S ? i("tunnel.tokenSavedPlaceholder") :
|
|
16307
|
+
placeholder: S ? i("tunnel.tokenSavedPlaceholder") : nS
|
|
16249
16308
|
})
|
|
16250
16309
|
}),
|
|
16251
16310
|
/* @__PURE__ */ z(Sv, {
|
|
@@ -16256,7 +16315,7 @@ function rS() {
|
|
|
16256
16315
|
className: "h-11 md:h-9",
|
|
16257
16316
|
value: u,
|
|
16258
16317
|
onChange: (e) => d(e.target.value),
|
|
16259
|
-
placeholder:
|
|
16318
|
+
placeholder: rS,
|
|
16260
16319
|
autoCapitalize: "none",
|
|
16261
16320
|
autoCorrect: "off"
|
|
16262
16321
|
})
|
|
@@ -16308,7 +16367,7 @@ function rS() {
|
|
|
16308
16367
|
children: i("tunnel.diagnostics")
|
|
16309
16368
|
}), /* @__PURE__ */ z("div", {
|
|
16310
16369
|
className: "pt-3",
|
|
16311
|
-
children: /* @__PURE__ */ z(
|
|
16370
|
+
children: /* @__PURE__ */ z(Jx, {
|
|
16312
16371
|
className: G("rounded-md border bg-muted", b.logTail.length > 14 && "h-72"),
|
|
16313
16372
|
children: /* @__PURE__ */ z("pre", {
|
|
16314
16373
|
className: "p-3 font-mono text-xs break-all whitespace-pre-wrap text-foreground",
|
|
@@ -16321,7 +16380,7 @@ function rS() {
|
|
|
16321
16380
|
});
|
|
16322
16381
|
}
|
|
16323
16382
|
// src/admin/WhatsAppPage.tsx
|
|
16324
|
-
var
|
|
16383
|
+
var aS = {
|
|
16325
16384
|
open: "whatsapp.state.open",
|
|
16326
16385
|
connecting: "whatsapp.state.connecting",
|
|
16327
16386
|
qr: "whatsapp.state.qr",
|
|
@@ -16329,20 +16388,20 @@ var iS = {
|
|
|
16329
16388
|
logged_out: "whatsapp.state.loggedOut",
|
|
16330
16389
|
replaced: "whatsapp.state.replaced",
|
|
16331
16390
|
blocked: "whatsapp.state.blocked"
|
|
16332
|
-
},
|
|
16391
|
+
}, oS = {
|
|
16333
16392
|
logout: { danger: !0 },
|
|
16334
16393
|
relink: { danger: !0 },
|
|
16335
16394
|
takeover: { danger: !1 }
|
|
16336
|
-
},
|
|
16395
|
+
}, sS = [
|
|
16337
16396
|
"takeover",
|
|
16338
16397
|
"relink",
|
|
16339
16398
|
"logout"
|
|
16340
|
-
],
|
|
16341
|
-
function
|
|
16399
|
+
], cS = "/illustrations/link-whatsapp.png";
|
|
16400
|
+
function lS(e) {
|
|
16342
16401
|
let t = e.split("@")[0]?.split(":")[0] ?? e;
|
|
16343
16402
|
return /^\d+$/.test(t) ? `+${t}` : t;
|
|
16344
16403
|
}
|
|
16345
|
-
function
|
|
16404
|
+
function uS() {
|
|
16346
16405
|
let e = Na(), t = Ra(), [n, r] = m(null), { t: i } = I("admin");
|
|
16347
16406
|
if (e.isPending) return /* @__PURE__ */ B("div", {
|
|
16348
16407
|
className: "flex flex-col gap-4",
|
|
@@ -16358,7 +16417,7 @@ function lS() {
|
|
|
16358
16417
|
error: e.error,
|
|
16359
16418
|
onRetry: () => void e.refetch()
|
|
16360
16419
|
});
|
|
16361
|
-
let a = e.data, o =
|
|
16420
|
+
let a = e.data, o = aS[a.state], s = o ? i(o) : a.state, c = a.state === "logged_out" || a.state === "blocked";
|
|
16362
16421
|
return /* @__PURE__ */ B("div", {
|
|
16363
16422
|
className: "flex flex-col gap-4",
|
|
16364
16423
|
children: [
|
|
@@ -16394,7 +16453,7 @@ function lS() {
|
|
|
16394
16453
|
}),
|
|
16395
16454
|
/* @__PURE__ */ z("dd", {
|
|
16396
16455
|
className: "font-medium break-words",
|
|
16397
|
-
children:
|
|
16456
|
+
children: lS(a.me.jid)
|
|
16398
16457
|
}),
|
|
16399
16458
|
a.me.name && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("dt", {
|
|
16400
16459
|
className: "text-muted-foreground",
|
|
@@ -16439,7 +16498,7 @@ function lS() {
|
|
|
16439
16498
|
})
|
|
16440
16499
|
})
|
|
16441
16500
|
}) : /* @__PURE__ */ z(As, {
|
|
16442
|
-
illustration:
|
|
16501
|
+
illustration: cS,
|
|
16443
16502
|
title: i("whatsapp.waitingQrTitle"),
|
|
16444
16503
|
description: i("whatsapp.waitingQrBody")
|
|
16445
16504
|
}) })]
|
|
@@ -16449,7 +16508,7 @@ function lS() {
|
|
|
16449
16508
|
children: [/* @__PURE__ */ B(g_, { children: [/* @__PURE__ */ z(__, { children: i("whatsapp.phoneTitle") }), /* @__PURE__ */ z(v_, { children: i("whatsapp.phoneHint") })] }), /* @__PURE__ */ z(b_, { children: /* @__PURE__ */ z(Xy, {}) })]
|
|
16450
16509
|
}),
|
|
16451
16510
|
c && /* @__PURE__ */ z(Q, { children: /* @__PURE__ */ z(As, {
|
|
16452
|
-
illustration:
|
|
16511
|
+
illustration: cS,
|
|
16453
16512
|
title: i("whatsapp.linkTitle"),
|
|
16454
16513
|
description: i("whatsapp.linkBody"),
|
|
16455
16514
|
action: /* @__PURE__ */ z(K, {
|
|
@@ -16469,7 +16528,7 @@ function lS() {
|
|
|
16469
16528
|
}) }), /* @__PURE__ */ z(b_, { children: /* @__PURE__ */ z("ul", {
|
|
16470
16529
|
"aria-labelledby": "wa-actions-title",
|
|
16471
16530
|
className: "flex flex-col divide-y",
|
|
16472
|
-
children:
|
|
16531
|
+
children: sS.filter((e) => e !== "takeover" || a.state === "replaced").map((e) => /* @__PURE__ */ B("li", {
|
|
16473
16532
|
className: "flex flex-col gap-2 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between sm:gap-6",
|
|
16474
16533
|
children: [/* @__PURE__ */ z("p", {
|
|
16475
16534
|
className: "min-w-0 text-sm text-muted-foreground",
|
|
@@ -16490,7 +16549,7 @@ function lS() {
|
|
|
16490
16549
|
open: !0,
|
|
16491
16550
|
title: i(`whatsapp.actions.${n}.title`),
|
|
16492
16551
|
confirmLabel: i(`whatsapp.actions.${n}.label`),
|
|
16493
|
-
danger:
|
|
16552
|
+
danger: oS[n].danger,
|
|
16494
16553
|
loading: t.isPending,
|
|
16495
16554
|
error: t.error ?? void 0,
|
|
16496
16555
|
onConfirm: () => t.mutate(n, { onSuccess: () => {
|
|
@@ -16503,7 +16562,7 @@ function lS() {
|
|
|
16503
16562
|
});
|
|
16504
16563
|
}
|
|
16505
16564
|
// src/admin/AdminLayout.tsx
|
|
16506
|
-
var
|
|
16565
|
+
var dS = [
|
|
16507
16566
|
{
|
|
16508
16567
|
to: "members",
|
|
16509
16568
|
labelKey: "nav.members",
|
|
@@ -16540,31 +16599,31 @@ var uS = [
|
|
|
16540
16599
|
icon: Pn
|
|
16541
16600
|
}
|
|
16542
16601
|
];
|
|
16543
|
-
function
|
|
16544
|
-
return
|
|
16602
|
+
function fS(e) {
|
|
16603
|
+
return dS.filter((t) => t.to !== (e ? "whatsapp" : "inboxes"));
|
|
16545
16604
|
}
|
|
16546
|
-
function
|
|
16605
|
+
function pS() {
|
|
16547
16606
|
let e = Fa();
|
|
16548
16607
|
return {
|
|
16549
16608
|
multiInbox: (e.data?.maxInboxes ?? 1) > 1,
|
|
16550
16609
|
isPending: e.isPending
|
|
16551
16610
|
};
|
|
16552
16611
|
}
|
|
16553
|
-
function
|
|
16554
|
-
let { multiInbox: e } =
|
|
16612
|
+
function mS() {
|
|
16613
|
+
let { multiInbox: e } = pS();
|
|
16555
16614
|
return e ? /* @__PURE__ */ z(E, {
|
|
16556
16615
|
to: "/admin/inboxes",
|
|
16557
16616
|
replace: !0
|
|
16558
|
-
}) : /* @__PURE__ */ z(
|
|
16617
|
+
}) : /* @__PURE__ */ z(uS, {});
|
|
16559
16618
|
}
|
|
16560
|
-
function
|
|
16561
|
-
let { multiInbox: e, isPending: t } =
|
|
16619
|
+
function hS() {
|
|
16620
|
+
let { multiInbox: e, isPending: t } = pS();
|
|
16562
16621
|
return t ? /* @__PURE__ */ z(jv, { rows: 2 }) : e ? /* @__PURE__ */ z(nb, {}) : /* @__PURE__ */ z(E, {
|
|
16563
16622
|
to: "/admin/whatsapp",
|
|
16564
16623
|
replace: !0
|
|
16565
16624
|
});
|
|
16566
16625
|
}
|
|
16567
|
-
function
|
|
16626
|
+
function gS() {
|
|
16568
16627
|
let e = Vg();
|
|
16569
16628
|
if (e.isPending) return /* @__PURE__ */ z(jv, { rows: 2 });
|
|
16570
16629
|
let t = e.data;
|
|
@@ -16578,14 +16637,14 @@ function hS() {
|
|
|
16578
16637
|
replace: !0
|
|
16579
16638
|
});
|
|
16580
16639
|
}
|
|
16581
|
-
function
|
|
16640
|
+
function _S() {
|
|
16582
16641
|
let { agentId: e = "" } = te();
|
|
16583
16642
|
return /^[1-9]\d{0,9}$/.test(e) ? /* @__PURE__ */ z(yy, {}) : /* @__PURE__ */ z(E, {
|
|
16584
16643
|
to: "/admin/members",
|
|
16585
16644
|
replace: !0
|
|
16586
16645
|
});
|
|
16587
16646
|
}
|
|
16588
|
-
function
|
|
16647
|
+
function vS(e) {
|
|
16589
16648
|
return e.flatMap((e) => (e.adminNav ?? []).map((t) => ({
|
|
16590
16649
|
key: `${e.name}:${t.path}`,
|
|
16591
16650
|
href: Ys(e.name, t.path, !0),
|
|
@@ -16594,13 +16653,13 @@ function _S(e) {
|
|
|
16594
16653
|
useBadge: t.useBadge
|
|
16595
16654
|
})));
|
|
16596
16655
|
}
|
|
16597
|
-
function
|
|
16656
|
+
function yS(e, t) {
|
|
16598
16657
|
for (let n of e) for (let e of n.routes ?? []) if (e.admin && e.section && A({
|
|
16599
16658
|
path: Ys(n.name, e.path, !0),
|
|
16600
16659
|
end: !0
|
|
16601
16660
|
}, t)) return e.section;
|
|
16602
16661
|
}
|
|
16603
|
-
function
|
|
16662
|
+
function bS({ useBadge: e }) {
|
|
16604
16663
|
let t = tc(), n = e();
|
|
16605
16664
|
if (!n) return null;
|
|
16606
16665
|
let r = typeof n.count == "number" && n.count > 0 ? n.count : 0;
|
|
@@ -16623,14 +16682,14 @@ function yS({ useBadge: e }) {
|
|
|
16623
16682
|
})]
|
|
16624
16683
|
});
|
|
16625
16684
|
}
|
|
16626
|
-
function
|
|
16685
|
+
function xS({ useBadge: e }) {
|
|
16627
16686
|
return e ? /* @__PURE__ */ z(Rs, {
|
|
16628
16687
|
fallback: null,
|
|
16629
|
-
children: /* @__PURE__ */ z(
|
|
16688
|
+
children: /* @__PURE__ */ z(bS, { useBadge: e })
|
|
16630
16689
|
}) : null;
|
|
16631
16690
|
}
|
|
16632
|
-
var
|
|
16633
|
-
function
|
|
16691
|
+
var SS = ({ isActive: e }) => G("flex min-h-11 items-center gap-3 rounded-md px-3 text-sm font-medium transition-colors md:min-h-9", "outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", e ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent hover:text-foreground");
|
|
16692
|
+
function CS() {
|
|
16634
16693
|
let { pathname: e } = j();
|
|
16635
16694
|
return l(() => {
|
|
16636
16695
|
hi({
|
|
@@ -16643,17 +16702,17 @@ function SS() {
|
|
|
16643
16702
|
replace: !0
|
|
16644
16703
|
});
|
|
16645
16704
|
}
|
|
16646
|
-
function
|
|
16647
|
-
let { t: n } = I("admin"), r = tc(), i = $s(), a =
|
|
16705
|
+
function wS({ onNavigate: e, className: t }) {
|
|
16706
|
+
let { t: n } = I("admin"), r = tc(), i = $s(), a = vS(i), { multiInbox: o } = pS(), s = yS(i, j().pathname);
|
|
16648
16707
|
return /* @__PURE__ */ z("nav", {
|
|
16649
16708
|
"aria-label": n("nav.label"),
|
|
16650
16709
|
className: t,
|
|
16651
16710
|
children: /* @__PURE__ */ B("ul", {
|
|
16652
16711
|
className: "flex flex-col gap-1",
|
|
16653
|
-
children: [
|
|
16712
|
+
children: [fS(o).map((t) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B(T, {
|
|
16654
16713
|
to: `/admin/${t.to}`,
|
|
16655
16714
|
onClick: e,
|
|
16656
|
-
className: ({ isActive: e }) =>
|
|
16715
|
+
className: ({ isActive: e }) => SS({ isActive: e || s === t.to }),
|
|
16657
16716
|
children: [/* @__PURE__ */ z(t.icon, {
|
|
16658
16717
|
className: "size-4 shrink-0",
|
|
16659
16718
|
"aria-hidden": !0
|
|
@@ -16661,20 +16720,20 @@ function CS({ onNavigate: e, className: t }) {
|
|
|
16661
16720
|
}) }, t.to)), a.map((t) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B(T, {
|
|
16662
16721
|
to: t.href,
|
|
16663
16722
|
onClick: e,
|
|
16664
|
-
className:
|
|
16723
|
+
className: SS,
|
|
16665
16724
|
children: [
|
|
16666
16725
|
/* @__PURE__ */ z(t.icon, {
|
|
16667
16726
|
className: "size-4 shrink-0",
|
|
16668
16727
|
"aria-hidden": !0
|
|
16669
16728
|
}),
|
|
16670
16729
|
r(t.labelKey),
|
|
16671
|
-
/* @__PURE__ */ z(
|
|
16730
|
+
/* @__PURE__ */ z(xS, { useBadge: t.useBadge })
|
|
16672
16731
|
]
|
|
16673
16732
|
}) }, t.key))]
|
|
16674
16733
|
})
|
|
16675
16734
|
});
|
|
16676
16735
|
}
|
|
16677
|
-
function
|
|
16736
|
+
function TS({ version: e, onNavigate: t }) {
|
|
16678
16737
|
let { logout: n } = as(), { t: r } = I("admin"), [i, a] = m(!1);
|
|
16679
16738
|
async function o() {
|
|
16680
16739
|
a(!0);
|
|
@@ -16714,7 +16773,7 @@ function wS({ version: e, onNavigate: t }) {
|
|
|
16714
16773
|
]
|
|
16715
16774
|
});
|
|
16716
16775
|
}
|
|
16717
|
-
function
|
|
16776
|
+
function ES({ version: e, onNavigate: t }) {
|
|
16718
16777
|
let { t: n } = I("admin");
|
|
16719
16778
|
return /* @__PURE__ */ B("div", {
|
|
16720
16779
|
className: "flex min-h-0 flex-1 flex-col overflow-y-auto",
|
|
@@ -16733,19 +16792,19 @@ function TS({ version: e, onNavigate: t }) {
|
|
|
16733
16792
|
})
|
|
16734
16793
|
})
|
|
16735
16794
|
}),
|
|
16736
|
-
/* @__PURE__ */ z(
|
|
16795
|
+
/* @__PURE__ */ z(wS, {
|
|
16737
16796
|
className: "flex-1 p-2",
|
|
16738
16797
|
onNavigate: t
|
|
16739
16798
|
}),
|
|
16740
|
-
/* @__PURE__ */ z(
|
|
16799
|
+
/* @__PURE__ */ z(TS, {
|
|
16741
16800
|
version: e,
|
|
16742
16801
|
onNavigate: t
|
|
16743
16802
|
})
|
|
16744
16803
|
]
|
|
16745
16804
|
});
|
|
16746
16805
|
}
|
|
16747
|
-
function
|
|
16748
|
-
let { user: e, isLoading: t } = as(), n = j(), [r, i] = m(!1), a = m_(), { t: o } = I(["admin", "common"]), s = $s(), c = tc(), { multiInbox: l } =
|
|
16806
|
+
function DS() {
|
|
16807
|
+
let { user: e, isLoading: t } = as(), n = j(), [r, i] = m(!1), a = m_(), { t: o } = I(["admin", "common"]), s = $s(), c = tc(), { multiInbox: l } = pS();
|
|
16749
16808
|
if (t) return /* @__PURE__ */ B("div", {
|
|
16750
16809
|
role: "status",
|
|
16751
16810
|
className: "flex min-h-dvh items-center justify-center bg-background text-muted-foreground",
|
|
@@ -16761,7 +16820,7 @@ function ES() {
|
|
|
16761
16820
|
to: "/",
|
|
16762
16821
|
replace: !0
|
|
16763
16822
|
});
|
|
16764
|
-
let u =
|
|
16823
|
+
let u = yS(s, n.pathname), d = fS(l).find((e) => n.pathname.includes(`/admin/${e.to}`) || u === e.to), f = d ? void 0 : vS(s).find((e) => n.pathname === e.href || n.pathname.startsWith(`${e.href}/`)), p = d ? o(d.labelKey) : f ? c(f.labelKey) : void 0;
|
|
16765
16824
|
return /* @__PURE__ */ B("div", {
|
|
16766
16825
|
className: "safe-x flex min-h-dvh flex-col bg-background text-foreground md:flex-row",
|
|
16767
16826
|
children: [
|
|
@@ -16801,7 +16860,7 @@ function ES() {
|
|
|
16801
16860
|
children: [/* @__PURE__ */ B(s_, {
|
|
16802
16861
|
className: "border-b",
|
|
16803
16862
|
children: [/* @__PURE__ */ z(l_, { children: o("title") }), /* @__PURE__ */ z(u_, { children: o("common:appName") })]
|
|
16804
|
-
}), /* @__PURE__ */ z(
|
|
16863
|
+
}), /* @__PURE__ */ z(ES, {
|
|
16805
16864
|
version: a ?? void 0,
|
|
16806
16865
|
onNavigate: () => i(!1)
|
|
16807
16866
|
})]
|
|
@@ -16823,7 +16882,7 @@ function ES() {
|
|
|
16823
16882
|
className: "text-lg font-semibold",
|
|
16824
16883
|
children: o("title")
|
|
16825
16884
|
})]
|
|
16826
|
-
}), /* @__PURE__ */ z(
|
|
16885
|
+
}), /* @__PURE__ */ z(ES, { version: a ?? void 0 })]
|
|
16827
16886
|
})
|
|
16828
16887
|
}),
|
|
16829
16888
|
/* @__PURE__ */ B("main", {
|
|
@@ -16844,7 +16903,7 @@ function ES() {
|
|
|
16844
16903
|
}),
|
|
16845
16904
|
/* @__PURE__ */ z(O, {
|
|
16846
16905
|
path: "members/ai",
|
|
16847
|
-
element: /* @__PURE__ */ z(
|
|
16906
|
+
element: /* @__PURE__ */ z(gS, {})
|
|
16848
16907
|
}),
|
|
16849
16908
|
/* @__PURE__ */ z(O, {
|
|
16850
16909
|
path: "members/ai/new",
|
|
@@ -16852,7 +16911,7 @@ function ES() {
|
|
|
16852
16911
|
}),
|
|
16853
16912
|
/* @__PURE__ */ z(O, {
|
|
16854
16913
|
path: "members/ai/:agentId",
|
|
16855
|
-
element: /* @__PURE__ */ z(
|
|
16914
|
+
element: /* @__PURE__ */ z(_S, {})
|
|
16856
16915
|
}),
|
|
16857
16916
|
/* @__PURE__ */ z(O, {
|
|
16858
16917
|
path: "quick-replies",
|
|
@@ -16860,19 +16919,19 @@ function ES() {
|
|
|
16860
16919
|
}),
|
|
16861
16920
|
/* @__PURE__ */ z(O, {
|
|
16862
16921
|
path: "whatsapp",
|
|
16863
|
-
element: /* @__PURE__ */ z(
|
|
16922
|
+
element: /* @__PURE__ */ z(mS, {})
|
|
16864
16923
|
}),
|
|
16865
16924
|
/* @__PURE__ */ z(O, {
|
|
16866
16925
|
path: "inboxes",
|
|
16867
|
-
element: /* @__PURE__ */ z(
|
|
16926
|
+
element: /* @__PURE__ */ z(hS, {})
|
|
16868
16927
|
}),
|
|
16869
16928
|
/* @__PURE__ */ z(O, {
|
|
16870
16929
|
path: "tunnel",
|
|
16871
|
-
element: /* @__PURE__ */ z(
|
|
16930
|
+
element: /* @__PURE__ */ z(iS, {})
|
|
16872
16931
|
}),
|
|
16873
16932
|
/* @__PURE__ */ z(O, {
|
|
16874
16933
|
path: "settings/*",
|
|
16875
|
-
element: /* @__PURE__ */ z(
|
|
16934
|
+
element: /* @__PURE__ */ z(qx, {})
|
|
16876
16935
|
}),
|
|
16877
16936
|
/* @__PURE__ */ z(O, {
|
|
16878
16937
|
path: "audit",
|
|
@@ -16881,7 +16940,7 @@ function ES() {
|
|
|
16881
16940
|
rc(s, !0),
|
|
16882
16941
|
/* @__PURE__ */ z(O, {
|
|
16883
16942
|
path: "*",
|
|
16884
|
-
element: /* @__PURE__ */ z(
|
|
16943
|
+
element: /* @__PURE__ */ z(CS, {})
|
|
16885
16944
|
})
|
|
16886
16945
|
] })
|
|
16887
16946
|
})]
|
|
@@ -16890,7 +16949,7 @@ function ES() {
|
|
|
16890
16949
|
});
|
|
16891
16950
|
}
|
|
16892
16951
|
// src/i18n/LanguageSelect.tsx
|
|
16893
|
-
function
|
|
16952
|
+
function OS({ className: e }) {
|
|
16894
16953
|
let { t } = I(), { locale: n, changeLocale: r } = $b();
|
|
16895
16954
|
return /* @__PURE__ */ B(C_, {
|
|
16896
16955
|
value: n,
|
|
@@ -16914,7 +16973,7 @@ function DS({ className: e }) {
|
|
|
16914
16973
|
});
|
|
16915
16974
|
}
|
|
16916
16975
|
// src/auth/AuthShell.tsx
|
|
16917
|
-
function
|
|
16976
|
+
function kS({ className: e = "size-10" }) {
|
|
16918
16977
|
return /* @__PURE__ */ z("img", {
|
|
16919
16978
|
src: "/icon-192.png",
|
|
16920
16979
|
alt: "",
|
|
@@ -16922,7 +16981,7 @@ function OS({ className: e = "size-10" }) {
|
|
|
16922
16981
|
className: G("select-none rounded-lg", e)
|
|
16923
16982
|
});
|
|
16924
16983
|
}
|
|
16925
|
-
function
|
|
16984
|
+
function AS({ title: e, subtitle: t, children: n, wide: r = !1, illustration: i, languageSelect: a = !0 }) {
|
|
16926
16985
|
let { t: o } = I(["common", "app"]), s = m_(), c = es(), l = Xo(c);
|
|
16927
16986
|
return /* @__PURE__ */ z("div", {
|
|
16928
16987
|
className: "safe-x safe-top safe-bottom relative min-h-dvh bg-background text-foreground",
|
|
@@ -16933,11 +16992,11 @@ function kS({ title: e, subtitle: t, children: n, wide: r = !1, illustration: i,
|
|
|
16933
16992
|
children: [
|
|
16934
16993
|
a && /* @__PURE__ */ z("div", {
|
|
16935
16994
|
className: "mb-2 flex justify-end sm:absolute sm:top-4 sm:right-4 sm:mb-0",
|
|
16936
|
-
children: /* @__PURE__ */ z(
|
|
16995
|
+
children: /* @__PURE__ */ z(OS, {})
|
|
16937
16996
|
}),
|
|
16938
16997
|
/* @__PURE__ */ B("div", {
|
|
16939
16998
|
className: "mb-4 flex items-center justify-center gap-2",
|
|
16940
|
-
children: [/* @__PURE__ */ z(
|
|
16999
|
+
children: [/* @__PURE__ */ z(kS, { className: "size-8 rounded-lg" }), /* @__PURE__ */ z("span", {
|
|
16941
17000
|
className: "text-sm font-semibold tracking-tight",
|
|
16942
17001
|
children: o("appName")
|
|
16943
17002
|
})]
|
|
@@ -16985,7 +17044,7 @@ function kS({ title: e, subtitle: t, children: n, wide: r = !1, illustration: i,
|
|
|
16985
17044
|
})
|
|
16986
17045
|
});
|
|
16987
17046
|
}
|
|
16988
|
-
function
|
|
17047
|
+
function jS({ label: t, hint: n, error: r, className: i, id: a, ...o }) {
|
|
16989
17048
|
let { t: s } = I("auth"), c = e.useId(), l = a ?? c, u = r ? `${l}-error` : n ? `${l}-hint` : void 0, d = o.type === "password", [f, p] = e.useState(!1);
|
|
16990
17049
|
return /* @__PURE__ */ B("div", {
|
|
16991
17050
|
className: G("flex flex-col gap-1.5", i),
|
|
@@ -17026,13 +17085,13 @@ function AS({ label: t, hint: n, error: r, className: i, id: a, ...o }) {
|
|
|
17026
17085
|
]
|
|
17027
17086
|
});
|
|
17028
17087
|
}
|
|
17029
|
-
function
|
|
17088
|
+
function MS() {
|
|
17030
17089
|
return /* @__PURE__ */ z(tn, {
|
|
17031
17090
|
className: "animate-spin",
|
|
17032
17091
|
"aria-hidden": "true"
|
|
17033
17092
|
});
|
|
17034
17093
|
}
|
|
17035
|
-
function
|
|
17094
|
+
function NS({ label: e }) {
|
|
17036
17095
|
let { t } = I();
|
|
17037
17096
|
return /* @__PURE__ */ z("div", {
|
|
17038
17097
|
role: "status",
|
|
@@ -17046,15 +17105,15 @@ function MS({ label: e }) {
|
|
|
17046
17105
|
});
|
|
17047
17106
|
}
|
|
17048
17107
|
// src/auth/ChangePasswordPage.tsx
|
|
17049
|
-
function
|
|
17108
|
+
function PS() {
|
|
17050
17109
|
let { t: e } = I(["auth", "common"]), t = ee(), { user: n, isLoading: r, logout: i } = as(), a = ra(), [o, s] = m(""), [c, l] = m(""), [u, d] = m(""), [f, p] = m(!1);
|
|
17051
|
-
if (r) return /* @__PURE__ */ z(
|
|
17110
|
+
if (r) return /* @__PURE__ */ z(NS, {});
|
|
17052
17111
|
if (!n) return /* @__PURE__ */ z(E, {
|
|
17053
17112
|
to: "/login",
|
|
17054
17113
|
replace: !0
|
|
17055
17114
|
});
|
|
17056
17115
|
let h = n.mustChangePassword, g = (f || c.length > 0) && c.length < 8, _ = (f || u.length > 0) && c !== u, v = c.length > 0 && c === o, y = o.length > 0 && c.length >= 8 && c === u && !v;
|
|
17057
|
-
return /* @__PURE__ */ z(
|
|
17116
|
+
return /* @__PURE__ */ z(AS, {
|
|
17058
17117
|
title: e(h ? "changePassword.titleForced" : "changePassword.title"),
|
|
17059
17118
|
subtitle: h ? e("changePassword.welcome", { name: n.displayName }) : n.displayName,
|
|
17060
17119
|
children: /* @__PURE__ */ B("form", {
|
|
@@ -17071,7 +17130,7 @@ function NS() {
|
|
|
17071
17130
|
tone: "danger",
|
|
17072
17131
|
children: U(a.error)
|
|
17073
17132
|
}),
|
|
17074
|
-
/* @__PURE__ */ z(
|
|
17133
|
+
/* @__PURE__ */ z(jS, {
|
|
17075
17134
|
label: e("changePassword.current"),
|
|
17076
17135
|
type: "password",
|
|
17077
17136
|
autoComplete: "current-password",
|
|
@@ -17079,7 +17138,7 @@ function NS() {
|
|
|
17079
17138
|
onChange: (e) => s(e.target.value),
|
|
17080
17139
|
error: f && !o ? e("changePassword.required") : void 0
|
|
17081
17140
|
}),
|
|
17082
|
-
/* @__PURE__ */ z(
|
|
17141
|
+
/* @__PURE__ */ z(jS, {
|
|
17083
17142
|
label: e("changePassword.new"),
|
|
17084
17143
|
type: "password",
|
|
17085
17144
|
autoComplete: "new-password",
|
|
@@ -17088,7 +17147,7 @@ function NS() {
|
|
|
17088
17147
|
hint: e("changePassword.minLength"),
|
|
17089
17148
|
error: g ? e("changePassword.minLength") : v ? e("changePassword.sameAsOld") : void 0
|
|
17090
17149
|
}),
|
|
17091
|
-
/* @__PURE__ */ z(
|
|
17150
|
+
/* @__PURE__ */ z(jS, {
|
|
17092
17151
|
label: e("changePassword.confirm"),
|
|
17093
17152
|
type: "password",
|
|
17094
17153
|
autoComplete: "new-password",
|
|
@@ -17102,7 +17161,7 @@ function NS() {
|
|
|
17102
17161
|
className: "w-full",
|
|
17103
17162
|
"aria-busy": a.isPending || void 0,
|
|
17104
17163
|
disabled: a.isPending,
|
|
17105
|
-
children: [a.isPending ? /* @__PURE__ */ z(
|
|
17164
|
+
children: [a.isPending ? /* @__PURE__ */ z(MS, {}) : /* @__PURE__ */ z(Zt, { "aria-hidden": "true" }), e("changePassword.submit")]
|
|
17106
17165
|
}),
|
|
17107
17166
|
/* @__PURE__ */ B("div", {
|
|
17108
17167
|
className: "flex justify-between gap-2",
|
|
@@ -17126,19 +17185,19 @@ function NS() {
|
|
|
17126
17185
|
});
|
|
17127
17186
|
}
|
|
17128
17187
|
// src/auth/LoginPage.tsx
|
|
17129
|
-
function
|
|
17188
|
+
function FS(e) {
|
|
17130
17189
|
let t = e?.from;
|
|
17131
17190
|
return typeof t == "string" && t.startsWith("/") && !t.startsWith("//") ? t : "/";
|
|
17132
17191
|
}
|
|
17133
|
-
function
|
|
17192
|
+
function IS() {
|
|
17134
17193
|
let { t: e } = I("auth"), t = ee(), n = j(), r = Xi(), i = Zi(), a = $i(), [o, s] = m(""), [c, l] = m(""), [u, d] = m(!1);
|
|
17135
17194
|
return i.data?.needsSetup ? /* @__PURE__ */ z(E, {
|
|
17136
17195
|
to: "/setup",
|
|
17137
17196
|
replace: !0
|
|
17138
17197
|
}) : r.data && !a.isPending ? /* @__PURE__ */ z(E, {
|
|
17139
|
-
to: r.data.mustChangePassword ? "/change-password" :
|
|
17198
|
+
to: r.data.mustChangePassword ? "/change-password" : FS(n.state),
|
|
17140
17199
|
replace: !0
|
|
17141
|
-
}) : /* @__PURE__ */ z(
|
|
17200
|
+
}) : /* @__PURE__ */ z(AS, {
|
|
17142
17201
|
title: e("login.title"),
|
|
17143
17202
|
subtitle: e("login.subtitle"),
|
|
17144
17203
|
children: /* @__PURE__ */ B("form", {
|
|
@@ -17147,7 +17206,7 @@ function FS() {
|
|
|
17147
17206
|
username: o.trim(),
|
|
17148
17207
|
password: c
|
|
17149
17208
|
}, { onSuccess: (e) => {
|
|
17150
|
-
e?.mustChangePassword ? t("/change-password", { replace: !0 }) : t(
|
|
17209
|
+
e?.mustChangePassword ? t("/change-password", { replace: !0 }) : t(FS(n.state), { replace: !0 });
|
|
17151
17210
|
} });
|
|
17152
17211
|
},
|
|
17153
17212
|
className: "flex flex-col gap-4",
|
|
@@ -17157,7 +17216,7 @@ function FS() {
|
|
|
17157
17216
|
tone: "danger",
|
|
17158
17217
|
children: U(a.error)
|
|
17159
17218
|
}),
|
|
17160
|
-
/* @__PURE__ */ z(
|
|
17219
|
+
/* @__PURE__ */ z(jS, {
|
|
17161
17220
|
label: e("login.username"),
|
|
17162
17221
|
name: "username",
|
|
17163
17222
|
autoComplete: "username",
|
|
@@ -17169,7 +17228,7 @@ function FS() {
|
|
|
17169
17228
|
onChange: (e) => s(e.target.value),
|
|
17170
17229
|
error: u && !o.trim() ? e("login.usernameRequired") : void 0
|
|
17171
17230
|
}),
|
|
17172
|
-
/* @__PURE__ */ z(
|
|
17231
|
+
/* @__PURE__ */ z(jS, {
|
|
17173
17232
|
label: e("login.passLabel"),
|
|
17174
17233
|
name: "password",
|
|
17175
17234
|
type: "password",
|
|
@@ -17185,7 +17244,7 @@ function FS() {
|
|
|
17185
17244
|
className: "w-full",
|
|
17186
17245
|
"aria-busy": a.isPending || void 0,
|
|
17187
17246
|
disabled: a.isPending,
|
|
17188
|
-
children: [a.isPending ? /* @__PURE__ */ z(
|
|
17247
|
+
children: [a.isPending ? /* @__PURE__ */ z(MS, {}) : /* @__PURE__ */ z(on, { "aria-hidden": "true" }), e("login.submit")]
|
|
17189
17248
|
}),
|
|
17190
17249
|
/* @__PURE__ */ z("p", {
|
|
17191
17250
|
className: "text-center text-sm text-muted-foreground",
|
|
@@ -17196,7 +17255,7 @@ function FS() {
|
|
|
17196
17255
|
});
|
|
17197
17256
|
}
|
|
17198
17257
|
// src/auth/OAuthConsentPage.tsx
|
|
17199
|
-
function
|
|
17258
|
+
function LS() {
|
|
17200
17259
|
let { t: e } = I("auth");
|
|
17201
17260
|
return (t) => {
|
|
17202
17261
|
if (t instanceof li) {
|
|
@@ -17207,10 +17266,10 @@ function IS() {
|
|
|
17207
17266
|
return U(t);
|
|
17208
17267
|
};
|
|
17209
17268
|
}
|
|
17210
|
-
function
|
|
17211
|
-
let { t: e } = I("auth"), { search: t } = j(), n = t.startsWith("?") ? t.slice(1) : t, r = Za(n), i = Qa(), a =
|
|
17212
|
-
if (r.isPending) return /* @__PURE__ */ z(
|
|
17213
|
-
if (r.isError) return /* @__PURE__ */ z(
|
|
17269
|
+
function RS() {
|
|
17270
|
+
let { t: e } = I("auth"), { search: t } = j(), n = t.startsWith("?") ? t.slice(1) : t, r = Za(n), i = Qa(), a = LS(), [o, s] = m(null);
|
|
17271
|
+
if (r.isPending) return /* @__PURE__ */ z(NS, {});
|
|
17272
|
+
if (r.isError) return /* @__PURE__ */ z(AS, {
|
|
17214
17273
|
title: e("oauth.errorTitle"),
|
|
17215
17274
|
children: /* @__PURE__ */ B("div", {
|
|
17216
17275
|
className: "flex flex-col gap-4",
|
|
@@ -17236,7 +17295,7 @@ function LS() {
|
|
|
17236
17295
|
approve: e
|
|
17237
17296
|
}, { onSuccess: ({ redirectTo: e }) => window.location.assign(e) });
|
|
17238
17297
|
};
|
|
17239
|
-
return /* @__PURE__ */ z(
|
|
17298
|
+
return /* @__PURE__ */ z(AS, {
|
|
17240
17299
|
title: e("oauth.title", { name: u }),
|
|
17241
17300
|
subtitle: e("oauth.subtitle"),
|
|
17242
17301
|
children: /* @__PURE__ */ B("div", {
|
|
@@ -17290,13 +17349,13 @@ function LS() {
|
|
|
17290
17349
|
size: "touch",
|
|
17291
17350
|
disabled: d,
|
|
17292
17351
|
onClick: () => f(!1),
|
|
17293
|
-
children: [d && o === !1 && /* @__PURE__ */ z(
|
|
17352
|
+
children: [d && o === !1 && /* @__PURE__ */ z(MS, {}), e("oauth.deny")]
|
|
17294
17353
|
}), /* @__PURE__ */ B(K, {
|
|
17295
17354
|
type: "button",
|
|
17296
17355
|
size: "touch",
|
|
17297
17356
|
disabled: d,
|
|
17298
17357
|
onClick: () => f(!0),
|
|
17299
|
-
children: [d && o === !0 && /* @__PURE__ */ z(
|
|
17358
|
+
children: [d && o === !0 && /* @__PURE__ */ z(MS, {}), e("oauth.approve")]
|
|
17300
17359
|
})]
|
|
17301
17360
|
})
|
|
17302
17361
|
]
|
|
@@ -17304,15 +17363,15 @@ function LS() {
|
|
|
17304
17363
|
});
|
|
17305
17364
|
}
|
|
17306
17365
|
// src/auth/RequireAuth.tsx
|
|
17307
|
-
function
|
|
17366
|
+
function zS({ admin: e = !1, children: t }) {
|
|
17308
17367
|
let n = j(), r = Zi(), { user: i, isLoading: a, error: o } = as();
|
|
17309
|
-
if (r.isPending || a) return /* @__PURE__ */ z(
|
|
17368
|
+
if (r.isPending || a) return /* @__PURE__ */ z(NS, {});
|
|
17310
17369
|
if (r.data?.needsSetup) return /* @__PURE__ */ z(E, {
|
|
17311
17370
|
to: "/setup",
|
|
17312
17371
|
replace: !0
|
|
17313
17372
|
});
|
|
17314
17373
|
if (!i) {
|
|
17315
|
-
if (o) return /* @__PURE__ */ z(
|
|
17374
|
+
if (o) return /* @__PURE__ */ z(BS, { message: U(o) });
|
|
17316
17375
|
let e = n.pathname + n.search;
|
|
17317
17376
|
return /* @__PURE__ */ z(E, {
|
|
17318
17377
|
to: "/login",
|
|
@@ -17328,7 +17387,7 @@ function RS({ admin: e = !1, children: t }) {
|
|
|
17328
17387
|
replace: !0
|
|
17329
17388
|
}) : /* @__PURE__ */ z(R, { children: t ?? /* @__PURE__ */ z(D, {}) });
|
|
17330
17389
|
}
|
|
17331
|
-
function
|
|
17390
|
+
function BS({ message: e }) {
|
|
17332
17391
|
let { t } = I(["auth", "common"]);
|
|
17333
17392
|
return /* @__PURE__ */ z("div", {
|
|
17334
17393
|
className: "safe-x flex min-h-dvh items-center justify-center bg-background px-4",
|
|
@@ -17348,7 +17407,7 @@ function zS({ message: e }) {
|
|
|
17348
17407
|
});
|
|
17349
17408
|
}
|
|
17350
17409
|
// src/components/app/FeatureRequestAction.tsx
|
|
17351
|
-
function
|
|
17410
|
+
function VS({ placement: e = "button" }) {
|
|
17352
17411
|
let { t, i18n: n } = I("app"), r = m_(), { feedback: i } = es(), a = /* @__PURE__ */ B("a", {
|
|
17353
17412
|
href: i(n.language, r),
|
|
17354
17413
|
target: "_blank",
|
|
@@ -17378,22 +17437,22 @@ function BS({ placement: e = "button" }) {
|
|
|
17378
17437
|
});
|
|
17379
17438
|
}
|
|
17380
17439
|
// src/lib/share-app.ts
|
|
17381
|
-
var
|
|
17382
|
-
function
|
|
17440
|
+
var HS = zo;
|
|
17441
|
+
function US(e) {
|
|
17383
17442
|
return {
|
|
17384
17443
|
linkedin: `https://www.linkedin.com/sharing/share-offsite/?${new URLSearchParams({ url: e })}`,
|
|
17385
17444
|
facebook: `https://www.facebook.com/sharer/sharer.php?${new URLSearchParams({ u: e })}`
|
|
17386
17445
|
};
|
|
17387
17446
|
}
|
|
17388
|
-
HS
|
|
17389
|
-
function
|
|
17447
|
+
US(HS);
|
|
17448
|
+
function WS(e, t = HS) {
|
|
17390
17449
|
return [e.trim(), t].filter(Boolean).join("\n\n");
|
|
17391
17450
|
}
|
|
17392
|
-
async function
|
|
17451
|
+
async function GS(e) {
|
|
17393
17452
|
if (!navigator.clipboard?.writeText) throw Error("Clipboard unavailable");
|
|
17394
17453
|
await navigator.clipboard.writeText(e);
|
|
17395
17454
|
}
|
|
17396
|
-
async function
|
|
17455
|
+
async function KS(e, t = HS) {
|
|
17397
17456
|
if (typeof navigator.share == "function") try {
|
|
17398
17457
|
return await navigator.share({
|
|
17399
17458
|
title: "EzyChat Lite",
|
|
@@ -17403,9 +17462,9 @@ async function GS(e, t = VS) {
|
|
|
17403
17462
|
} catch (e) {
|
|
17404
17463
|
if (typeof e == "object" && e && "name" in e && e.name === "AbortError") return "cancelled";
|
|
17405
17464
|
}
|
|
17406
|
-
return await WS(
|
|
17465
|
+
return await GS(WS(e, t)), "copied";
|
|
17407
17466
|
}
|
|
17408
|
-
async function
|
|
17467
|
+
async function qS() {
|
|
17409
17468
|
let e = new Image();
|
|
17410
17469
|
await new Promise((t, n) => {
|
|
17411
17470
|
e.onload = () => t(), e.onerror = () => n(/* @__PURE__ */ Error("Share image unavailable")), e.src = "/share-app.svg";
|
|
@@ -17428,18 +17487,18 @@ async function KS() {
|
|
|
17428
17487
|
}
|
|
17429
17488
|
}
|
|
17430
17489
|
// src/components/app/ShareAppAction.tsx
|
|
17431
|
-
var
|
|
17490
|
+
var JS = [{
|
|
17432
17491
|
id: "linkedin",
|
|
17433
17492
|
name: "LinkedIn"
|
|
17434
17493
|
}, {
|
|
17435
17494
|
id: "facebook",
|
|
17436
17495
|
name: "Facebook"
|
|
17437
|
-
}],
|
|
17438
|
-
function
|
|
17439
|
-
let { t: n } = I(["app", "common"]), r = u(), i = Zo(es()), a =
|
|
17496
|
+
}], YS = "Instagram";
|
|
17497
|
+
function XS({ open: e, onOpenChange: t }) {
|
|
17498
|
+
let { t: n } = I(["app", "common"]), r = u(), i = Zo(es()), a = US(i), [o, s] = m(null), c = o ?? n("share.caption"), [l, d] = m(null), [f, p] = m(!1);
|
|
17440
17499
|
async function h(e, t) {
|
|
17441
17500
|
try {
|
|
17442
|
-
await
|
|
17501
|
+
await GS(e), d(t);
|
|
17443
17502
|
} catch {
|
|
17444
17503
|
d("copyUnavailable");
|
|
17445
17504
|
}
|
|
@@ -17447,7 +17506,7 @@ function YS({ open: e, onOpenChange: t }) {
|
|
|
17447
17506
|
async function g() {
|
|
17448
17507
|
d(null), p(!0);
|
|
17449
17508
|
try {
|
|
17450
|
-
await
|
|
17509
|
+
await KS(c, i) === "copied" && d("messageCopied");
|
|
17451
17510
|
} catch {
|
|
17452
17511
|
d("shareUnavailable");
|
|
17453
17512
|
} finally {
|
|
@@ -17457,7 +17516,7 @@ function YS({ open: e, onOpenChange: t }) {
|
|
|
17457
17516
|
async function _() {
|
|
17458
17517
|
d(null), p(!0);
|
|
17459
17518
|
try {
|
|
17460
|
-
await
|
|
17519
|
+
await qS(), d("imageStarted");
|
|
17461
17520
|
} catch {
|
|
17462
17521
|
d("imageFailed");
|
|
17463
17522
|
} finally {
|
|
@@ -17496,7 +17555,7 @@ function YS({ open: e, onOpenChange: t }) {
|
|
|
17496
17555
|
variant: "outline",
|
|
17497
17556
|
size: "touch",
|
|
17498
17557
|
className: "w-full",
|
|
17499
|
-
onClick: () => void h(
|
|
17558
|
+
onClick: () => void h(WS(c, i), "messageCopied"),
|
|
17500
17559
|
children: [
|
|
17501
17560
|
/* @__PURE__ */ z(Vt, { "aria-hidden": "true" }),
|
|
17502
17561
|
" ",
|
|
@@ -17547,7 +17606,7 @@ function YS({ open: e, onOpenChange: t }) {
|
|
|
17547
17606
|
}),
|
|
17548
17607
|
/* @__PURE__ */ z("div", {
|
|
17549
17608
|
className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|
|
17550
|
-
children:
|
|
17609
|
+
children: JS.map((e) => /* @__PURE__ */ z(K, {
|
|
17551
17610
|
asChild: !0,
|
|
17552
17611
|
variant: "outline",
|
|
17553
17612
|
size: "touch",
|
|
@@ -17574,7 +17633,7 @@ function YS({ open: e, onOpenChange: t }) {
|
|
|
17574
17633
|
children: [
|
|
17575
17634
|
/* @__PURE__ */ z("p", {
|
|
17576
17635
|
className: "text-sm font-medium",
|
|
17577
|
-
children:
|
|
17636
|
+
children: YS
|
|
17578
17637
|
}),
|
|
17579
17638
|
/* @__PURE__ */ z("p", {
|
|
17580
17639
|
className: "text-sm text-muted-foreground",
|
|
@@ -17621,15 +17680,15 @@ function YS({ open: e, onOpenChange: t }) {
|
|
|
17621
17680
|
});
|
|
17622
17681
|
}
|
|
17623
17682
|
// src/auth/UserMenu.tsx
|
|
17624
|
-
var
|
|
17683
|
+
var ZS = {
|
|
17625
17684
|
en: "EN",
|
|
17626
17685
|
ms: "BM",
|
|
17627
17686
|
"zh-CN": "中文"
|
|
17628
17687
|
};
|
|
17629
|
-
function
|
|
17630
|
-
return
|
|
17688
|
+
function QS(e, t) {
|
|
17689
|
+
return ZS[e] ?? t;
|
|
17631
17690
|
}
|
|
17632
|
-
function
|
|
17691
|
+
function $S({ labelId: e, label: t, value: n, onValueChange: r, options: i }) {
|
|
17633
17692
|
return /* @__PURE__ */ B("div", {
|
|
17634
17693
|
className: "flex items-center justify-between gap-2",
|
|
17635
17694
|
children: [/* @__PURE__ */ z("span", {
|
|
@@ -17655,7 +17714,7 @@ function QS({ labelId: e, label: t, value: n, onValueChange: r, options: i }) {
|
|
|
17655
17714
|
})]
|
|
17656
17715
|
});
|
|
17657
17716
|
}
|
|
17658
|
-
function
|
|
17717
|
+
function eC({ className: e, align: t = "end" }) {
|
|
17659
17718
|
let { user: n, isAdmin: r, logout: i } = as(), a = m_(), { theme: o, setTheme: s } = ax(), { t: c } = I(), { locale: l, changeLocale: u } = $b(), [d, f] = m(!1), [p, h] = m(!1), g = es(), _ = Xo(g);
|
|
17660
17719
|
return n ? /* @__PURE__ */ B(R, { children: [
|
|
17661
17720
|
/* @__PURE__ */ B(V_, { children: [/* @__PURE__ */ z(U_, {
|
|
@@ -17698,7 +17757,7 @@ function $S({ className: e, align: t = "end" }) {
|
|
|
17698
17757
|
/* @__PURE__ */ z(Z_, {}),
|
|
17699
17758
|
/* @__PURE__ */ B("div", {
|
|
17700
17759
|
className: "flex flex-col gap-1 px-2 py-1.5",
|
|
17701
|
-
children: [/* @__PURE__ */ z(
|
|
17760
|
+
children: [/* @__PURE__ */ z($S, {
|
|
17702
17761
|
labelId: "account-appearance-label",
|
|
17703
17762
|
label: c("theme.label"),
|
|
17704
17763
|
value: o,
|
|
@@ -17714,7 +17773,7 @@ function $S({ className: e, align: t = "end" }) {
|
|
|
17714
17773
|
})
|
|
17715
17774
|
};
|
|
17716
17775
|
})
|
|
17717
|
-
}), /* @__PURE__ */ z(
|
|
17776
|
+
}), /* @__PURE__ */ z($S, {
|
|
17718
17777
|
labelId: "account-language-label",
|
|
17719
17778
|
label: c("language.label"),
|
|
17720
17779
|
value: l,
|
|
@@ -17725,7 +17784,7 @@ function $S({ className: e, align: t = "end" }) {
|
|
|
17725
17784
|
lang: e.code,
|
|
17726
17785
|
content: /* @__PURE__ */ z("span", {
|
|
17727
17786
|
"aria-hidden": "true",
|
|
17728
|
-
children:
|
|
17787
|
+
children: QS(e.code, e.nativeName)
|
|
17729
17788
|
})
|
|
17730
17789
|
}))
|
|
17731
17790
|
})]
|
|
@@ -17776,7 +17835,7 @@ function $S({ className: e, align: t = "end" }) {
|
|
|
17776
17835
|
onSelect: () => h(!0),
|
|
17777
17836
|
children: [/* @__PURE__ */ z(Bn, { "aria-hidden": "true" }), c("account.share")]
|
|
17778
17837
|
}),
|
|
17779
|
-
/* @__PURE__ */ z(
|
|
17838
|
+
/* @__PURE__ */ z(VS, { placement: "menu" }),
|
|
17780
17839
|
_ && /* @__PURE__ */ z(K_, {
|
|
17781
17840
|
asChild: !0,
|
|
17782
17841
|
className: "min-h-11",
|
|
@@ -17808,33 +17867,33 @@ function $S({ className: e, align: t = "end" }) {
|
|
|
17808
17867
|
onOpenChange: f,
|
|
17809
17868
|
version: a ?? void 0
|
|
17810
17869
|
}),
|
|
17811
|
-
/* @__PURE__ */ z(
|
|
17870
|
+
/* @__PURE__ */ z(XS, {
|
|
17812
17871
|
open: p,
|
|
17813
17872
|
onOpenChange: h
|
|
17814
17873
|
})
|
|
17815
17874
|
] }) : null;
|
|
17816
17875
|
}
|
|
17817
17876
|
// src/lib/jid.ts
|
|
17818
|
-
function
|
|
17877
|
+
function tC(e) {
|
|
17819
17878
|
return e.endsWith("@g.us");
|
|
17820
17879
|
}
|
|
17821
|
-
function
|
|
17880
|
+
function nC(e) {
|
|
17822
17881
|
let t = e.indexOf("@"), n = t === -1 ? e : e.slice(0, t), r = n.indexOf(":");
|
|
17823
17882
|
return r === -1 ? n : n.slice(0, r);
|
|
17824
17883
|
}
|
|
17825
|
-
function
|
|
17826
|
-
if (
|
|
17884
|
+
function rC(e) {
|
|
17885
|
+
if (tC(e)) return "Group";
|
|
17827
17886
|
if (e.endsWith("@lid")) return "";
|
|
17828
|
-
let t =
|
|
17887
|
+
let t = nC(e);
|
|
17829
17888
|
return /^\d{5,}$/.test(t) && (e.endsWith("@s.whatsapp.net") || e.endsWith("@c.us")) ? `+${t}` : t;
|
|
17830
17889
|
}
|
|
17831
|
-
function
|
|
17890
|
+
function iC(e) {
|
|
17832
17891
|
return e.phone ? `+${e.phone}` : null;
|
|
17833
17892
|
}
|
|
17834
|
-
function
|
|
17893
|
+
function aC(e) {
|
|
17835
17894
|
return encodeURIComponent(e);
|
|
17836
17895
|
}
|
|
17837
|
-
function
|
|
17896
|
+
function oC(e) {
|
|
17838
17897
|
try {
|
|
17839
17898
|
return decodeURIComponent(e);
|
|
17840
17899
|
} catch {
|
|
@@ -17842,14 +17901,14 @@ function aC(e) {
|
|
|
17842
17901
|
}
|
|
17843
17902
|
}
|
|
17844
17903
|
// src/components/ui/command.tsx
|
|
17845
|
-
function
|
|
17904
|
+
function sC({ className: e, ...t }) {
|
|
17846
17905
|
return /* @__PURE__ */ z(Pr, {
|
|
17847
17906
|
"data-slot": "command",
|
|
17848
17907
|
className: L("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", e),
|
|
17849
17908
|
...t
|
|
17850
17909
|
});
|
|
17851
17910
|
}
|
|
17852
|
-
function
|
|
17911
|
+
function cC({ title: e = "Command Palette", description: t = "Search for a command to run...", children: n, className: r, showCloseButton: i = !0, ...a }) {
|
|
17853
17912
|
return /* @__PURE__ */ B(_o, {
|
|
17854
17913
|
...a,
|
|
17855
17914
|
children: [/* @__PURE__ */ B(Co, {
|
|
@@ -17858,14 +17917,14 @@ function sC({ title: e = "Command Palette", description: t = "Search for a comma
|
|
|
17858
17917
|
}), /* @__PURE__ */ z(So, {
|
|
17859
17918
|
className: L("overflow-hidden p-0", r),
|
|
17860
17919
|
showCloseButton: i,
|
|
17861
|
-
children: /* @__PURE__ */ z(
|
|
17920
|
+
children: /* @__PURE__ */ z(sC, {
|
|
17862
17921
|
className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
|
|
17863
17922
|
children: n
|
|
17864
17923
|
})
|
|
17865
17924
|
})]
|
|
17866
17925
|
});
|
|
17867
17926
|
}
|
|
17868
|
-
function
|
|
17927
|
+
function lC({ className: e, ...t }) {
|
|
17869
17928
|
return /* @__PURE__ */ B("div", {
|
|
17870
17929
|
"data-slot": "command-input-wrapper",
|
|
17871
17930
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
@@ -17876,42 +17935,42 @@ function cC({ className: e, ...t }) {
|
|
|
17876
17935
|
})]
|
|
17877
17936
|
});
|
|
17878
17937
|
}
|
|
17879
|
-
function
|
|
17938
|
+
function uC({ className: e, ...t }) {
|
|
17880
17939
|
return /* @__PURE__ */ z(Pr.List, {
|
|
17881
17940
|
"data-slot": "command-list",
|
|
17882
17941
|
className: L("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", e),
|
|
17883
17942
|
...t
|
|
17884
17943
|
});
|
|
17885
17944
|
}
|
|
17886
|
-
function
|
|
17945
|
+
function dC({ ...e }) {
|
|
17887
17946
|
return /* @__PURE__ */ z(Pr.Empty, {
|
|
17888
17947
|
"data-slot": "command-empty",
|
|
17889
17948
|
className: "py-6 text-center text-sm",
|
|
17890
17949
|
...e
|
|
17891
17950
|
});
|
|
17892
17951
|
}
|
|
17893
|
-
function
|
|
17952
|
+
function fC({ className: e, ...t }) {
|
|
17894
17953
|
return /* @__PURE__ */ z(Pr.Group, {
|
|
17895
17954
|
"data-slot": "command-group",
|
|
17896
17955
|
className: L("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", e),
|
|
17897
17956
|
...t
|
|
17898
17957
|
});
|
|
17899
17958
|
}
|
|
17900
|
-
function
|
|
17959
|
+
function pC({ className: e, ...t }) {
|
|
17901
17960
|
return /* @__PURE__ */ z(Pr.Separator, {
|
|
17902
17961
|
"data-slot": "command-separator",
|
|
17903
17962
|
className: L("-mx-1 h-px bg-border", e),
|
|
17904
17963
|
...t
|
|
17905
17964
|
});
|
|
17906
17965
|
}
|
|
17907
|
-
function
|
|
17966
|
+
function mC({ className: e, ...t }) {
|
|
17908
17967
|
return /* @__PURE__ */ z(Pr.Item, {
|
|
17909
17968
|
"data-slot": "command-item",
|
|
17910
17969
|
className: L("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", e),
|
|
17911
17970
|
...t
|
|
17912
17971
|
});
|
|
17913
17972
|
}
|
|
17914
|
-
function
|
|
17973
|
+
function hC({ className: e, ...t }) {
|
|
17915
17974
|
return /* @__PURE__ */ z("span", {
|
|
17916
17975
|
"data-slot": "command-shortcut",
|
|
17917
17976
|
className: L("ml-auto text-xs tracking-widest text-muted-foreground", e),
|
|
@@ -17919,19 +17978,19 @@ function mC({ className: e, ...t }) {
|
|
|
17919
17978
|
});
|
|
17920
17979
|
}
|
|
17921
17980
|
// src/components/ui/popover.tsx
|
|
17922
|
-
function
|
|
17981
|
+
function gC({ ...e }) {
|
|
17923
17982
|
return /* @__PURE__ */ z(gr.Root, {
|
|
17924
17983
|
"data-slot": "popover",
|
|
17925
17984
|
...e
|
|
17926
17985
|
});
|
|
17927
17986
|
}
|
|
17928
|
-
function
|
|
17987
|
+
function _C({ ...e }) {
|
|
17929
17988
|
return /* @__PURE__ */ z(gr.Trigger, {
|
|
17930
17989
|
"data-slot": "popover-trigger",
|
|
17931
17990
|
...e
|
|
17932
17991
|
});
|
|
17933
17992
|
}
|
|
17934
|
-
function
|
|
17993
|
+
function vC({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
|
|
17935
17994
|
return /* @__PURE__ */ z(gr.Portal, { children: /* @__PURE__ */ z(gr.Content, {
|
|
17936
17995
|
"data-slot": "popover-content",
|
|
17937
17996
|
align: t,
|
|
@@ -17940,27 +17999,27 @@ function _C({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
|
|
|
17940
17999
|
...r
|
|
17941
18000
|
}) });
|
|
17942
18001
|
}
|
|
17943
|
-
function
|
|
18002
|
+
function yC({ ...e }) {
|
|
17944
18003
|
return /* @__PURE__ */ z(gr.Anchor, {
|
|
17945
18004
|
"data-slot": "popover-anchor",
|
|
17946
18005
|
...e
|
|
17947
18006
|
});
|
|
17948
18007
|
}
|
|
17949
|
-
function
|
|
18008
|
+
function bC({ className: e, ...t }) {
|
|
17950
18009
|
return /* @__PURE__ */ z("div", {
|
|
17951
18010
|
"data-slot": "popover-header",
|
|
17952
18011
|
className: L("flex flex-col gap-1 text-sm", e),
|
|
17953
18012
|
...t
|
|
17954
18013
|
});
|
|
17955
18014
|
}
|
|
17956
|
-
function
|
|
18015
|
+
function xC({ className: e, ...t }) {
|
|
17957
18016
|
return /* @__PURE__ */ z("div", {
|
|
17958
18017
|
"data-slot": "popover-title",
|
|
17959
18018
|
className: L("font-medium", e),
|
|
17960
18019
|
...t
|
|
17961
18020
|
});
|
|
17962
18021
|
}
|
|
17963
|
-
function
|
|
18022
|
+
function SC({ className: e, ...t }) {
|
|
17964
18023
|
return /* @__PURE__ */ z("p", {
|
|
17965
18024
|
"data-slot": "popover-description",
|
|
17966
18025
|
className: L("text-muted-foreground", e),
|
|
@@ -17968,7 +18027,7 @@ function xC({ className: e, ...t }) {
|
|
|
17968
18027
|
});
|
|
17969
18028
|
}
|
|
17970
18029
|
// src/inbox/ChatFilters.tsx
|
|
17971
|
-
var
|
|
18030
|
+
var CC = [
|
|
17972
18031
|
{
|
|
17973
18032
|
key: "me",
|
|
17974
18033
|
labelKey: "filters.mine"
|
|
@@ -17981,16 +18040,16 @@ var SC = [
|
|
|
17981
18040
|
key: "any",
|
|
17982
18041
|
labelKey: "filters.all"
|
|
17983
18042
|
}
|
|
17984
|
-
],
|
|
17985
|
-
function
|
|
18043
|
+
], wC = 300, TC = "all";
|
|
18044
|
+
function EC({ value: e, onChange: t, visible: n }) {
|
|
17986
18045
|
let { t: r } = I("inbox");
|
|
17987
18046
|
if (n.length < 2) return null;
|
|
17988
|
-
let i = e.inbox != null && n.some((t) => t.id === e.inbox) ? String(e.inbox) :
|
|
18047
|
+
let i = e.inbox != null && n.some((t) => t.id === e.inbox) ? String(e.inbox) : TC;
|
|
17989
18048
|
return /* @__PURE__ */ B(C_, {
|
|
17990
18049
|
value: i,
|
|
17991
18050
|
onValueChange: (n) => t({
|
|
17992
18051
|
...e,
|
|
17993
|
-
inbox: n ===
|
|
18052
|
+
inbox: n === TC ? void 0 : Number(n)
|
|
17994
18053
|
}),
|
|
17995
18054
|
children: [/* @__PURE__ */ z(E_, {
|
|
17996
18055
|
"aria-label": r("inboxFilter.label"),
|
|
@@ -18000,11 +18059,11 @@ function TC({ value: e, onChange: t, visible: n }) {
|
|
|
18000
18059
|
}), /* @__PURE__ */ B(D_, {
|
|
18001
18060
|
position: "popper",
|
|
18002
18061
|
children: [/* @__PURE__ */ z(k_, {
|
|
18003
|
-
value:
|
|
18062
|
+
value: TC,
|
|
18004
18063
|
className: "min-h-11 md:min-h-8",
|
|
18005
18064
|
children: r("inboxFilter.all", { total: n.length })
|
|
18006
18065
|
}), n.map((e) => {
|
|
18007
|
-
let t =
|
|
18066
|
+
let t = iC({ phone: e.number });
|
|
18008
18067
|
return /* @__PURE__ */ z(k_, {
|
|
18009
18068
|
value: String(e.id),
|
|
18010
18069
|
className: "min-h-11 md:min-h-8",
|
|
@@ -18017,21 +18076,21 @@ function TC({ value: e, onChange: t, visible: n }) {
|
|
|
18017
18076
|
})]
|
|
18018
18077
|
});
|
|
18019
18078
|
}
|
|
18020
|
-
function
|
|
18079
|
+
function DC({ onPick: e }) {
|
|
18021
18080
|
let { t } = I("inbox"), [n, r] = m(""), i = Ca(n.trim());
|
|
18022
|
-
return /* @__PURE__ */ B(
|
|
18081
|
+
return /* @__PURE__ */ B(sC, {
|
|
18023
18082
|
shouldFilter: !1,
|
|
18024
18083
|
className: "bg-popover",
|
|
18025
|
-
children: [/* @__PURE__ */ z(
|
|
18084
|
+
children: [/* @__PURE__ */ z(lC, {
|
|
18026
18085
|
value: n,
|
|
18027
18086
|
onValueChange: r,
|
|
18028
18087
|
placeholder: t("filters.tagSearch"),
|
|
18029
18088
|
maxLength: 30,
|
|
18030
18089
|
className: "text-base md:text-sm"
|
|
18031
|
-
}), /* @__PURE__ */ B(
|
|
18090
|
+
}), /* @__PURE__ */ B(uC, {
|
|
18032
18091
|
label: t("filters.tagLabel"),
|
|
18033
18092
|
className: "max-h-60 overscroll-contain",
|
|
18034
|
-
children: [i.data && /* @__PURE__ */ z(
|
|
18093
|
+
children: [i.data && /* @__PURE__ */ z(dC, { children: t("filters.tagEmpty") }), i.data?.map((t) => /* @__PURE__ */ z(mC, {
|
|
18035
18094
|
value: t,
|
|
18036
18095
|
onSelect: () => e(t),
|
|
18037
18096
|
className: "min-h-11 cursor-pointer md:min-h-8",
|
|
@@ -18043,7 +18102,7 @@ function EC({ onPick: e }) {
|
|
|
18043
18102
|
})]
|
|
18044
18103
|
});
|
|
18045
18104
|
}
|
|
18046
|
-
function
|
|
18105
|
+
function OC({ value: e, onChange: t, inboxes: n = [] }) {
|
|
18047
18106
|
let { t: r } = I("inbox"), [i, a] = m(e.q ?? ""), o = p({
|
|
18048
18107
|
value: e,
|
|
18049
18108
|
onChange: t
|
|
@@ -18058,7 +18117,7 @@ function DC({ value: e, onChange: t, inboxes: n = [] }) {
|
|
|
18058
18117
|
...e,
|
|
18059
18118
|
q: n
|
|
18060
18119
|
});
|
|
18061
|
-
},
|
|
18120
|
+
}, wC);
|
|
18062
18121
|
return () => clearTimeout(e);
|
|
18063
18122
|
}, [i]);
|
|
18064
18123
|
let s = e.status ?? "open", [c, u] = m(!1), d = G("size-4", e.tag && "max-sm:hidden");
|
|
@@ -18071,7 +18130,7 @@ function DC({ value: e, onChange: t, inboxes: n = [] }) {
|
|
|
18071
18130
|
label: r("filters.searchLabel"),
|
|
18072
18131
|
placeholder: r("filters.searchPlaceholder")
|
|
18073
18132
|
}),
|
|
18074
|
-
/* @__PURE__ */ z(
|
|
18133
|
+
/* @__PURE__ */ z(EC, {
|
|
18075
18134
|
value: e,
|
|
18076
18135
|
onChange: t,
|
|
18077
18136
|
visible: n
|
|
@@ -18085,7 +18144,7 @@ function DC({ value: e, onChange: t, inboxes: n = [] }) {
|
|
|
18085
18144
|
children: /* @__PURE__ */ z(Gb, {
|
|
18086
18145
|
"aria-label": r("filters.assignment"),
|
|
18087
18146
|
className: "h-11! w-full",
|
|
18088
|
-
children:
|
|
18147
|
+
children: CC.map((e) => /* @__PURE__ */ z(Kb, {
|
|
18089
18148
|
value: e.key,
|
|
18090
18149
|
className: "min-w-0",
|
|
18091
18150
|
children: /* @__PURE__ */ z("span", {
|
|
@@ -18131,10 +18190,10 @@ function DC({ value: e, onChange: t, inboxes: n = [] }) {
|
|
|
18131
18190
|
})
|
|
18132
18191
|
}), /* @__PURE__ */ B("div", {
|
|
18133
18192
|
className: "flex shrink-0 items-center",
|
|
18134
|
-
children: [/* @__PURE__ */ B(
|
|
18193
|
+
children: [/* @__PURE__ */ B(gC, {
|
|
18135
18194
|
open: c,
|
|
18136
18195
|
onOpenChange: u,
|
|
18137
|
-
children: [/* @__PURE__ */ z(
|
|
18196
|
+
children: [/* @__PURE__ */ z(_C, {
|
|
18138
18197
|
asChild: !0,
|
|
18139
18198
|
children: /* @__PURE__ */ B(K, {
|
|
18140
18199
|
variant: "outline",
|
|
@@ -18147,10 +18206,10 @@ function DC({ value: e, onChange: t, inboxes: n = [] }) {
|
|
|
18147
18206
|
children: e.tag ?? r("filters.tag")
|
|
18148
18207
|
})]
|
|
18149
18208
|
})
|
|
18150
|
-
}), /* @__PURE__ */ z(
|
|
18209
|
+
}), /* @__PURE__ */ z(vC, {
|
|
18151
18210
|
align: "end",
|
|
18152
18211
|
className: "w-64 max-w-[calc(100vw-2rem)] p-0",
|
|
18153
|
-
children: /* @__PURE__ */ z(
|
|
18212
|
+
children: /* @__PURE__ */ z(DC, { onPick: (n) => {
|
|
18154
18213
|
u(!1), t({
|
|
18155
18214
|
...e,
|
|
18156
18215
|
tag: n
|
|
@@ -18175,27 +18234,27 @@ function DC({ value: e, onChange: t, inboxes: n = [] }) {
|
|
|
18175
18234
|
});
|
|
18176
18235
|
}
|
|
18177
18236
|
// src/inbox/GettingStartedCard.tsx
|
|
18178
|
-
var
|
|
18179
|
-
function
|
|
18237
|
+
var kC = "ezychat.getting-started-hidden";
|
|
18238
|
+
function AC() {
|
|
18180
18239
|
try {
|
|
18181
|
-
return localStorage.getItem(
|
|
18240
|
+
return localStorage.getItem(kC) === "1";
|
|
18182
18241
|
} catch {
|
|
18183
18242
|
return !1;
|
|
18184
18243
|
}
|
|
18185
18244
|
}
|
|
18186
|
-
function
|
|
18187
|
-
let t = Xi(), [n, r] = m(
|
|
18188
|
-
return n || t.data?.role !== "admin" ? null : /* @__PURE__ */ z(
|
|
18245
|
+
function jC({ className: e }) {
|
|
18246
|
+
let t = Xi(), [n, r] = m(AC);
|
|
18247
|
+
return n || t.data?.role !== "admin" ? null : /* @__PURE__ */ z(MC, {
|
|
18189
18248
|
className: e,
|
|
18190
18249
|
onHide: () => {
|
|
18191
18250
|
r(!0);
|
|
18192
18251
|
try {
|
|
18193
|
-
localStorage.setItem(
|
|
18252
|
+
localStorage.setItem(kC, "1");
|
|
18194
18253
|
} catch {}
|
|
18195
18254
|
}
|
|
18196
18255
|
});
|
|
18197
18256
|
}
|
|
18198
|
-
function
|
|
18257
|
+
function MC({ className: e, onHide: t }) {
|
|
18199
18258
|
let { t: n } = I("inbox"), r = Ag(), i = Da(), a = Ba(), o = Ka(), s = u();
|
|
18200
18259
|
if (!r.data || !i.data || !a.data || !o.data) return null;
|
|
18201
18260
|
let c = i.data.filter((e) => e.kind !== "ai" && !e.disabled), l = a.data.state === "running" || o.data.hasTunnelToken || !!o.data.namedTunnelHostname, d = [
|
|
@@ -18282,11 +18341,11 @@ function jC({ className: e, onHide: t }) {
|
|
|
18282
18341
|
});
|
|
18283
18342
|
}
|
|
18284
18343
|
// src/inbox/chat-title.ts
|
|
18285
|
-
function
|
|
18286
|
-
return e.name && e.name !== e.phone ? e.name :
|
|
18344
|
+
function NC(e, t) {
|
|
18345
|
+
return e.name && e.name !== e.phone ? e.name : iC(e) ?? (e.type === "group" ? t("chatListItem.group") : t("chatListItem.unknownContact"));
|
|
18287
18346
|
}
|
|
18288
18347
|
// src/inbox/ChatAvatar.tsx
|
|
18289
|
-
var
|
|
18348
|
+
var PC = [
|
|
18290
18349
|
"bg-accent text-accent-foreground",
|
|
18291
18350
|
"bg-muted text-muted-foreground",
|
|
18292
18351
|
"bg-note text-note-foreground",
|
|
@@ -18294,30 +18353,30 @@ var NC = [
|
|
|
18294
18353
|
"bg-success/15 text-success",
|
|
18295
18354
|
"bg-primary/15 text-primary"
|
|
18296
18355
|
];
|
|
18297
|
-
function
|
|
18356
|
+
function FC(e) {
|
|
18298
18357
|
let t = 0;
|
|
18299
18358
|
for (let n = 0; n < e.length; n++) t = t * 31 + e.charCodeAt(n) | 0;
|
|
18300
18359
|
return Math.abs(t);
|
|
18301
18360
|
}
|
|
18302
|
-
var
|
|
18361
|
+
var IC = {
|
|
18303
18362
|
sm: "size-8 text-xs",
|
|
18304
18363
|
md: "size-10 text-sm",
|
|
18305
18364
|
lg: "size-12 text-base"
|
|
18306
18365
|
};
|
|
18307
|
-
function
|
|
18366
|
+
function LC({ name: e, src: t, seed: n, size: r = "md", className: i }) {
|
|
18308
18367
|
let { ready: a, revision: o } = s(oo), c = t && o && t.startsWith("/api/chats/") ? `${t}${t.includes("?") ? "&" : "?"}connection=${o}` : t;
|
|
18309
18368
|
return /* @__PURE__ */ z(cb, {
|
|
18310
|
-
className: G(
|
|
18369
|
+
className: G(IC[r], i),
|
|
18311
18370
|
"aria-hidden": "true",
|
|
18312
18371
|
title: e,
|
|
18313
|
-
children: /* @__PURE__ */ z(
|
|
18372
|
+
children: /* @__PURE__ */ z(RC, {
|
|
18314
18373
|
name: e,
|
|
18315
18374
|
src: a ? c : null,
|
|
18316
18375
|
seed: n
|
|
18317
18376
|
}, `${t}:${o}:${a}`)
|
|
18318
18377
|
});
|
|
18319
18378
|
}
|
|
18320
|
-
function
|
|
18379
|
+
function RC({ name: e, src: t, seed: n }) {
|
|
18321
18380
|
let [r, i] = m(null), [a, o] = m(null);
|
|
18322
18381
|
return /* @__PURE__ */ B(R, { children: [t && a !== t && /* @__PURE__ */ z("img", {
|
|
18323
18382
|
src: t,
|
|
@@ -18328,7 +18387,7 @@ function LC({ name: e, src: t, seed: n }) {
|
|
|
18328
18387
|
onError: () => o(t),
|
|
18329
18388
|
className: G("absolute inset-0 size-full object-cover", r !== t && "invisible")
|
|
18330
18389
|
}), (r !== t || a === t || !t) && /* @__PURE__ */ z(ub, {
|
|
18331
|
-
className: G("font-semibold",
|
|
18390
|
+
className: G("font-semibold", PC[FC(n ?? e) % PC.length]),
|
|
18332
18391
|
children: vs(e) || /* @__PURE__ */ z(nr, {
|
|
18333
18392
|
className: "size-[55%]",
|
|
18334
18393
|
"aria-hidden": "true"
|
|
@@ -18336,22 +18395,22 @@ function LC({ name: e, src: t, seed: n }) {
|
|
|
18336
18395
|
})] });
|
|
18337
18396
|
}
|
|
18338
18397
|
// src/lib/whatsapp-format.tsx
|
|
18339
|
-
var
|
|
18398
|
+
var zC = /(https?:\/\/[^\s<]+[^\s<.,;:!?)\]'"])/g, BC = /```([\s\S]+?)```/g, VC = /`([^`\n]+)`/g, HC = /^> (.*)$/, UC = /^[*-] (.+)$/, WC = {
|
|
18340
18399
|
"*": "strong",
|
|
18341
18400
|
_: "em",
|
|
18342
18401
|
"~": "s"
|
|
18343
|
-
},
|
|
18344
|
-
"*":
|
|
18345
|
-
_:
|
|
18346
|
-
"~":
|
|
18402
|
+
}, GC = {
|
|
18403
|
+
"*": KC("\\*"),
|
|
18404
|
+
_: KC("_"),
|
|
18405
|
+
"~": KC("~")
|
|
18347
18406
|
};
|
|
18348
|
-
function
|
|
18407
|
+
function KC(e) {
|
|
18349
18408
|
return RegExp(`(^|[^\\p{L}\\p{N}${e}])${e}(?=\\S)([^\\n]*?\\S)${e}(?=$|[^\\p{L}\\p{N}${e}])`, "u");
|
|
18350
18409
|
}
|
|
18351
|
-
function
|
|
18410
|
+
function qC(e) {
|
|
18352
18411
|
let t = null;
|
|
18353
|
-
for (let n of Object.keys(
|
|
18354
|
-
let r =
|
|
18412
|
+
for (let n of Object.keys(GC)) {
|
|
18413
|
+
let r = GC[n].exec(e);
|
|
18355
18414
|
if (!r) continue;
|
|
18356
18415
|
let i = r.index + r[1].length;
|
|
18357
18416
|
(!t || i < t.start) && (t = {
|
|
@@ -18363,88 +18422,88 @@ function KC(e) {
|
|
|
18363
18422
|
}
|
|
18364
18423
|
return t;
|
|
18365
18424
|
}
|
|
18366
|
-
function
|
|
18425
|
+
function JC(e, t) {
|
|
18367
18426
|
return e.split(new RegExp(t.source, t.flags.includes("u") ? "gu" : "g"));
|
|
18368
18427
|
}
|
|
18369
|
-
var
|
|
18428
|
+
var YC = class {
|
|
18370
18429
|
n = 0;
|
|
18371
18430
|
next() {
|
|
18372
18431
|
return String(this.n++);
|
|
18373
18432
|
}
|
|
18374
18433
|
};
|
|
18375
|
-
function
|
|
18376
|
-
let n =
|
|
18434
|
+
function XC(e, t) {
|
|
18435
|
+
let n = qC(e);
|
|
18377
18436
|
if (!n) return e ? [e] : [];
|
|
18378
|
-
let r =
|
|
18437
|
+
let r = WC[n.mark];
|
|
18379
18438
|
return [
|
|
18380
18439
|
...n.start ? [e.slice(0, n.start)] : [],
|
|
18381
|
-
/* @__PURE__ */ z(r, { children:
|
|
18382
|
-
...
|
|
18440
|
+
/* @__PURE__ */ z(r, { children: ZC(n.inner, t) }, t.next()),
|
|
18441
|
+
...XC(e.slice(n.end), t)
|
|
18383
18442
|
];
|
|
18384
18443
|
}
|
|
18385
|
-
function
|
|
18386
|
-
return
|
|
18444
|
+
function ZC(e, t) {
|
|
18445
|
+
return JC(e, VC).flatMap((e, n) => n % 2 == 1 ? [/* @__PURE__ */ z("code", { children: e }, t.next())] : JC(e, zC).flatMap((e, n) => n % 2 == 1 ? [/* @__PURE__ */ z("a", {
|
|
18387
18446
|
href: e,
|
|
18388
18447
|
target: "_blank",
|
|
18389
18448
|
rel: "noopener noreferrer nofollow",
|
|
18390
18449
|
children: e
|
|
18391
|
-
}, t.next())] :
|
|
18450
|
+
}, t.next())] : XC(e, t)));
|
|
18392
18451
|
}
|
|
18393
|
-
function
|
|
18394
|
-
let n = e.split("\n"), r = (e) =>
|
|
18452
|
+
function QC(e, t) {
|
|
18453
|
+
let n = e.split("\n"), r = (e) => HC.test(e) || UC.test(e);
|
|
18395
18454
|
return n.flatMap((e, i) => {
|
|
18396
|
-
let a =
|
|
18455
|
+
let a = HC.exec(e), o = a ? null : UC.exec(e), s = a ? /* @__PURE__ */ z("span", {
|
|
18397
18456
|
"data-quote": "",
|
|
18398
|
-
children:
|
|
18457
|
+
children: ZC(a[1], t)
|
|
18399
18458
|
}, t.next()) : o ? /* @__PURE__ */ z("span", {
|
|
18400
18459
|
"data-bullet": "",
|
|
18401
|
-
children:
|
|
18460
|
+
children: ZC(o[1], t)
|
|
18402
18461
|
}, t.next()) : null;
|
|
18403
18462
|
if (s) return [s];
|
|
18404
|
-
let c =
|
|
18463
|
+
let c = ZC(e, t), l = n[i + 1];
|
|
18405
18464
|
return l !== void 0 && !r(l) ? [...c, "\n"] : c;
|
|
18406
18465
|
});
|
|
18407
18466
|
}
|
|
18408
|
-
function
|
|
18409
|
-
let t = new
|
|
18410
|
-
return
|
|
18467
|
+
function $C(e) {
|
|
18468
|
+
let t = new YC();
|
|
18469
|
+
return JC(e, BC).flatMap((e, n) => n % 2 == 1 ? [/* @__PURE__ */ z("code", {
|
|
18411
18470
|
"data-block": "",
|
|
18412
18471
|
children: e
|
|
18413
|
-
}, t.next())] :
|
|
18414
|
-
}
|
|
18415
|
-
function $C(e) {
|
|
18416
|
-
return qC(e, zC).map((e, t) => t % 2 == 1 ? e : ew(e)).join("");
|
|
18472
|
+
}, t.next())] : QC(e, t));
|
|
18417
18473
|
}
|
|
18418
18474
|
function ew(e) {
|
|
18419
|
-
return e
|
|
18420
|
-
let t = VC.exec(e);
|
|
18421
|
-
if (t) return tw(t[1]);
|
|
18422
|
-
let n = HC.exec(e);
|
|
18423
|
-
return n ? `• ${tw(n[1])}` : tw(e);
|
|
18424
|
-
}).join("\n");
|
|
18475
|
+
return JC(e, BC).map((e, t) => t % 2 == 1 ? e : tw(e)).join("");
|
|
18425
18476
|
}
|
|
18426
18477
|
function tw(e) {
|
|
18427
|
-
return
|
|
18478
|
+
return e.split("\n").map((e) => {
|
|
18479
|
+
let t = HC.exec(e);
|
|
18480
|
+
if (t) return nw(t[1]);
|
|
18481
|
+
let n = UC.exec(e);
|
|
18482
|
+
return n ? `• ${nw(n[1])}` : nw(e);
|
|
18483
|
+
}).join("\n");
|
|
18428
18484
|
}
|
|
18429
18485
|
function nw(e) {
|
|
18430
|
-
|
|
18431
|
-
|
|
18486
|
+
return JC(e, VC).map((e, t) => t % 2 == 1 ? e : JC(e, zC).map((e, t) => t % 2 == 1 ? e : rw(e)).join("")).join("");
|
|
18487
|
+
}
|
|
18488
|
+
function rw(e) {
|
|
18489
|
+
let t = qC(e);
|
|
18490
|
+
return t ? e.slice(0, t.start) + rw(t.inner) + rw(e.slice(t.end)) : e;
|
|
18432
18491
|
}
|
|
18433
18492
|
// src/inbox/navigation-guard.tsx
|
|
18434
|
-
var
|
|
18435
|
-
function
|
|
18493
|
+
var iw = r(null);
|
|
18494
|
+
function aw({ children: e }) {
|
|
18436
18495
|
let t = p(null);
|
|
18437
|
-
return /* @__PURE__ */ z(
|
|
18496
|
+
return /* @__PURE__ */ z(iw.Provider, {
|
|
18438
18497
|
value: t,
|
|
18439
18498
|
children: e
|
|
18440
18499
|
});
|
|
18441
18500
|
}
|
|
18442
|
-
function
|
|
18501
|
+
function ow() {
|
|
18443
18502
|
let e = p(null);
|
|
18444
|
-
return s(
|
|
18503
|
+
return s(iw) ?? e;
|
|
18445
18504
|
}
|
|
18446
|
-
function
|
|
18447
|
-
let n = s(
|
|
18505
|
+
function sw(e, t) {
|
|
18506
|
+
let n = s(iw), r = ee();
|
|
18448
18507
|
return o((i) => {
|
|
18449
18508
|
let a = n?.current;
|
|
18450
18509
|
a && !i.defaultPrevented && i.button === 0 && (i.metaKey || i.ctrlKey || i.shiftKey || i.altKey || (i.preventDefault(), a(() => r(e, t))));
|
|
@@ -18456,7 +18515,7 @@ function ow(e, t) {
|
|
|
18456
18515
|
]);
|
|
18457
18516
|
}
|
|
18458
18517
|
// src/inbox/ChatListItem.tsx
|
|
18459
|
-
function
|
|
18518
|
+
function cw({ className: e }) {
|
|
18460
18519
|
let { t } = I("inbox");
|
|
18461
18520
|
return /* @__PURE__ */ z(ir, {
|
|
18462
18521
|
className: e,
|
|
@@ -18464,15 +18523,15 @@ function sw({ className: e }) {
|
|
|
18464
18523
|
"aria-label": t("chatListItem.group")
|
|
18465
18524
|
});
|
|
18466
18525
|
}
|
|
18467
|
-
function
|
|
18468
|
-
let { t: a } = I("inbox"), o =
|
|
18526
|
+
function lw({ chat: e, active: t, assigneeName: n, assignedToMe: r = !1, inbox: i }) {
|
|
18527
|
+
let { t: a } = I("inbox"), o = NC(e, a), s = e.unreadCount > 0, c = e.tags ?? [], { pathname: l } = j(), u = `/chats/${aC(e.jid)}`, d = l === "/" ? { fromList: !0 } : void 0, f = sw(u, { state: d });
|
|
18469
18528
|
return /* @__PURE__ */ B(w, {
|
|
18470
18529
|
to: u,
|
|
18471
18530
|
state: d,
|
|
18472
18531
|
onClick: f,
|
|
18473
18532
|
"aria-current": t ? "page" : void 0,
|
|
18474
18533
|
className: G("relative flex min-h-16 items-center gap-3 px-3 py-2.5 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring", t ? "bg-accent before:absolute before:inset-y-0 before:left-0 before:w-0.5 before:bg-primary" : "hover:bg-muted/60 active:bg-muted"),
|
|
18475
|
-
children: [/* @__PURE__ */ z(
|
|
18534
|
+
children: [/* @__PURE__ */ z(LC, {
|
|
18476
18535
|
name: o,
|
|
18477
18536
|
src: e.avatarUrl,
|
|
18478
18537
|
seed: e.jid,
|
|
@@ -18484,7 +18543,7 @@ function cw({ chat: e, active: t, assigneeName: n, assignedToMe: r = !1, inbox:
|
|
|
18484
18543
|
children: [/* @__PURE__ */ B("span", {
|
|
18485
18544
|
className: "flex min-w-0 flex-1 items-center gap-1",
|
|
18486
18545
|
children: [
|
|
18487
|
-
e.type === "group" && /* @__PURE__ */ z(
|
|
18546
|
+
e.type === "group" && /* @__PURE__ */ z(cw, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
18488
18547
|
/* @__PURE__ */ z("span", {
|
|
18489
18548
|
className: G("truncate text-[15px] text-foreground", s ? "font-semibold" : "font-medium"),
|
|
18490
18549
|
children: o
|
|
@@ -18504,7 +18563,7 @@ function cw({ chat: e, active: t, assigneeName: n, assignedToMe: r = !1, inbox:
|
|
|
18504
18563
|
children: [
|
|
18505
18564
|
/* @__PURE__ */ z("p", {
|
|
18506
18565
|
className: G("min-w-24 flex-1 truncate text-sm", s ? "text-foreground" : "text-muted-foreground"),
|
|
18507
|
-
children: e.lastMessagePreview ?
|
|
18566
|
+
children: e.lastMessagePreview ? ew(e.lastMessagePreview) : " "
|
|
18508
18567
|
}),
|
|
18509
18568
|
n && /* @__PURE__ */ B(q, {
|
|
18510
18569
|
variant: "outline",
|
|
@@ -18557,17 +18616,17 @@ function cw({ chat: e, active: t, assigneeName: n, assignedToMe: r = !1, inbox:
|
|
|
18557
18616
|
});
|
|
18558
18617
|
}
|
|
18559
18618
|
// src/inbox/useVisibleInboxes.ts
|
|
18560
|
-
var
|
|
18561
|
-
function
|
|
18619
|
+
var uw = [];
|
|
18620
|
+
function dw() {
|
|
18562
18621
|
let { data: e } = Fa(), t = e?.inboxes;
|
|
18563
|
-
return f(() => t ? t.filter((e) => !e.removed) :
|
|
18622
|
+
return f(() => t ? t.filter((e) => !e.removed) : uw, [t]);
|
|
18564
18623
|
}
|
|
18565
|
-
function
|
|
18566
|
-
let { data: e } = Fa(), t = e?.inboxes, n = f(() => (t ??
|
|
18624
|
+
function fw() {
|
|
18625
|
+
let { data: e } = Fa(), t = e?.inboxes, n = f(() => (t ?? uw).filter((e) => !e.removed).length > 1 ? new Map((t ?? uw).map((e) => [e.id, e])) : null, [t]);
|
|
18567
18626
|
return o((e) => n?.get(e), [n]);
|
|
18568
18627
|
}
|
|
18569
18628
|
// src/inbox/ChatList.tsx
|
|
18570
|
-
var
|
|
18629
|
+
var pw = a(lw), mw = {
|
|
18571
18630
|
me: {
|
|
18572
18631
|
titleKey: "chatList.empty.me.title",
|
|
18573
18632
|
descriptionKey: "chatList.empty.me.description"
|
|
@@ -18581,7 +18640,7 @@ var fw = a(cw), pw = {
|
|
|
18581
18640
|
descriptionKey: "chatList.empty.any.description"
|
|
18582
18641
|
}
|
|
18583
18642
|
};
|
|
18584
|
-
function
|
|
18643
|
+
function hw() {
|
|
18585
18644
|
return /* @__PURE__ */ B("div", {
|
|
18586
18645
|
className: "flex min-h-16 items-center gap-3 px-3 py-2.5",
|
|
18587
18646
|
children: [/* @__PURE__ */ z($, { className: "size-12 shrink-0 rounded-full" }), /* @__PURE__ */ B("div", {
|
|
@@ -18593,8 +18652,8 @@ function mw() {
|
|
|
18593
18652
|
})]
|
|
18594
18653
|
});
|
|
18595
18654
|
}
|
|
18596
|
-
function
|
|
18597
|
-
let { t: i } = I(["inbox", "common"]), a = ia(e), o =
|
|
18655
|
+
function gw({ filters: e, activeJid: t, directory: n, onResetFilters: r }) {
|
|
18656
|
+
let { t: i } = I(["inbox", "common"]), a = ia(e), o = fw(), s = p(null), { hasNextPage: c, isFetchingNextPage: u, fetchNextPage: d } = a, m = f(() => {
|
|
18598
18657
|
let e = /* @__PURE__ */ new Set(), t = [];
|
|
18599
18658
|
for (let n of a.data?.pages ?? []) for (let r of n.chats) e.has(r.jid) || (e.add(r.jid), t.push(r));
|
|
18600
18659
|
return t;
|
|
@@ -18614,7 +18673,7 @@ function hw({ filters: e, activeJid: t, directory: n, onResetFilters: r }) {
|
|
|
18614
18673
|
className: "min-h-0 flex-1 overflow-hidden",
|
|
18615
18674
|
role: "status",
|
|
18616
18675
|
"aria-label": i("chatList.loading"),
|
|
18617
|
-
children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */ z(
|
|
18676
|
+
children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */ z(hw, {}, t))
|
|
18618
18677
|
});
|
|
18619
18678
|
if (a.isError) return /* @__PURE__ */ z("div", {
|
|
18620
18679
|
className: "p-3",
|
|
@@ -18631,7 +18690,7 @@ function hw({ filters: e, activeJid: t, directory: n, onResetFilters: r }) {
|
|
|
18631
18690
|
})
|
|
18632
18691
|
});
|
|
18633
18692
|
if (m.length === 0) {
|
|
18634
|
-
let t =
|
|
18693
|
+
let t = mw[e.assigned], n = e.q ? {
|
|
18635
18694
|
title: i("common:status.noResults"),
|
|
18636
18695
|
description: i("chatList.empty.search", { query: e.q })
|
|
18637
18696
|
} : e.tag ? {
|
|
@@ -18654,7 +18713,7 @@ function hw({ filters: e, activeJid: t, directory: n, onResetFilters: r }) {
|
|
|
18654
18713
|
size: "touch",
|
|
18655
18714
|
onClick: r,
|
|
18656
18715
|
children: i("chatList.showAllOpen")
|
|
18657
|
-
}) : /* @__PURE__ */ z(
|
|
18716
|
+
}) : /* @__PURE__ */ z(jC, { className: "mt-2 md:hidden" })
|
|
18658
18717
|
});
|
|
18659
18718
|
}
|
|
18660
18719
|
return /* @__PURE__ */ B("div", {
|
|
@@ -18662,7 +18721,7 @@ function hw({ filters: e, activeJid: t, directory: n, onResetFilters: r }) {
|
|
|
18662
18721
|
children: [
|
|
18663
18722
|
/* @__PURE__ */ z("ul", {
|
|
18664
18723
|
className: "divide-y divide-border/60",
|
|
18665
|
-
children: m.map((e) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ z(
|
|
18724
|
+
children: m.map((e) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ z(pw, {
|
|
18666
18725
|
chat: e,
|
|
18667
18726
|
active: e.jid === t,
|
|
18668
18727
|
assigneeName: n.nameOf(e.assignedTo, { youLabel: !0 }),
|
|
@@ -18695,15 +18754,15 @@ function hw({ filters: e, activeJid: t, directory: n, onResetFilters: r }) {
|
|
|
18695
18754
|
});
|
|
18696
18755
|
}
|
|
18697
18756
|
// src/inbox/QuickReplyPicker.tsx
|
|
18698
|
-
function
|
|
18757
|
+
function _w(e, t) {
|
|
18699
18758
|
let n = t.trim().toLowerCase();
|
|
18700
18759
|
return e.filter((e) => e.shortcut.toLowerCase().startsWith(n)).sort((e, t) => e.shortcut.localeCompare(t.shortcut));
|
|
18701
18760
|
}
|
|
18702
|
-
function
|
|
18703
|
-
let { t: a } = I("inbox"), o =
|
|
18761
|
+
function vw({ replies: e, query: t, activeIndex: n, onPick: r, onHover: i }) {
|
|
18762
|
+
let { t: a } = I("inbox"), o = _w(e, t), s = p(null), c = o[Math.min(n, o.length - 1)];
|
|
18704
18763
|
return l(() => {
|
|
18705
18764
|
(s.current?.querySelector(`[data-index="${n}"]`))?.scrollIntoView?.({ block: "nearest" });
|
|
18706
|
-
}, [n]), /* @__PURE__ */ B(
|
|
18765
|
+
}, [n]), /* @__PURE__ */ B(sC, {
|
|
18707
18766
|
shouldFilter: !1,
|
|
18708
18767
|
value: c ? String(c.id) : "",
|
|
18709
18768
|
onValueChange: (e) => {
|
|
@@ -18720,11 +18779,11 @@ function _w({ replies: e, query: t, activeIndex: n, onPick: r, onHover: i }) {
|
|
|
18720
18779
|
}), o.length === 0 ? /* @__PURE__ */ z("p", {
|
|
18721
18780
|
className: "px-3 py-3 text-sm text-muted-foreground",
|
|
18722
18781
|
children: a("quickReplies.noMatch", { query: t })
|
|
18723
|
-
}) : /* @__PURE__ */ z(
|
|
18782
|
+
}) : /* @__PURE__ */ z(uC, {
|
|
18724
18783
|
ref: s,
|
|
18725
18784
|
label: a("quickReplies.title"),
|
|
18726
18785
|
className: "max-h-60 overscroll-contain p-1",
|
|
18727
|
-
children: o.map((e, t) => /* @__PURE__ */ B(
|
|
18786
|
+
children: o.map((e, t) => /* @__PURE__ */ B(mC, {
|
|
18728
18787
|
value: String(e.id),
|
|
18729
18788
|
"data-index": t,
|
|
18730
18789
|
onSelect: () => r(e),
|
|
@@ -18742,19 +18801,19 @@ function _w({ replies: e, query: t, activeIndex: n, onPick: r, onHover: i }) {
|
|
|
18742
18801
|
});
|
|
18743
18802
|
}
|
|
18744
18803
|
// src/inbox/EmojiPicker.tsx
|
|
18745
|
-
var
|
|
18804
|
+
var yw = [
|
|
18746
18805
|
"All",
|
|
18747
18806
|
"Faces",
|
|
18748
18807
|
"Gestures",
|
|
18749
18808
|
"Hearts",
|
|
18750
18809
|
"Work"
|
|
18751
|
-
],
|
|
18810
|
+
], bw = {
|
|
18752
18811
|
All: "emoji.category.all",
|
|
18753
18812
|
Faces: "emoji.category.faces",
|
|
18754
18813
|
Gestures: "emoji.category.gestures",
|
|
18755
18814
|
Hearts: "emoji.category.hearts",
|
|
18756
18815
|
Work: "emoji.category.work"
|
|
18757
|
-
},
|
|
18816
|
+
}, xw = [
|
|
18758
18817
|
[
|
|
18759
18818
|
"😀",
|
|
18760
18819
|
"grinningFace",
|
|
@@ -19065,15 +19124,15 @@ var vw = [
|
|
|
19065
19124
|
"Work",
|
|
19066
19125
|
"hot"
|
|
19067
19126
|
]
|
|
19068
|
-
],
|
|
19069
|
-
function
|
|
19070
|
-
let { t: r } = I("inbox"), [i, a] = m(!1), [o, s] = m(""), [c, l] = m("All"), d = p(!1), f = u(), h = o.trim().toLowerCase(), g =
|
|
19071
|
-
return /* @__PURE__ */ B(
|
|
19127
|
+
], Sw = (e) => Xr.emoji.names[e];
|
|
19128
|
+
function Cw({ disabled: e, onOpen: t, onPick: n }) {
|
|
19129
|
+
let { t: r } = I("inbox"), [i, a] = m(!1), [o, s] = m(""), [c, l] = m("All"), d = p(!1), f = u(), h = o.trim().toLowerCase(), g = xw.filter(([e, t, n, i = ""]) => h ? `${e} ${Sw(t)} ${r(`emoji.names.${t}`)} ${i}`.toLowerCase().includes(h) : c === "All" || c === n);
|
|
19130
|
+
return /* @__PURE__ */ B(gC, {
|
|
19072
19131
|
open: i,
|
|
19073
19132
|
onOpenChange: (e) => {
|
|
19074
19133
|
e && (d.current = !1, s(""), l("All"), t()), a(e);
|
|
19075
19134
|
},
|
|
19076
|
-
children: [/* @__PURE__ */ z(
|
|
19135
|
+
children: [/* @__PURE__ */ z(_C, {
|
|
19077
19136
|
asChild: !0,
|
|
19078
19137
|
children: /* @__PURE__ */ z(K, {
|
|
19079
19138
|
variant: "ghost",
|
|
@@ -19087,7 +19146,7 @@ function Sw({ disabled: e, onOpen: t, onPick: n }) {
|
|
|
19087
19146
|
"aria-hidden": "true"
|
|
19088
19147
|
})
|
|
19089
19148
|
})
|
|
19090
|
-
}), /* @__PURE__ */ B(
|
|
19149
|
+
}), /* @__PURE__ */ B(vC, {
|
|
19091
19150
|
side: "top",
|
|
19092
19151
|
align: "start",
|
|
19093
19152
|
sideOffset: 8,
|
|
@@ -19113,7 +19172,7 @@ function Sw({ disabled: e, onOpen: t, onPick: n }) {
|
|
|
19113
19172
|
className: "flex shrink-0 flex-wrap gap-1",
|
|
19114
19173
|
role: "group",
|
|
19115
19174
|
"aria-label": r("emoji.categories"),
|
|
19116
|
-
children:
|
|
19175
|
+
children: yw.map((e) => /* @__PURE__ */ z(K, {
|
|
19117
19176
|
variant: c === e && !h ? "secondary" : "ghost",
|
|
19118
19177
|
size: "sm",
|
|
19119
19178
|
className: "min-h-11 px-2",
|
|
@@ -19121,7 +19180,7 @@ function Sw({ disabled: e, onOpen: t, onPick: n }) {
|
|
|
19121
19180
|
onClick: () => {
|
|
19122
19181
|
l(e), s("");
|
|
19123
19182
|
},
|
|
19124
|
-
children: r(
|
|
19183
|
+
children: r(bw[e])
|
|
19125
19184
|
}, e))
|
|
19126
19185
|
}),
|
|
19127
19186
|
/* @__PURE__ */ z("div", {
|
|
@@ -19164,21 +19223,21 @@ function Sw({ disabled: e, onOpen: t, onPick: n }) {
|
|
|
19164
19223
|
});
|
|
19165
19224
|
}
|
|
19166
19225
|
// src/lib/voice-recorder.ts
|
|
19167
|
-
var
|
|
19168
|
-
function
|
|
19226
|
+
var ww = 1e4;
|
|
19227
|
+
function Tw() {
|
|
19169
19228
|
return typeof window > "u" ? "unsupported" : window.isSecureContext ? !navigator.mediaDevices?.getUserMedia || typeof AudioContext > "u" ? "unsupported" : "ok" : "insecure";
|
|
19170
19229
|
}
|
|
19171
|
-
var
|
|
19230
|
+
var Ew = class extends Error {
|
|
19172
19231
|
reason;
|
|
19173
19232
|
constructor(e) {
|
|
19174
19233
|
super(e), this.reason = e;
|
|
19175
19234
|
}
|
|
19176
19235
|
};
|
|
19177
|
-
function
|
|
19236
|
+
function Dw(e) {
|
|
19178
19237
|
let t = e?.name;
|
|
19179
|
-
return t === "NotAllowedError" || t === "SecurityError" ? new
|
|
19238
|
+
return t === "NotAllowedError" || t === "SecurityError" ? new Ew("blocked") : t === "NotFoundError" || t === "OverconstrainedError" ? new Ew("no-microphone") : new Ew("failed");
|
|
19180
19239
|
}
|
|
19181
|
-
async function
|
|
19240
|
+
async function Ow() {
|
|
19182
19241
|
let e = new AudioContext(), t;
|
|
19183
19242
|
try {
|
|
19184
19243
|
t = await navigator.mediaDevices.getUserMedia({ audio: {
|
|
@@ -19188,7 +19247,7 @@ async function Dw() {
|
|
|
19188
19247
|
autoGainControl: !0
|
|
19189
19248
|
} });
|
|
19190
19249
|
} catch (t) {
|
|
19191
|
-
throw e.close().catch(() => {}),
|
|
19250
|
+
throw e.close().catch(() => {}), Dw(t);
|
|
19192
19251
|
}
|
|
19193
19252
|
let n = () => {
|
|
19194
19253
|
for (let e of t.getTracks()) e.stop();
|
|
@@ -19226,7 +19285,7 @@ async function Dw() {
|
|
|
19226
19285
|
async stop() {
|
|
19227
19286
|
if (p) throw Error("Recording already ended");
|
|
19228
19287
|
p = !0, d().catch((e) => l(e instanceof Error ? e : /* @__PURE__ */ Error("Recording failed to stop")));
|
|
19229
|
-
let e = setTimeout(() => l(/* @__PURE__ */ Error("Recording did not finish")),
|
|
19288
|
+
let e = setTimeout(() => l(/* @__PURE__ */ Error("Recording did not finish")), ww);
|
|
19230
19289
|
try {
|
|
19231
19290
|
return await u;
|
|
19232
19291
|
} finally {
|
|
@@ -19238,18 +19297,18 @@ async function Dw() {
|
|
|
19238
19297
|
}
|
|
19239
19298
|
};
|
|
19240
19299
|
} catch (e) {
|
|
19241
|
-
throw n(), e instanceof
|
|
19300
|
+
throw n(), e instanceof Ew ? e : new Ew("failed");
|
|
19242
19301
|
}
|
|
19243
19302
|
}
|
|
19244
19303
|
// src/inbox/VoiceNote.tsx
|
|
19245
|
-
var
|
|
19246
|
-
function
|
|
19304
|
+
var kw = 48, Aw = 48, jw = 100, Mw = (e) => `${Math.floor(e / 60)}:${String(Math.floor(e % 60)).padStart(2, "0")}`;
|
|
19305
|
+
function Nw(e, t) {
|
|
19247
19306
|
return e.length ? Array.from({ length: t }, (n, r) => {
|
|
19248
19307
|
let i = Math.floor(r * e.length / t), a = Math.max(i + 1, Math.floor((r + 1) * e.length / t));
|
|
19249
19308
|
return Math.max(...e.slice(i, a));
|
|
19250
19309
|
}) : Array.from({ length: t }, () => 0);
|
|
19251
19310
|
}
|
|
19252
|
-
function
|
|
19311
|
+
function Pw(e) {
|
|
19253
19312
|
let [t, n] = m("idle"), [r, i] = m(0), [a, s] = m([]), [c, u] = m(null), [d, f] = m(!1), [h, g] = m(!1), _ = p(null), v = p([]), y = p(0), b = p(null), x = p(0), S = () => {
|
|
19254
19313
|
b.current && clearInterval(b.current), b.current = null;
|
|
19255
19314
|
}, C = o(async () => {
|
|
@@ -19268,7 +19327,7 @@ function Nw(e) {
|
|
|
19268
19327
|
blob: r,
|
|
19269
19328
|
url: URL.createObjectURL(r),
|
|
19270
19329
|
seconds: i,
|
|
19271
|
-
bars:
|
|
19330
|
+
bars: Nw(v.current, Aw)
|
|
19272
19331
|
};
|
|
19273
19332
|
}, []), w = o((e) => {
|
|
19274
19333
|
u(e), n("review");
|
|
@@ -19280,9 +19339,9 @@ function Nw(e) {
|
|
|
19280
19339
|
n("starting");
|
|
19281
19340
|
let t;
|
|
19282
19341
|
try {
|
|
19283
|
-
t = await
|
|
19342
|
+
t = await Ow();
|
|
19284
19343
|
} catch (t) {
|
|
19285
|
-
e === x.current && n(t instanceof
|
|
19344
|
+
e === x.current && n(t instanceof Ew ? t.reason : "failed");
|
|
19286
19345
|
return;
|
|
19287
19346
|
}
|
|
19288
19347
|
e === x.current ? (_.current = t, v.current = [], y.current = Date.now(), i(0), s([]), n("recording"), b.current = setInterval(() => {
|
|
@@ -19291,7 +19350,7 @@ function Nw(e) {
|
|
|
19291
19350
|
v.current.push(e.level()), s(v.current.slice(-48));
|
|
19292
19351
|
let t = (Date.now() - y.current) / 1e3;
|
|
19293
19352
|
i(Math.floor(t)), t >= 300 && T();
|
|
19294
|
-
},
|
|
19353
|
+
}, jw)) : t.cancel();
|
|
19295
19354
|
}, [T]), D = o(() => {
|
|
19296
19355
|
x.current++, S(), _.current?.cancel(), _.current = null, u(null), g(!1), n("idle");
|
|
19297
19356
|
}, []), O = o(async (t) => {
|
|
@@ -19322,7 +19381,7 @@ function Nw(e) {
|
|
|
19322
19381
|
}, [c]), {
|
|
19323
19382
|
phase: t,
|
|
19324
19383
|
seconds: r,
|
|
19325
|
-
liveBars: [...Array.from({ length:
|
|
19384
|
+
liveBars: [...Array.from({ length: kw - a.length }, () => 0), ...a],
|
|
19326
19385
|
review: c,
|
|
19327
19386
|
sending: d,
|
|
19328
19387
|
sendFailed: h,
|
|
@@ -19334,7 +19393,7 @@ function Nw(e) {
|
|
|
19334
19393
|
dismiss: () => n("idle")
|
|
19335
19394
|
};
|
|
19336
19395
|
}
|
|
19337
|
-
function
|
|
19396
|
+
function Fw({ values: e, className: t, played: n }) {
|
|
19338
19397
|
return /* @__PURE__ */ z("span", {
|
|
19339
19398
|
className: "flex h-8 min-w-0 flex-1 items-center justify-between gap-px overflow-hidden",
|
|
19340
19399
|
"aria-hidden": "true",
|
|
@@ -19344,7 +19403,7 @@ function Pw({ values: e, className: t, played: n }) {
|
|
|
19344
19403
|
}, i))
|
|
19345
19404
|
});
|
|
19346
19405
|
}
|
|
19347
|
-
function
|
|
19406
|
+
function Iw({ voice: e }) {
|
|
19348
19407
|
let { t } = I("inbox"), n = t("composer.voice.failed");
|
|
19349
19408
|
return e.phase === "lost" ? n = t("composer.voice.lost") : e.phase === "blocked" ? n = /* @__PURE__ */ B(R, { children: [
|
|
19350
19409
|
/* @__PURE__ */ z("strong", { children: t("composer.voice.blockedTitle") }),
|
|
@@ -19378,7 +19437,7 @@ function Fw({ voice: e }) {
|
|
|
19378
19437
|
]
|
|
19379
19438
|
});
|
|
19380
19439
|
}
|
|
19381
|
-
function
|
|
19440
|
+
function Lw({ onClick: e }) {
|
|
19382
19441
|
let { t } = I("inbox");
|
|
19383
19442
|
return /* @__PURE__ */ z(K, {
|
|
19384
19443
|
variant: "ghost",
|
|
@@ -19393,7 +19452,7 @@ function Iw({ onClick: e }) {
|
|
|
19393
19452
|
})
|
|
19394
19453
|
});
|
|
19395
19454
|
}
|
|
19396
|
-
function
|
|
19455
|
+
function Rw({ onClick: e, disabled: t }) {
|
|
19397
19456
|
let { t: n } = I("inbox");
|
|
19398
19457
|
return /* @__PURE__ */ z(K, {
|
|
19399
19458
|
size: "icon-touch",
|
|
@@ -19408,13 +19467,13 @@ function Lw({ onClick: e, disabled: t }) {
|
|
|
19408
19467
|
})
|
|
19409
19468
|
});
|
|
19410
19469
|
}
|
|
19411
|
-
function
|
|
19412
|
-
let { t: n } = I("inbox"), r = p(null), [i, a] = m(!1), [o, s] = m(0), [c] = m(() => document.createElement("audio").canPlayType("audio/ogg; codecs=opus") !== ""), l = i ? `${
|
|
19470
|
+
function zw({ voice: e, review: t }) {
|
|
19471
|
+
let { t: n } = I("inbox"), r = p(null), [i, a] = m(!1), [o, s] = m(0), [c] = m(() => document.createElement("audio").canPlayType("audio/ogg; codecs=opus") !== ""), l = i ? `${Mw(o)} / ${Mw(t.seconds)}` : Mw(t.seconds);
|
|
19413
19472
|
return /* @__PURE__ */ B("div", {
|
|
19414
19473
|
className: "flex items-center gap-1.5",
|
|
19415
19474
|
"data-testid": "voice-review",
|
|
19416
19475
|
children: [
|
|
19417
|
-
/* @__PURE__ */ z(
|
|
19476
|
+
/* @__PURE__ */ z(Lw, { onClick: e.discard }),
|
|
19418
19477
|
/* @__PURE__ */ B("div", {
|
|
19419
19478
|
className: "flex h-11 min-w-0 flex-1 items-center gap-2.5 rounded-full bg-muted py-1 pr-3.5 pl-1",
|
|
19420
19479
|
children: [
|
|
@@ -19430,7 +19489,7 @@ function Rw({ voice: e, review: t }) {
|
|
|
19430
19489
|
className: "size-9 shrink-0 rounded-full",
|
|
19431
19490
|
children: z(i ? Sn : En, { "aria-hidden": "true" })
|
|
19432
19491
|
}),
|
|
19433
|
-
/* @__PURE__ */ z(
|
|
19492
|
+
/* @__PURE__ */ z(Fw, {
|
|
19434
19493
|
values: t.bars,
|
|
19435
19494
|
className: "bg-muted-foreground/50",
|
|
19436
19495
|
played: i ? o / t.seconds : void 0
|
|
@@ -19457,37 +19516,37 @@ function Rw({ voice: e, review: t }) {
|
|
|
19457
19516
|
})
|
|
19458
19517
|
]
|
|
19459
19518
|
}),
|
|
19460
|
-
/* @__PURE__ */ z(
|
|
19519
|
+
/* @__PURE__ */ z(Rw, {
|
|
19461
19520
|
disabled: e.sending,
|
|
19462
19521
|
onClick: () => void e.sendReviewed()
|
|
19463
19522
|
})
|
|
19464
19523
|
]
|
|
19465
19524
|
});
|
|
19466
19525
|
}
|
|
19467
|
-
function
|
|
19526
|
+
function Bw({ voice: e }) {
|
|
19468
19527
|
let { t } = I("inbox");
|
|
19469
19528
|
return /* @__PURE__ */ B("div", {
|
|
19470
19529
|
className: "flex items-center gap-1.5",
|
|
19471
19530
|
"data-testid": "voice-recording",
|
|
19472
19531
|
children: [
|
|
19473
|
-
/* @__PURE__ */ z(
|
|
19532
|
+
/* @__PURE__ */ z(Lw, { onClick: e.discard }),
|
|
19474
19533
|
/* @__PURE__ */ z("span", {
|
|
19475
19534
|
className: "size-2.5 shrink-0 animate-pulse rounded-full bg-destructive motion-reduce:animate-none",
|
|
19476
19535
|
"aria-hidden": "true"
|
|
19477
19536
|
}),
|
|
19478
19537
|
/* @__PURE__ */ z("span", {
|
|
19479
19538
|
role: "timer",
|
|
19480
|
-
"aria-label": t("composer.voice.recordingTime", { time:
|
|
19539
|
+
"aria-label": t("composer.voice.recordingTime", { time: Mw(e.seconds) }),
|
|
19481
19540
|
className: "w-11 shrink-0 text-sm font-semibold tabular-nums",
|
|
19482
|
-
children:
|
|
19541
|
+
children: Mw(e.seconds)
|
|
19483
19542
|
}),
|
|
19484
|
-
/* @__PURE__ */ z(
|
|
19543
|
+
/* @__PURE__ */ z(Fw, {
|
|
19485
19544
|
values: e.liveBars,
|
|
19486
19545
|
className: "bg-destructive/70"
|
|
19487
19546
|
}),
|
|
19488
19547
|
/* @__PURE__ */ z("span", {
|
|
19489
19548
|
className: "hidden shrink-0 text-xs text-muted-foreground sm:inline",
|
|
19490
|
-
children: t("composer.voice.maxLength", { time:
|
|
19549
|
+
children: t("composer.voice.maxLength", { time: Mw(300) })
|
|
19491
19550
|
}),
|
|
19492
19551
|
/* @__PURE__ */ B(K, {
|
|
19493
19552
|
variant: "outline",
|
|
@@ -19500,42 +19559,42 @@ function zw({ voice: e }) {
|
|
|
19500
19559
|
"aria-hidden": "true"
|
|
19501
19560
|
}), t("composer.voice.review")]
|
|
19502
19561
|
}),
|
|
19503
|
-
/* @__PURE__ */ z(
|
|
19562
|
+
/* @__PURE__ */ z(Rw, {
|
|
19504
19563
|
disabled: e.sending,
|
|
19505
19564
|
onClick: () => void e.sendNow()
|
|
19506
19565
|
})
|
|
19507
19566
|
]
|
|
19508
19567
|
});
|
|
19509
19568
|
}
|
|
19510
|
-
function
|
|
19569
|
+
function Vw({ voice: e }) {
|
|
19511
19570
|
return [
|
|
19512
19571
|
"blocked",
|
|
19513
19572
|
"no-microphone",
|
|
19514
19573
|
"failed",
|
|
19515
19574
|
"lost"
|
|
19516
|
-
].includes(e.phase) ? /* @__PURE__ */ z(
|
|
19575
|
+
].includes(e.phase) ? /* @__PURE__ */ z(Iw, { voice: e }) : e.phase === "review" && e.review ? /* @__PURE__ */ z(zw, {
|
|
19517
19576
|
voice: e,
|
|
19518
19577
|
review: e.review
|
|
19519
|
-
}) : /* @__PURE__ */ z(
|
|
19578
|
+
}) : /* @__PURE__ */ z(Bw, { voice: e });
|
|
19520
19579
|
}
|
|
19521
19580
|
// src/inbox/Composer.tsx
|
|
19522
|
-
var
|
|
19523
|
-
function
|
|
19581
|
+
var Hw = 2e3, Uw = 160;
|
|
19582
|
+
function Ww() {
|
|
19524
19583
|
try {
|
|
19525
19584
|
return typeof window < "u" && !!window.matchMedia?.("(pointer: coarse)").matches;
|
|
19526
19585
|
} catch {
|
|
19527
19586
|
return !1;
|
|
19528
19587
|
}
|
|
19529
19588
|
}
|
|
19530
|
-
function
|
|
19589
|
+
function Gw(e) {
|
|
19531
19590
|
let t = /^\/(\S*)$/.exec(e);
|
|
19532
19591
|
return t ? t[1] ?? "" : null;
|
|
19533
19592
|
}
|
|
19534
|
-
function
|
|
19593
|
+
function Kw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping: i, confirmSend: a, disabled: o = !1, placeholder: s, replyTo: c = null, onCancelReply: f }) {
|
|
19535
19594
|
let { t: h } = I("inbox"), [g, _] = m(""), [v, y] = m(0), [b, x] = m(!1), [S, C] = m(!1), [w, T] = m(!1), E = p(null), D = p(null), O = p(null), k = p(null), A = p(0), j = p({
|
|
19536
19595
|
start: 0,
|
|
19537
19596
|
end: 0
|
|
19538
|
-
}), ee = p(null), te = u(), [M] = m(
|
|
19597
|
+
}), ee = p(null), te = u(), [M] = m(Ww), [ne] = m(Tw), re = Pw(async (e, t) => !r || o || !await ce() ? !1 : (await r(e, t), !0)), N = S ? "" : Gw(g), ie = N == null ? [] : _w(e, N), ae = N != null && !b && e.length > 0;
|
|
19539
19598
|
l(() => {
|
|
19540
19599
|
y(0);
|
|
19541
19600
|
}, [N]);
|
|
@@ -19549,7 +19608,7 @@ function Gw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping:
|
|
|
19549
19608
|
if (!e) return;
|
|
19550
19609
|
e.style.height = "auto";
|
|
19551
19610
|
let t = getComputedStyle(e), n = parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), r = e.scrollHeight + (Number.isFinite(n) ? n : 0);
|
|
19552
|
-
e.style.height = `${Math.min(r,
|
|
19611
|
+
e.style.height = `${Math.min(r, Uw)}px`, e.style.overflowY = r > Uw ? "auto" : "hidden";
|
|
19553
19612
|
}
|
|
19554
19613
|
if (t(), ee.current != null && (e.focus(), e.setSelectionRange(ee.current, ee.current), ee.current = null), typeof ResizeObserver > "u") return;
|
|
19555
19614
|
let n = e.clientWidth, r = new ResizeObserver(() => {
|
|
@@ -19562,7 +19621,7 @@ function Gw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping:
|
|
|
19562
19621
|
r === g ? (E.current?.focus(), E.current?.setSelectionRange(i, i)) : ee.current = i, _(r), C(!1), x(!1), fe(r);
|
|
19563
19622
|
}
|
|
19564
19623
|
function se(e) {
|
|
19565
|
-
let t = S &&
|
|
19624
|
+
let t = S && Gw(g) == null && g.trim() ? `${g}\n${e.body}` : e.body;
|
|
19566
19625
|
_(t), C(!1), x(!0), requestAnimationFrame(() => {
|
|
19567
19626
|
let e = E.current;
|
|
19568
19627
|
e && (e.focus(), e.setSelectionRange(t.length, t.length));
|
|
@@ -19594,12 +19653,12 @@ function Gw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping:
|
|
|
19594
19653
|
}
|
|
19595
19654
|
function de(e) {
|
|
19596
19655
|
let t = e.target.value;
|
|
19597
|
-
_(t), C(!1),
|
|
19656
|
+
_(t), C(!1), Gw(t) ?? x(!1), fe(t);
|
|
19598
19657
|
}
|
|
19599
19658
|
function fe(e) {
|
|
19600
19659
|
if (i && e.length > 0) {
|
|
19601
19660
|
let e = Date.now();
|
|
19602
|
-
e - A.current >=
|
|
19661
|
+
e - A.current >= Hw && (A.current = e, i());
|
|
19603
19662
|
}
|
|
19604
19663
|
}
|
|
19605
19664
|
function pe(e) {
|
|
@@ -19658,13 +19717,13 @@ function Gw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping:
|
|
|
19658
19717
|
"aria-hidden": "true"
|
|
19659
19718
|
}), h("composer.voice.insecure")]
|
|
19660
19719
|
}),
|
|
19661
|
-
/* @__PURE__ */ B(
|
|
19720
|
+
/* @__PURE__ */ B(gC, {
|
|
19662
19721
|
open: ae,
|
|
19663
19722
|
onOpenChange: (e) => {
|
|
19664
19723
|
e || (x(!0), C(!1));
|
|
19665
19724
|
},
|
|
19666
19725
|
children: [
|
|
19667
|
-
/* @__PURE__ */ z(
|
|
19726
|
+
/* @__PURE__ */ z(yC, {
|
|
19668
19727
|
asChild: !0,
|
|
19669
19728
|
children: /* @__PURE__ */ B("div", {
|
|
19670
19729
|
ref: O,
|
|
@@ -19691,7 +19750,7 @@ function Gw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping:
|
|
|
19691
19750
|
"aria-hidden": "true"
|
|
19692
19751
|
})
|
|
19693
19752
|
}),
|
|
19694
|
-
/* @__PURE__ */ z(
|
|
19753
|
+
/* @__PURE__ */ z(Cw, {
|
|
19695
19754
|
disabled: o,
|
|
19696
19755
|
onOpen: () => {
|
|
19697
19756
|
let e = E.current;
|
|
@@ -19757,7 +19816,7 @@ function Gw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping:
|
|
|
19757
19816
|
className: "mt-1 text-muted-foreground",
|
|
19758
19817
|
children: [/* @__PURE__ */ z(dn, { "aria-hidden": "true" }), h("composer.quickReplies")]
|
|
19759
19818
|
}),
|
|
19760
|
-
/* @__PURE__ */ z(
|
|
19819
|
+
/* @__PURE__ */ z(vC, {
|
|
19761
19820
|
id: te,
|
|
19762
19821
|
side: "top",
|
|
19763
19822
|
align: "start",
|
|
@@ -19768,7 +19827,7 @@ function Gw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping:
|
|
|
19768
19827
|
(O.current?.contains(e.target) || k.current?.contains(e.target)) && e.preventDefault();
|
|
19769
19828
|
},
|
|
19770
19829
|
className: "w-(--radix-popover-trigger-width) max-w-[calc(100vw-1rem)] overflow-hidden p-0",
|
|
19771
|
-
children: /* @__PURE__ */ z(
|
|
19830
|
+
children: /* @__PURE__ */ z(vw, {
|
|
19772
19831
|
replies: e,
|
|
19773
19832
|
query: N ?? "",
|
|
19774
19833
|
activeIndex: v,
|
|
@@ -19778,10 +19837,10 @@ function Gw({ quickReplies: e, onSend: t, onAttach: n, onVoiceNote: r, onTyping:
|
|
|
19778
19837
|
})
|
|
19779
19838
|
]
|
|
19780
19839
|
})
|
|
19781
|
-
] }) : /* @__PURE__ */ B(R, { children: [_e, /* @__PURE__ */ z(
|
|
19840
|
+
] }) : /* @__PURE__ */ B(R, { children: [_e, /* @__PURE__ */ z(Vw, { voice: re })] });
|
|
19782
19841
|
}
|
|
19783
19842
|
// src/inbox/PanelHeader.tsx
|
|
19784
|
-
function
|
|
19843
|
+
function qw({ icon: e, title: t, description: n, action: r, closeLabel: i, onClose: a }) {
|
|
19785
19844
|
return /* @__PURE__ */ B("div", {
|
|
19786
19845
|
className: "border-b pb-2.5 pl-4 pr-1.5 pt-1",
|
|
19787
19846
|
children: [/* @__PURE__ */ B("div", {
|
|
@@ -19811,7 +19870,7 @@ function Kw({ icon: e, title: t, description: n, action: r, closeLabel: i, onClo
|
|
|
19811
19870
|
});
|
|
19812
19871
|
}
|
|
19813
19872
|
// src/inbox/TagInput.tsx
|
|
19814
|
-
function
|
|
19873
|
+
function Jw({ value: e, onChange: t, suggestions: n = [], onQueryChange: r, id: i, ...a }) {
|
|
19815
19874
|
let { t: o } = I(["inbox", "common"]), s = u(), [c, l] = m(""), [d, f] = m(!1), p = e.length >= je, h = new Set(e.map((e) => at(e))), g = at(c), _ = n.filter((e) => !h.has(at(e)) && at(e).startsWith(g)).slice(0, 8), v = d && !p && _.length > 0;
|
|
19816
19875
|
function y(e) {
|
|
19817
19876
|
l(e), r?.(ct(e));
|
|
@@ -19914,13 +19973,13 @@ function qw({ value: e, onChange: t, suggestions: n = [], onQueryChange: r, id:
|
|
|
19914
19973
|
});
|
|
19915
19974
|
}
|
|
19916
19975
|
// src/inbox/CustomerPanel.tsx
|
|
19917
|
-
var
|
|
19976
|
+
var Yw = [
|
|
19918
19977
|
"name",
|
|
19919
19978
|
"company",
|
|
19920
19979
|
"email",
|
|
19921
19980
|
"otherPhone",
|
|
19922
19981
|
"address"
|
|
19923
|
-
],
|
|
19982
|
+
], Xw = [
|
|
19924
19983
|
{
|
|
19925
19984
|
key: "name",
|
|
19926
19985
|
type: "text"
|
|
@@ -19942,10 +20001,10 @@ var Jw = [
|
|
|
19942
20001
|
type: "area"
|
|
19943
20002
|
}
|
|
19944
20003
|
];
|
|
19945
|
-
function Xw(e) {
|
|
19946
|
-
return Jw.some((t) => !!e[t]?.trim()) || e.tags.length > 0;
|
|
19947
|
-
}
|
|
19948
20004
|
function Zw(e) {
|
|
20005
|
+
return Yw.some((t) => !!e[t]?.trim()) || e.tags.length > 0;
|
|
20006
|
+
}
|
|
20007
|
+
function Qw(e) {
|
|
19949
20008
|
return {
|
|
19950
20009
|
name: e.name ?? "",
|
|
19951
20010
|
company: e.company ?? "",
|
|
@@ -19955,44 +20014,44 @@ function Zw(e) {
|
|
|
19955
20014
|
tags: [...e.tags]
|
|
19956
20015
|
};
|
|
19957
20016
|
}
|
|
19958
|
-
function
|
|
20017
|
+
function $w(e, t) {
|
|
19959
20018
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
19960
20019
|
}
|
|
19961
|
-
function
|
|
19962
|
-
return
|
|
20020
|
+
function eT(e, t) {
|
|
20021
|
+
return Yw.every((n) => e[n].trim() === t[n].trim()) && $w(e.tags, t.tags);
|
|
19963
20022
|
}
|
|
19964
|
-
function
|
|
20023
|
+
function tT(e, t, n) {
|
|
19965
20024
|
let r = {
|
|
19966
20025
|
...n,
|
|
19967
|
-
tags:
|
|
20026
|
+
tags: $w(e.tags, t.tags) ? n.tags : e.tags
|
|
19968
20027
|
};
|
|
19969
|
-
for (let n of
|
|
20028
|
+
for (let n of Yw) e[n].trim() !== t[n].trim() && (r[n] = e[n]);
|
|
19970
20029
|
return r;
|
|
19971
20030
|
}
|
|
19972
|
-
function
|
|
20031
|
+
function nT(e) {
|
|
19973
20032
|
let t = e.lastIndexOf("@");
|
|
19974
20033
|
return t < 1 || /[?#%&\s\p{Cc}]/u.test(e) ? null : `mailto:${encodeURIComponent(e.slice(0, t))}@${e.slice(t + 1)}`;
|
|
19975
20034
|
}
|
|
19976
|
-
function
|
|
20035
|
+
function rT(e, t) {
|
|
19977
20036
|
return /^\+?[\d\s()-]+$/.test(e) || !!t && e.replace(/\D/g, "") === t;
|
|
19978
20037
|
}
|
|
19979
|
-
function
|
|
20038
|
+
function iT(e, t) {
|
|
19980
20039
|
let n = e?.trim() ?? "";
|
|
19981
|
-
return n && !
|
|
20040
|
+
return n && !rT(n, t) ? n : "";
|
|
19982
20041
|
}
|
|
19983
|
-
function
|
|
20042
|
+
function aT(e, t, n) {
|
|
19984
20043
|
let r = t ?? n?.phone;
|
|
19985
20044
|
return [
|
|
19986
20045
|
e,
|
|
19987
20046
|
n?.pushName ?? null,
|
|
19988
20047
|
n?.savedName ?? null
|
|
19989
|
-
].map((e) =>
|
|
20048
|
+
].map((e) => iT(e, r)).find((e) => !!e) || null;
|
|
19990
20049
|
}
|
|
19991
|
-
function
|
|
19992
|
-
let r =
|
|
20050
|
+
function oT(e, t, n) {
|
|
20051
|
+
let r = iT(e, t), i = [r && r !== n ? r : null, t ? `+${t}` : null].filter((e) => !!e);
|
|
19993
20052
|
return i.length ? i.join(" · ") : null;
|
|
19994
20053
|
}
|
|
19995
|
-
function
|
|
20054
|
+
function sT({ facts: e }) {
|
|
19996
20055
|
let { t } = I("inbox"), n = u(), r = [];
|
|
19997
20056
|
if (e.pushName && r.push({
|
|
19998
20057
|
key: "push",
|
|
@@ -20056,14 +20115,14 @@ function oT({ facts: e }) {
|
|
|
20056
20115
|
})]
|
|
20057
20116
|
});
|
|
20058
20117
|
}
|
|
20059
|
-
function
|
|
20060
|
-
let { t: a } = I("inbox"), o = e.name?.trim() || null, s = o ? null :
|
|
20118
|
+
function cT({ profile: e, whatsappName: t, whatsappPhone: n, whatsapp: r, directory: i }) {
|
|
20119
|
+
let { t: a } = I("inbox"), o = e.name?.trim() || null, s = o ? null : aT(t, n, r), c = r ? null : oT(t, n, o), l = e.updatedBy != null && i?.me != null && e.updatedBy === i.me.id, u = i?.nameOf(e.updatedBy) ?? null, d = [];
|
|
20061
20120
|
if (e.company && d.push({
|
|
20062
20121
|
key: "company",
|
|
20063
20122
|
label: a("customer.company"),
|
|
20064
20123
|
value: e.company
|
|
20065
20124
|
}), e.email) {
|
|
20066
|
-
let t =
|
|
20125
|
+
let t = nT(e.email);
|
|
20067
20126
|
d.push({
|
|
20068
20127
|
key: "email",
|
|
20069
20128
|
label: a("customer.email"),
|
|
@@ -20144,11 +20203,11 @@ function sT({ profile: e, whatsappName: t, whatsappPhone: n, whatsapp: r, direct
|
|
|
20144
20203
|
when: ms(e.updatedAt)
|
|
20145
20204
|
}) : a("customer.updated", { when: ms(e.updatedAt) })
|
|
20146
20205
|
}),
|
|
20147
|
-
r && /* @__PURE__ */ z(
|
|
20206
|
+
r && /* @__PURE__ */ z(sT, { facts: r })
|
|
20148
20207
|
]
|
|
20149
20208
|
});
|
|
20150
20209
|
}
|
|
20151
|
-
function
|
|
20210
|
+
function lT(e, t) {
|
|
20152
20211
|
let n = {};
|
|
20153
20212
|
for (let r of e) {
|
|
20154
20213
|
let e = r.path[0];
|
|
@@ -20158,11 +20217,11 @@ function cT(e, t) {
|
|
|
20158
20217
|
}
|
|
20159
20218
|
return n;
|
|
20160
20219
|
}
|
|
20161
|
-
function
|
|
20162
|
-
let { t: f } = I("inbox"), h = u(), g = p(null), [_] = m(() =>
|
|
20220
|
+
function uT({ jid: e, snapshot: t, latest: n, whatsappName: r, whatsappPhone: i, whatsapp: a, directory: o, onDone: s, escapeRef: c, guardRef: l }) {
|
|
20221
|
+
let { t: f } = I("inbox"), h = u(), g = p(null), [_] = m(() => Qw(t)), [v] = m(() => _.name ? _ : {
|
|
20163
20222
|
..._,
|
|
20164
|
-
name:
|
|
20165
|
-
}), [y, b] = m(v), x =
|
|
20223
|
+
name: aT(r, i, a) ?? ""
|
|
20224
|
+
}), [y, b] = m(v), x = oT(r, i, t.name?.trim() || null), [S, C] = m({}), [w, T] = m(""), [E, D] = m(null), O = Ca(w), k = Sa(e), A = !eT(y, v);
|
|
20166
20225
|
function j(e) {
|
|
20167
20226
|
A ? D(() => e) : e();
|
|
20168
20227
|
}
|
|
@@ -20190,11 +20249,11 @@ function lT({ jid: e, snapshot: t, latest: n, whatsappName: r, whatsappPhone: i,
|
|
|
20190
20249
|
let t = ct(w), r = t && y.tags.length < je && !y.tags.some((e) => at(e) === at(t)) ? {
|
|
20191
20250
|
...y,
|
|
20192
20251
|
tags: [...y.tags, t]
|
|
20193
|
-
} : y, i = Ie.safeParse(
|
|
20252
|
+
} : y, i = Ie.safeParse(tT(r, _, Qw(n)));
|
|
20194
20253
|
i.success ? (C({}), k.mutate(i.data, {
|
|
20195
20254
|
onSuccess: s,
|
|
20196
20255
|
onError: (e) => V.error(f("customer.saveFailed"), { description: U(e) })
|
|
20197
|
-
})) : C(
|
|
20256
|
+
})) : C(lT(i.error.issues, f));
|
|
20198
20257
|
}
|
|
20199
20258
|
function ae(e) {
|
|
20200
20259
|
e.key === "Enter" && (e.ctrlKey || e.metaKey) ? (e.preventDefault(), g.current?.requestSubmit()) : e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), ee());
|
|
@@ -20214,7 +20273,7 @@ function lT({ jid: e, snapshot: t, latest: n, whatsappName: r, whatsappPhone: i,
|
|
|
20214
20273
|
className: "rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",
|
|
20215
20274
|
children: ne ? f("customer.changedWhileEditingYou") : re ? f("customer.changedWhileEditing", { name: re }) : f("customer.changedWhileEditingUnknown")
|
|
20216
20275
|
}),
|
|
20217
|
-
|
|
20276
|
+
Xw.map(({ key: e, type: t }) => {
|
|
20218
20277
|
let n = `${h}-${e}`, r = `${n}-error`, a = {
|
|
20219
20278
|
id: n,
|
|
20220
20279
|
value: y[e],
|
|
@@ -20260,7 +20319,7 @@ function lT({ jid: e, snapshot: t, latest: n, whatsappName: r, whatsappPhone: i,
|
|
|
20260
20319
|
htmlFor: `${h}-tags`,
|
|
20261
20320
|
children: f("customer.tags")
|
|
20262
20321
|
}),
|
|
20263
|
-
/* @__PURE__ */ z(
|
|
20322
|
+
/* @__PURE__ */ z(Jw, {
|
|
20264
20323
|
id: `${h}-tags`,
|
|
20265
20324
|
value: y.tags,
|
|
20266
20325
|
onChange: (e) => {
|
|
@@ -20284,7 +20343,7 @@ function lT({ jid: e, snapshot: t, latest: n, whatsappName: r, whatsappPhone: i,
|
|
|
20284
20343
|
})
|
|
20285
20344
|
]
|
|
20286
20345
|
}),
|
|
20287
|
-
a ? /* @__PURE__ */ z(
|
|
20346
|
+
a ? /* @__PURE__ */ z(sT, { facts: a }) : x && /* @__PURE__ */ z("p", {
|
|
20288
20347
|
className: "text-xs text-muted-foreground [overflow-wrap:anywhere]",
|
|
20289
20348
|
children: f("customer.whatsappName", { name: x })
|
|
20290
20349
|
})
|
|
@@ -20331,9 +20390,9 @@ function lT({ jid: e, snapshot: t, latest: n, whatsappName: r, whatsappPhone: i,
|
|
|
20331
20390
|
]
|
|
20332
20391
|
});
|
|
20333
20392
|
}
|
|
20334
|
-
function
|
|
20335
|
-
let { t: s } = I(["inbox", "common"]), c = xa(e), [l, u] = m(null), d = c.data, f = () => o.current ? o.current(n) : n(), p = !l && !c.isError && d &&
|
|
20336
|
-
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(
|
|
20393
|
+
function dT({ jid: e, directory: t, onClose: n, title: r, description: i, escapeRef: a, guardRef: o }) {
|
|
20394
|
+
let { t: s } = I(["inbox", "common"]), c = xa(e), [l, u] = m(null), d = c.data, f = () => o.current ? o.current(n) : n(), p = !l && !c.isError && d && Zw(d.profile) ? d : null;
|
|
20395
|
+
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(qw, {
|
|
20337
20396
|
icon: /* @__PURE__ */ z(nr, {
|
|
20338
20397
|
className: "size-4 shrink-0 text-muted-foreground",
|
|
20339
20398
|
"aria-hidden": "true"
|
|
@@ -20349,7 +20408,7 @@ function uT({ jid: e, directory: t, onClose: n, title: r, description: i, escape
|
|
|
20349
20408
|
className: "shrink-0 text-muted-foreground",
|
|
20350
20409
|
children: [/* @__PURE__ */ z(wn, { "aria-hidden": "true" }), s("customer.edit")]
|
|
20351
20410
|
})
|
|
20352
|
-
}), l ? /* @__PURE__ */ z(
|
|
20411
|
+
}), l ? /* @__PURE__ */ z(uT, {
|
|
20353
20412
|
jid: e,
|
|
20354
20413
|
snapshot: l,
|
|
20355
20414
|
latest: d?.profile ?? l,
|
|
@@ -20385,7 +20444,7 @@ function uT({ jid: e, directory: t, onClose: n, title: r, description: i, escape
|
|
|
20385
20444
|
}), s("common:actions.tryAgain")]
|
|
20386
20445
|
}),
|
|
20387
20446
|
children: U(c.error)
|
|
20388
|
-
}) :
|
|
20447
|
+
}) : Zw(d.profile) ? /* @__PURE__ */ z(cT, {
|
|
20389
20448
|
profile: d.profile,
|
|
20390
20449
|
whatsappName: d.whatsappName,
|
|
20391
20450
|
whatsappPhone: d.whatsappPhone ?? null,
|
|
@@ -20411,19 +20470,19 @@ function uT({ jid: e, directory: t, onClose: n, title: r, description: i, escape
|
|
|
20411
20470
|
children: [/* @__PURE__ */ z(Dn, { "aria-hidden": "true" }), s("customer.addDetails")]
|
|
20412
20471
|
})
|
|
20413
20472
|
]
|
|
20414
|
-
}), d.whatsapp ? /* @__PURE__ */ z(
|
|
20473
|
+
}), d.whatsapp ? /* @__PURE__ */ z(sT, { facts: d.whatsapp }) : oT(d.whatsappName, d.whatsappPhone, null) && /* @__PURE__ */ z("p", {
|
|
20415
20474
|
className: "text-xs text-muted-foreground [overflow-wrap:anywhere]",
|
|
20416
|
-
children: s("customer.whatsappName", { name:
|
|
20475
|
+
children: s("customer.whatsappName", { name: oT(d.whatsappName, d.whatsappPhone, null) })
|
|
20417
20476
|
})]
|
|
20418
20477
|
})
|
|
20419
20478
|
})] });
|
|
20420
20479
|
}
|
|
20421
|
-
function
|
|
20480
|
+
function fT({ open: e, onClose: t, guardRef: n, ...r }) {
|
|
20422
20481
|
let { t: i } = I("inbox"), a = go("(min-width: 1024px)"), o = p(null), s = p(null), c = n ?? s, l = p(null);
|
|
20423
20482
|
return a ? e ? /* @__PURE__ */ z("aside", {
|
|
20424
20483
|
"aria-label": i("customer.title"),
|
|
20425
20484
|
className: "flex w-80 shrink-0 flex-col border-l bg-surface",
|
|
20426
|
-
children: /* @__PURE__ */ z(
|
|
20485
|
+
children: /* @__PURE__ */ z(dT, {
|
|
20427
20486
|
...r,
|
|
20428
20487
|
onClose: t,
|
|
20429
20488
|
escapeRef: o,
|
|
@@ -20447,7 +20506,7 @@ function dT({ open: e, onClose: t, guardRef: n, ...r }) {
|
|
|
20447
20506
|
onEscapeKeyDown: (e) => {
|
|
20448
20507
|
o.current?.() && e.preventDefault();
|
|
20449
20508
|
},
|
|
20450
|
-
children: /* @__PURE__ */ z(
|
|
20509
|
+
children: /* @__PURE__ */ z(dT, {
|
|
20451
20510
|
...r,
|
|
20452
20511
|
onClose: t,
|
|
20453
20512
|
escapeRef: o,
|
|
@@ -20467,9 +20526,9 @@ function dT({ open: e, onClose: t, guardRef: n, ...r }) {
|
|
|
20467
20526
|
});
|
|
20468
20527
|
}
|
|
20469
20528
|
// src/inbox/ConversationHeader.tsx
|
|
20470
|
-
var
|
|
20471
|
-
function
|
|
20472
|
-
let { t: h } = I("inbox"), g =
|
|
20529
|
+
var pT = "none";
|
|
20530
|
+
function mT({ chat: e, directory: t, onBack: n, onAssign: r, onToggleStatus: i, notesOpen: a, notesCount: o, onToggleNotes: s, showCustomer: c, customerOpen: l, onToggleCustomer: u, onOpenInfo: d, memberCount: f = null, inbox: p, busy: m }) {
|
|
20531
|
+
let { t: h } = I("inbox"), g = NC(e, h), _ = e.type === "group" ? f == null ? h("chatListItem.group") : h("header.groupMembers", { count: f }) : iC(e) ?? h("header.phoneHidden"), v = e.status === "resolved", y = [...t.assignableFor(e.inboxId)];
|
|
20473
20532
|
if (e.assignedTo != null && !y.some((t) => t.id === e.assignedTo)) {
|
|
20474
20533
|
let n = t.byId.get(e.assignedTo);
|
|
20475
20534
|
y.push(n ?? {
|
|
@@ -20504,7 +20563,7 @@ function pT({ chat: e, directory: t, onBack: n, onAssign: r, onToggleStatus: i,
|
|
|
20504
20563
|
disabled: !d,
|
|
20505
20564
|
"aria-label": e.type === "group" ? h("header.openGroupInfo", { name: g }) : h("header.openCustomer", { name: g }),
|
|
20506
20565
|
className: "h-auto min-w-0 flex-1 justify-start gap-2 rounded-lg px-1.5 py-1 text-left font-normal disabled:opacity-100",
|
|
20507
|
-
children: [/* @__PURE__ */ z(
|
|
20566
|
+
children: [/* @__PURE__ */ z(LC, {
|
|
20508
20567
|
name: g,
|
|
20509
20568
|
src: e.avatarUrl,
|
|
20510
20569
|
seed: e.jid,
|
|
@@ -20513,7 +20572,7 @@ function pT({ chat: e, directory: t, onBack: n, onAssign: r, onToggleStatus: i,
|
|
|
20513
20572
|
className: "min-w-0 flex-1",
|
|
20514
20573
|
children: [/* @__PURE__ */ B("span", {
|
|
20515
20574
|
className: "flex items-center gap-1 text-base font-semibold text-foreground",
|
|
20516
|
-
children: [e.type === "group" && /* @__PURE__ */ z(
|
|
20575
|
+
children: [e.type === "group" && /* @__PURE__ */ z(cw, { className: "size-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ z("span", {
|
|
20517
20576
|
title: g,
|
|
20518
20577
|
className: "line-clamp-2 whitespace-normal [overflow-wrap:anywhere] md:line-clamp-none md:truncate",
|
|
20519
20578
|
children: g
|
|
@@ -20537,9 +20596,9 @@ function pT({ chat: e, directory: t, onBack: n, onAssign: r, onToggleStatus: i,
|
|
|
20537
20596
|
className: "flex w-full items-center gap-2 px-1 @2xl:w-auto @2xl:px-0",
|
|
20538
20597
|
children: [
|
|
20539
20598
|
/* @__PURE__ */ B(C_, {
|
|
20540
|
-
value: e.assignedTo == null ?
|
|
20599
|
+
value: e.assignedTo == null ? pT : String(e.assignedTo),
|
|
20541
20600
|
disabled: m,
|
|
20542
|
-
onValueChange: (e) => r(e ===
|
|
20601
|
+
onValueChange: (e) => r(e === pT ? null : Number(e)),
|
|
20543
20602
|
children: [/* @__PURE__ */ z(E_, {
|
|
20544
20603
|
id: `assign-${e.jid}`,
|
|
20545
20604
|
"aria-label": h("header.assignedTo"),
|
|
@@ -20550,7 +20609,7 @@ function pT({ chat: e, directory: t, onBack: n, onAssign: r, onToggleStatus: i,
|
|
|
20550
20609
|
position: "popper",
|
|
20551
20610
|
align: "end",
|
|
20552
20611
|
children: [/* @__PURE__ */ z(k_, {
|
|
20553
|
-
value:
|
|
20612
|
+
value: pT,
|
|
20554
20613
|
className: "min-h-11 md:min-h-8",
|
|
20555
20614
|
children: h("header.unassigned")
|
|
20556
20615
|
}), y.map((e) => /* @__PURE__ */ z(k_, {
|
|
@@ -20613,7 +20672,7 @@ function pT({ chat: e, directory: t, onBack: n, onAssign: r, onToggleStatus: i,
|
|
|
20613
20672
|
});
|
|
20614
20673
|
}
|
|
20615
20674
|
// src/inbox/EventItem.tsx
|
|
20616
|
-
function
|
|
20675
|
+
function hT(e) {
|
|
20617
20676
|
for (let t of [
|
|
20618
20677
|
"assignedTo",
|
|
20619
20678
|
"to",
|
|
@@ -20625,11 +20684,11 @@ function mT(e) {
|
|
|
20625
20684
|
}
|
|
20626
20685
|
return null;
|
|
20627
20686
|
}
|
|
20628
|
-
function
|
|
20687
|
+
function gT(e, t) {
|
|
20629
20688
|
let n = e.actorId == null ? F.t("inbox:events.system") : t.nameOf(e.actorId, { youLabel: !0 }) ?? F.t("inbox:events.someone"), r = cy(e.payload.handoff) ? sy(e.payload.handoff) : null;
|
|
20630
20689
|
switch (e.type) {
|
|
20631
20690
|
case "assigned": {
|
|
20632
|
-
let i =
|
|
20691
|
+
let i = hT(e.payload);
|
|
20633
20692
|
if (r && i != null && i !== e.actorId) return F.t("inbox:events.handedTo", {
|
|
20634
20693
|
actor: n,
|
|
20635
20694
|
assignee: t.nameOf(i, { youLabel: !0 }) ?? F.t("inbox:events.someoneLower"),
|
|
@@ -20657,9 +20716,9 @@ function hT(e, t) {
|
|
|
20657
20716
|
}
|
|
20658
20717
|
}
|
|
20659
20718
|
}
|
|
20660
|
-
function
|
|
20719
|
+
function _T({ event: e, directory: t }) {
|
|
20661
20720
|
I();
|
|
20662
|
-
let n =
|
|
20721
|
+
let n = gT(e, t);
|
|
20663
20722
|
return n ? /* @__PURE__ */ z("div", {
|
|
20664
20723
|
className: "flex justify-center px-3 py-1",
|
|
20665
20724
|
children: /* @__PURE__ */ B("span", {
|
|
@@ -20672,7 +20731,7 @@ function gT({ event: e, directory: t }) {
|
|
|
20672
20731
|
})
|
|
20673
20732
|
}) : null;
|
|
20674
20733
|
}
|
|
20675
|
-
function
|
|
20734
|
+
function vT({ note: e, directory: t }) {
|
|
20676
20735
|
let { t: n } = I("inbox");
|
|
20677
20736
|
return /* @__PURE__ */ z("div", {
|
|
20678
20737
|
className: "flex justify-center px-3 py-1",
|
|
@@ -20707,7 +20766,7 @@ function _T({ note: e, directory: t }) {
|
|
|
20707
20766
|
});
|
|
20708
20767
|
}
|
|
20709
20768
|
// src/inbox/MediaView.tsx
|
|
20710
|
-
function
|
|
20769
|
+
function yT() {
|
|
20711
20770
|
let e = S();
|
|
20712
20771
|
return b({
|
|
20713
20772
|
mutationFn: (e) => H(`/media/${encodeURIComponent(e)}/redownload`, { method: "POST" }),
|
|
@@ -20716,7 +20775,7 @@ function vT() {
|
|
|
20716
20775
|
}
|
|
20717
20776
|
});
|
|
20718
20777
|
}
|
|
20719
|
-
function
|
|
20778
|
+
function bT({ src: e, alt: t, open: n, onOpenChange: r }) {
|
|
20720
20779
|
let { t: i } = I(["inbox", "common"]);
|
|
20721
20780
|
return /* @__PURE__ */ z(_o, {
|
|
20722
20781
|
open: n,
|
|
@@ -20772,8 +20831,8 @@ function yT({ src: e, alt: t, open: n, onOpenChange: r }) {
|
|
|
20772
20831
|
})
|
|
20773
20832
|
});
|
|
20774
20833
|
}
|
|
20775
|
-
function
|
|
20776
|
-
let { t: n } = I(["inbox", "common"]), [r, i] = m(!1), a =
|
|
20834
|
+
function xT({ message: e, onLoad: t }) {
|
|
20835
|
+
let { t: n } = I(["inbox", "common"]), [r, i] = m(!1), a = yT(), o = e.mediaName ?? n(`media.types.${e.type}`), s = e.mediaStatus === "pending" && !e.id.startsWith("local-"), c = s && (e.type === "image" || e.type === "sticker"), { mutate: u, isIdle: d } = a;
|
|
20777
20836
|
if (l(() => {
|
|
20778
20837
|
c && d && u(e.id);
|
|
20779
20838
|
}, [
|
|
@@ -20844,7 +20903,7 @@ function bT({ message: e, onLoad: t }) {
|
|
|
20844
20903
|
onLoad: t,
|
|
20845
20904
|
className: e.type === "sticker" ? "size-32 object-contain" : "max-h-72 w-full max-w-full object-cover sm:max-w-xs"
|
|
20846
20905
|
})
|
|
20847
|
-
}), /* @__PURE__ */ z(
|
|
20906
|
+
}), /* @__PURE__ */ z(bT, {
|
|
20848
20907
|
src: f,
|
|
20849
20908
|
alt: e.body ?? n("media.imageAlt"),
|
|
20850
20909
|
open: r,
|
|
@@ -20884,7 +20943,7 @@ function bT({ message: e, onLoad: t }) {
|
|
|
20884
20943
|
});
|
|
20885
20944
|
}
|
|
20886
20945
|
}
|
|
20887
|
-
function
|
|
20946
|
+
function ST(e) {
|
|
20888
20947
|
let t = /* @__PURE__ */ new Map();
|
|
20889
20948
|
for (let n of [...e].sort((e, t) => e.at - t.at)) {
|
|
20890
20949
|
let e = t.get(n.emoji) ?? {
|
|
@@ -20895,14 +20954,14 @@ function xT(e) {
|
|
|
20895
20954
|
}
|
|
20896
20955
|
return [...t.values()].sort((e, t) => t.reactions.length - e.reactions.length || e.reactions[0].at - t.reactions[0].at);
|
|
20897
20956
|
}
|
|
20898
|
-
function
|
|
20899
|
-
return e.fromMe && r === "" ? t("message.reactions.fromYou") : e.fromMe && r ? t("message.reactions.fromTeammate", { name: r }) : e.fromMe ? t("message.reactions.fromPhone") : e.senderName || n || (e.senderJid ?
|
|
20957
|
+
function CT(e, t, n, r) {
|
|
20958
|
+
return e.fromMe && r === "" ? t("message.reactions.fromYou") : e.fromMe && r ? t("message.reactions.fromTeammate", { name: r }) : e.fromMe ? t("message.reactions.fromPhone") : e.senderName || n || (e.senderJid ? rC(e.senderJid) : "") || t("chatListItem.unknownContact");
|
|
20900
20959
|
}
|
|
20901
|
-
function
|
|
20960
|
+
function wT({ reactions: e, out: t, contactName: n, teamName: r, onRemoveMine: i }) {
|
|
20902
20961
|
let { t: a } = I("inbox");
|
|
20903
20962
|
if (!e.length) return null;
|
|
20904
|
-
let o =
|
|
20905
|
-
return /* @__PURE__ */ B(
|
|
20963
|
+
let o = ST(e), s = a("message.reactions.label", { list: o.map((e) => `${e.emoji} ${e.reactions.length}`).join(", ") });
|
|
20964
|
+
return /* @__PURE__ */ B(gC, { children: [/* @__PURE__ */ z(_C, {
|
|
20906
20965
|
asChild: !0,
|
|
20907
20966
|
children: /* @__PURE__ */ B(K, {
|
|
20908
20967
|
type: "button",
|
|
@@ -20921,7 +20980,7 @@ function CT({ reactions: e, out: t, contactName: n, teamName: r, onRemoveMine: i
|
|
|
20921
20980
|
children: e.length
|
|
20922
20981
|
})]
|
|
20923
20982
|
})
|
|
20924
|
-
}), /* @__PURE__ */ B(
|
|
20983
|
+
}), /* @__PURE__ */ B(vC, {
|
|
20925
20984
|
align: t ? "end" : "start",
|
|
20926
20985
|
className: "w-64 max-w-[calc(100vw-2rem)] p-2",
|
|
20927
20986
|
children: [/* @__PURE__ */ z("p", {
|
|
@@ -20939,7 +20998,7 @@ function CT({ reactions: e, out: t, contactName: n, teamName: r, onRemoveMine: i
|
|
|
20939
20998
|
}),
|
|
20940
20999
|
/* @__PURE__ */ z("span", {
|
|
20941
21000
|
className: "min-w-0 flex-1 truncate text-sm",
|
|
20942
|
-
children:
|
|
21001
|
+
children: CT(t, a, n, r)
|
|
20943
21002
|
}),
|
|
20944
21003
|
t.fromMe && i && /* @__PURE__ */ z(K, {
|
|
20945
21004
|
type: "button",
|
|
@@ -20955,16 +21014,16 @@ function CT({ reactions: e, out: t, contactName: n, teamName: r, onRemoveMine: i
|
|
|
20955
21014
|
})] });
|
|
20956
21015
|
}
|
|
20957
21016
|
// src/inbox/ReactionPicker.tsx
|
|
20958
|
-
var
|
|
21017
|
+
var TT = [
|
|
20959
21018
|
"👍",
|
|
20960
21019
|
"❤️",
|
|
20961
21020
|
"😂",
|
|
20962
21021
|
"😮",
|
|
20963
21022
|
"😢",
|
|
20964
21023
|
"🙏"
|
|
20965
|
-
],
|
|
20966
|
-
function
|
|
20967
|
-
let { t: c } = I("inbox"), [l, u] = m(!1), d = t && !
|
|
21024
|
+
], ET = /* @__PURE__ */ "👍.❤️.😂.😮.😢.🙏.👏.🙌.🔥.🎉.💯.✅.👌.🤝.💪.😊.😍.🥰.😁.🤣.😅.😉.🤔.😎.😴.😭.😡.😱.🥲.🙈.👀.💐.🎂.☕.🍜.🚚.📦.💰.⭐.❌".split(".");
|
|
21025
|
+
function DT({ out: e, current: t, currentBy: n, open: r, onOpenChange: i, onReact: a, disabledReason: o, onReply: s }) {
|
|
21026
|
+
let { t: c } = I("inbox"), [l, u] = m(!1), d = t && !TT.includes(t) ? [t, ...TT.slice(0, 5)] : TT, f = (e) => {
|
|
20968
21027
|
a(e === t ? "" : e), i(!1);
|
|
20969
21028
|
}, p = (e, n) => /* @__PURE__ */ z(K, {
|
|
20970
21029
|
type: "button",
|
|
@@ -20978,12 +21037,12 @@ function ET({ out: e, current: t, currentBy: n, open: r, onOpenChange: i, onReac
|
|
|
20978
21037
|
className: G("rounded-full leading-none", n ? "size-10 text-2xl" : "size-9 text-xl", e === t && "bg-accent ring-2 ring-primary/40"),
|
|
20979
21038
|
children: e
|
|
20980
21039
|
}, e);
|
|
20981
|
-
return /* @__PURE__ */ B(
|
|
21040
|
+
return /* @__PURE__ */ B(gC, {
|
|
20982
21041
|
open: r,
|
|
20983
21042
|
onOpenChange: (e) => {
|
|
20984
21043
|
i(e), e || u(!1);
|
|
20985
21044
|
},
|
|
20986
|
-
children: [/* @__PURE__ */ z(
|
|
21045
|
+
children: [/* @__PURE__ */ z(_C, {
|
|
20987
21046
|
asChild: !0,
|
|
20988
21047
|
children: /* @__PURE__ */ z(K, {
|
|
20989
21048
|
type: "button",
|
|
@@ -20995,7 +21054,7 @@ function ET({ out: e, current: t, currentBy: n, open: r, onOpenChange: i, onReac
|
|
|
20995
21054
|
className: G("size-8 shrink-0 rounded-full text-muted-foreground opacity-0 shadow-sm transition-opacity group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:not-focus-visible:sr-only", r && "opacity-100"),
|
|
20996
21055
|
children: /* @__PURE__ */ z(Kn, { "aria-hidden": "true" })
|
|
20997
21056
|
})
|
|
20998
|
-
}), /* @__PURE__ */ B(
|
|
21057
|
+
}), /* @__PURE__ */ B(vC, {
|
|
20999
21058
|
side: "top",
|
|
21000
21059
|
align: e ? "end" : "start",
|
|
21001
21060
|
className: "w-auto max-w-[calc(100vw-2rem)] rounded-2xl p-1.5",
|
|
@@ -21019,7 +21078,7 @@ function ET({ out: e, current: t, currentBy: n, open: r, onOpenChange: i, onReac
|
|
|
21019
21078
|
className: "grid max-h-56 grid-cols-6 gap-0.5 overflow-y-auto sm:grid-cols-8",
|
|
21020
21079
|
role: "group",
|
|
21021
21080
|
"aria-label": c("message.reactions.more"),
|
|
21022
|
-
children:
|
|
21081
|
+
children: ET.map((e) => p(e, !1))
|
|
21023
21082
|
})] }) : /* @__PURE__ */ B("div", {
|
|
21024
21083
|
className: "flex items-center gap-0.5",
|
|
21025
21084
|
role: "group",
|
|
@@ -21057,8 +21116,8 @@ function ET({ out: e, current: t, currentBy: n, open: r, onOpenChange: i, onReac
|
|
|
21057
21116
|
})]
|
|
21058
21117
|
});
|
|
21059
21118
|
}
|
|
21060
|
-
var
|
|
21061
|
-
function
|
|
21119
|
+
var OT = 72, kT = 500, AT = 8;
|
|
21120
|
+
function jT(e, t) {
|
|
21062
21121
|
let [n, r] = m(0), i = p(null), a = p(null), o = () => {
|
|
21063
21122
|
a.current && clearTimeout(a.current), a.current = null;
|
|
21064
21123
|
};
|
|
@@ -21077,20 +21136,20 @@ function AT(e, t) {
|
|
|
21077
21136
|
horizontal: !1
|
|
21078
21137
|
}, o(), a.current = setTimeout(() => {
|
|
21079
21138
|
a.current = null, i.current = null, r(0), (t ?? e)();
|
|
21080
|
-
},
|
|
21139
|
+
}, kT));
|
|
21081
21140
|
},
|
|
21082
21141
|
onPointerMove(e) {
|
|
21083
21142
|
let t = i.current;
|
|
21084
21143
|
if (!t || e.pointerId !== t.id) return;
|
|
21085
21144
|
let n = e.clientX - t.x, a = e.clientY - t.y;
|
|
21086
|
-
if ((Math.abs(n) >
|
|
21087
|
-
if (Math.abs(a) >
|
|
21145
|
+
if ((Math.abs(n) > AT || Math.abs(a) > AT) && o(), !t.horizontal) {
|
|
21146
|
+
if (Math.abs(a) > AT && Math.abs(a) >= Math.abs(n)) {
|
|
21088
21147
|
i.current = null;
|
|
21089
21148
|
return;
|
|
21090
21149
|
}
|
|
21091
|
-
n >
|
|
21150
|
+
n > AT && (t.horizontal = !0);
|
|
21092
21151
|
}
|
|
21093
|
-
t.horizontal && r(Math.max(0, Math.min(n,
|
|
21152
|
+
t.horizontal && r(Math.max(0, Math.min(n, OT)));
|
|
21094
21153
|
},
|
|
21095
21154
|
onPointerUp() {
|
|
21096
21155
|
let t = i.current?.horizontal && n >= 56;
|
|
@@ -21101,11 +21160,11 @@ function AT(e, t) {
|
|
|
21101
21160
|
};
|
|
21102
21161
|
}
|
|
21103
21162
|
// src/inbox/MessageBubble.tsx
|
|
21104
|
-
function
|
|
21105
|
-
let { t: n } = I("inbox"), r = xa(e), i = `/chats/${encodeURIComponent(e)}?customer=1`, a =
|
|
21163
|
+
function MT({ chatJid: e, directory: t }) {
|
|
21164
|
+
let { t: n } = I("inbox"), r = xa(e), i = `/chats/${encodeURIComponent(e)}?customer=1`, a = sw(i);
|
|
21106
21165
|
return /* @__PURE__ */ B("div", {
|
|
21107
21166
|
className: "space-y-3",
|
|
21108
|
-
children: [r.data ? /* @__PURE__ */ z(
|
|
21167
|
+
children: [r.data ? /* @__PURE__ */ z(cT, {
|
|
21109
21168
|
profile: r.data.profile,
|
|
21110
21169
|
whatsappName: r.data.whatsappName,
|
|
21111
21170
|
directory: t
|
|
@@ -21127,12 +21186,12 @@ function jT({ chatJid: e, directory: t }) {
|
|
|
21127
21186
|
})]
|
|
21128
21187
|
});
|
|
21129
21188
|
}
|
|
21130
|
-
var
|
|
21131
|
-
function
|
|
21189
|
+
var NT = G("[&_a]:break-all [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2", "[&_code]:rounded [&_code]:bg-muted/70 [&_code]:px-1 [&_code]:font-mono [&_code]:text-[13px]", "[&_[data-block]]:block [&_[data-block]]:px-2 [&_[data-block]]:py-1", "[&_[data-quote]]:block [&_[data-quote]]:border-l-4 [&_[data-quote]]:border-border [&_[data-quote]]:pl-2 [&_[data-quote]]:text-muted-foreground", "[&_[data-bullet]]:block [&_[data-bullet]]:pl-4 [&_[data-bullet]]:-indent-3 [&_[data-bullet]]:before:content-['•_']");
|
|
21190
|
+
function PT(e, t, n) {
|
|
21132
21191
|
return e.fromMe ? t("message.you") : n || e.senderName || t("message.contact");
|
|
21133
21192
|
}
|
|
21134
|
-
function
|
|
21135
|
-
if (e.body) return ys(
|
|
21193
|
+
function FT(e, t) {
|
|
21194
|
+
if (e.body) return ys(ew(e.body), 140);
|
|
21136
21195
|
switch (e.type) {
|
|
21137
21196
|
case "image": return t("message.quote.image");
|
|
21138
21197
|
case "video": return t("message.quote.video");
|
|
@@ -21142,7 +21201,7 @@ function PT(e, t) {
|
|
|
21142
21201
|
default: return t("message.quote.message");
|
|
21143
21202
|
}
|
|
21144
21203
|
}
|
|
21145
|
-
function
|
|
21204
|
+
function IT({ status: e }) {
|
|
21146
21205
|
let { t } = I("inbox"), n = "inline-block size-3.5 shrink-0", r = t(`message.status.${e}`);
|
|
21147
21206
|
switch (e) {
|
|
21148
21207
|
case "pending": return /* @__PURE__ */ z(Bt, {
|
|
@@ -21172,7 +21231,7 @@ function FT({ status: e }) {
|
|
|
21172
21231
|
});
|
|
21173
21232
|
}
|
|
21174
21233
|
}
|
|
21175
|
-
function
|
|
21234
|
+
function LT({ message: e }) {
|
|
21176
21235
|
let { t } = I("inbox");
|
|
21177
21236
|
if (e.transcriptStatus === "ok" && e.transcript) return /* @__PURE__ */ B("p", {
|
|
21178
21237
|
className: "mb-1 whitespace-pre-wrap break-words text-xs italic text-muted-foreground [overflow-wrap:anywhere]",
|
|
@@ -21188,8 +21247,8 @@ function IT({ message: e }) {
|
|
|
21188
21247
|
children: n
|
|
21189
21248
|
}) : null;
|
|
21190
21249
|
}
|
|
21191
|
-
function
|
|
21192
|
-
let { t: f } = I(["inbox", "common"]), p = !!c && e.type !== "system" && !e.id.startsWith("local-"), h = p && !!l, [g, _] = m(!1), v =
|
|
21250
|
+
function RT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i, retrying: a, onMediaLoad: o, directory: s, onReply: c, onReact: l, reactDisabledReason: u = null, contactName: d }) {
|
|
21251
|
+
let { t: f } = I(["inbox", "common"]), p = !!c && e.type !== "system" && !e.id.startsWith("local-"), h = p && !!l, [g, _] = m(!1), v = jT(p ? () => c(e) : void 0, h ? () => _(!0) : void 0);
|
|
21193
21252
|
if (e.type === "system") return /* @__PURE__ */ z("div", {
|
|
21194
21253
|
className: "flex justify-center px-3 py-1",
|
|
21195
21254
|
children: /* @__PURE__ */ z("span", {
|
|
@@ -21197,7 +21256,7 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21197
21256
|
children: e.body
|
|
21198
21257
|
})
|
|
21199
21258
|
});
|
|
21200
|
-
let y = e.fromMe, b = e.type !== "text", x = e.reactions ?? [], S = e.senderName ?? (e.senderJid ?
|
|
21259
|
+
let y = e.fromMe, b = e.type !== "text", x = e.reactions ?? [], S = e.senderName ?? (e.senderJid ? rC(e.senderJid) || f("chatListItem.unknownContact") : null), C = y ? null : e.senderProfile ?? null, w = p && /* @__PURE__ */ z(K, {
|
|
21201
21260
|
type: "button",
|
|
21202
21261
|
variant: "outline",
|
|
21203
21262
|
size: "icon",
|
|
@@ -21206,7 +21265,7 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21206
21265
|
onClick: () => c(e),
|
|
21207
21266
|
className: "size-8 shrink-0 rounded-full text-muted-foreground opacity-0 shadow-sm transition-opacity group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:not-focus-visible:sr-only",
|
|
21208
21267
|
children: /* @__PURE__ */ z(jn, { "aria-hidden": "true" })
|
|
21209
|
-
}), T = x.find((e) => e.fromMe) ?? null, E = T?.sentByUserId ?? null, D = s?.me?.id ?? null, O = E === null ? null : E === D ? "" : s?.nameOf(E) ?? f("message.reactions.fromTeammateUnknown"), k = h && /* @__PURE__ */ z(
|
|
21268
|
+
}), T = x.find((e) => e.fromMe) ?? null, E = T?.sentByUserId ?? null, D = s?.me?.id ?? null, O = E === null ? null : E === D ? "" : s?.nameOf(E) ?? f("message.reactions.fromTeammateUnknown"), k = h && /* @__PURE__ */ z(DT, {
|
|
21210
21269
|
out: y,
|
|
21211
21270
|
current: T?.emoji ?? "",
|
|
21212
21271
|
currentBy: O || null,
|
|
@@ -21233,7 +21292,7 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21233
21292
|
className: G("relative min-w-0 max-w-[85%] touch-pan-y rounded-2xl px-3 py-1.5 text-foreground shadow-sm sm:max-w-[70%]", y ? "rounded-br-md border border-primary/15 bg-outbound text-outbound-foreground" : "rounded-bl-md border bg-surface", e.status === "failed" && "border-danger/50"),
|
|
21234
21293
|
"data-message-id": e.id,
|
|
21235
21294
|
children: [
|
|
21236
|
-
!y && t && C ? /* @__PURE__ */ B(
|
|
21295
|
+
!y && t && C ? /* @__PURE__ */ B(gC, { children: [/* @__PURE__ */ z(_C, {
|
|
21237
21296
|
asChild: !0,
|
|
21238
21297
|
children: /* @__PURE__ */ z(K, {
|
|
21239
21298
|
variant: "link",
|
|
@@ -21241,10 +21300,10 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21241
21300
|
className: "mb-0.5 block h-auto max-w-full truncate p-0 text-left text-xs font-semibold text-primary",
|
|
21242
21301
|
children: C.name
|
|
21243
21302
|
})
|
|
21244
|
-
}), /* @__PURE__ */ z(
|
|
21303
|
+
}), /* @__PURE__ */ z(vC, {
|
|
21245
21304
|
align: "start",
|
|
21246
21305
|
className: "w-72 max-w-[calc(100vw-2rem)]",
|
|
21247
|
-
children: /* @__PURE__ */ z(
|
|
21306
|
+
children: /* @__PURE__ */ z(MT, {
|
|
21248
21307
|
chatJid: C.chatJid,
|
|
21249
21308
|
directory: s
|
|
21250
21309
|
})
|
|
@@ -21260,10 +21319,10 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21260
21319
|
className: "mb-1 rounded-md border-l-4 border-primary bg-muted/70 px-2 py-1 text-xs",
|
|
21261
21320
|
children: r ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("p", {
|
|
21262
21321
|
className: "font-semibold text-primary",
|
|
21263
|
-
children:
|
|
21322
|
+
children: PT(r, f, d)
|
|
21264
21323
|
}), /* @__PURE__ */ z("p", {
|
|
21265
21324
|
className: "line-clamp-2 break-words text-muted-foreground",
|
|
21266
|
-
children:
|
|
21325
|
+
children: FT(r, f)
|
|
21267
21326
|
})] }) : /* @__PURE__ */ z("p", {
|
|
21268
21327
|
className: "italic text-muted-foreground",
|
|
21269
21328
|
children: f("message.quotedMessage")
|
|
@@ -21271,15 +21330,15 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21271
21330
|
}),
|
|
21272
21331
|
b && /* @__PURE__ */ z("div", {
|
|
21273
21332
|
className: "mb-1",
|
|
21274
|
-
children: /* @__PURE__ */ z(
|
|
21333
|
+
children: /* @__PURE__ */ z(xT, {
|
|
21275
21334
|
message: e,
|
|
21276
21335
|
onLoad: o
|
|
21277
21336
|
})
|
|
21278
21337
|
}),
|
|
21279
|
-
e.type === "audio" && /* @__PURE__ */ z(
|
|
21338
|
+
e.type === "audio" && /* @__PURE__ */ z(LT, { message: e }),
|
|
21280
21339
|
e.body && /* @__PURE__ */ z("p", {
|
|
21281
|
-
className: G("whitespace-pre-wrap break-words text-[15px] leading-snug [overflow-wrap:anywhere]",
|
|
21282
|
-
children:
|
|
21340
|
+
className: G("whitespace-pre-wrap break-words text-[15px] leading-snug [overflow-wrap:anywhere]", NT),
|
|
21341
|
+
children: $C(e.body)
|
|
21283
21342
|
}),
|
|
21284
21343
|
/* @__PURE__ */ B("div", {
|
|
21285
21344
|
className: G("mt-0.5 flex items-center justify-end gap-1 text-[11px] text-muted-foreground", x.length > 0 && "pb-3"),
|
|
@@ -21312,7 +21371,7 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21312
21371
|
title: fs(e.timestamp),
|
|
21313
21372
|
children: us(e.timestamp)
|
|
21314
21373
|
}),
|
|
21315
|
-
y && /* @__PURE__ */ z(
|
|
21374
|
+
y && /* @__PURE__ */ z(IT, { status: e.status })
|
|
21316
21375
|
]
|
|
21317
21376
|
}),
|
|
21318
21377
|
y && e.status === "failed" && /* @__PURE__ */ B("div", {
|
|
@@ -21332,7 +21391,7 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21332
21391
|
}), f(a ? "retrying" : "common:actions.retry")]
|
|
21333
21392
|
})]
|
|
21334
21393
|
}),
|
|
21335
|
-
/* @__PURE__ */ z(
|
|
21394
|
+
/* @__PURE__ */ z(wT, {
|
|
21336
21395
|
reactions: x,
|
|
21337
21396
|
out: y,
|
|
21338
21397
|
contactName: d,
|
|
@@ -21347,8 +21406,8 @@ function LT({ message: e, showSender: t, outboundLabel: n, quoted: r, onRetry: i
|
|
|
21347
21406
|
});
|
|
21348
21407
|
}
|
|
21349
21408
|
// src/inbox/MessageList.tsx
|
|
21350
|
-
var
|
|
21351
|
-
function
|
|
21409
|
+
var zT = 150;
|
|
21410
|
+
function BT({ date: e }) {
|
|
21352
21411
|
return I(), /* @__PURE__ */ z("div", {
|
|
21353
21412
|
className: "sticky top-1 z-10 flex justify-center py-2",
|
|
21354
21413
|
role: "separator",
|
|
@@ -21358,7 +21417,7 @@ function zT({ date: e }) {
|
|
|
21358
21417
|
})
|
|
21359
21418
|
});
|
|
21360
21419
|
}
|
|
21361
|
-
function
|
|
21420
|
+
function VT({ items: e, messagesById: t, isGroup: n, directory: r, loading: i, hasOlder: a, loadingOlder: s, onLoadOlder: c, onRetry: u, retryingId: f, onReply: h, onReact: g, reactDisabledReason: _, contactName: v, footer: y }) {
|
|
21362
21421
|
let { t: b } = I("inbox"), x = p(null), S = p(null), C = p(!0), w = p({
|
|
21363
21422
|
height: 0,
|
|
21364
21423
|
initialized: !1
|
|
@@ -21371,7 +21430,7 @@ function BT({ items: e, messagesById: t, isGroup: n, directory: r, loading: i, h
|
|
|
21371
21430
|
}, []), O = o(() => {
|
|
21372
21431
|
let e = x.current;
|
|
21373
21432
|
if (!e) return;
|
|
21374
|
-
let t = e.scrollHeight - e.scrollTop - e.clientHeight <
|
|
21433
|
+
let t = e.scrollHeight - e.scrollTop - e.clientHeight < zT;
|
|
21375
21434
|
C.current = t, E(!t);
|
|
21376
21435
|
}, []);
|
|
21377
21436
|
d(() => {
|
|
@@ -21446,18 +21505,18 @@ function BT({ items: e, messagesById: t, isGroup: n, directory: r, loading: i, h
|
|
|
21446
21505
|
children: b("messageList.empty")
|
|
21447
21506
|
}) : e.map((e) => {
|
|
21448
21507
|
switch (e.kind) {
|
|
21449
|
-
case "day": return /* @__PURE__ */ z(
|
|
21450
|
-
case "event": return /* @__PURE__ */ z(
|
|
21508
|
+
case "day": return /* @__PURE__ */ z(BT, { date: e.date }, e.key);
|
|
21509
|
+
case "event": return /* @__PURE__ */ z(_T, {
|
|
21451
21510
|
event: e.event,
|
|
21452
21511
|
directory: r
|
|
21453
21512
|
}, e.key);
|
|
21454
|
-
case "note": return /* @__PURE__ */ z(
|
|
21513
|
+
case "note": return /* @__PURE__ */ z(vT, {
|
|
21455
21514
|
note: e.note,
|
|
21456
21515
|
directory: r
|
|
21457
21516
|
}, e.key);
|
|
21458
21517
|
case "message": {
|
|
21459
21518
|
let i = e.message, a = i.fromMe ? i.sentByUserId == null ? b("messageList.viaPhone") : r.nameOf(i.sentByUserId) : null;
|
|
21460
|
-
return /* @__PURE__ */ z(
|
|
21519
|
+
return /* @__PURE__ */ z(RT, {
|
|
21461
21520
|
message: i,
|
|
21462
21521
|
showSender: n,
|
|
21463
21522
|
outboundLabel: a,
|
|
@@ -21490,7 +21549,7 @@ function BT({ items: e, messagesById: t, isGroup: n, directory: r, loading: i, h
|
|
|
21490
21549
|
});
|
|
21491
21550
|
}
|
|
21492
21551
|
// src/inbox/NotesPanel.tsx
|
|
21493
|
-
function
|
|
21552
|
+
function HT({ jid: e, notes: t, loading: n, directory: r, onClose: i, title: a, description: o }) {
|
|
21494
21553
|
let { t: s } = I("inbox"), [c, l] = m(""), u = _a(e);
|
|
21495
21554
|
function d(e) {
|
|
21496
21555
|
e.preventDefault();
|
|
@@ -21502,7 +21561,7 @@ function VT({ jid: e, notes: t, loading: n, directory: r, onClose: i, title: a,
|
|
|
21502
21561
|
}
|
|
21503
21562
|
let f = [...t].sort((e, t) => t.createdAt - e.createdAt);
|
|
21504
21563
|
return /* @__PURE__ */ B(R, { children: [
|
|
21505
|
-
/* @__PURE__ */ z(
|
|
21564
|
+
/* @__PURE__ */ z(qw, {
|
|
21506
21565
|
icon: /* @__PURE__ */ z(rn, {
|
|
21507
21566
|
className: "size-4 shrink-0 text-note-foreground",
|
|
21508
21567
|
"aria-hidden": "true"
|
|
@@ -21565,12 +21624,12 @@ function VT({ jid: e, notes: t, loading: n, directory: r, onClose: i, title: a,
|
|
|
21565
21624
|
})
|
|
21566
21625
|
] });
|
|
21567
21626
|
}
|
|
21568
|
-
function
|
|
21627
|
+
function UT({ open: e, onClose: t, ...n }) {
|
|
21569
21628
|
let { t: r } = I("inbox"), i = go("(min-width: 1024px)"), a = p(null);
|
|
21570
21629
|
return i ? e ? /* @__PURE__ */ z("aside", {
|
|
21571
21630
|
"aria-label": r("notes.title"),
|
|
21572
21631
|
className: "flex w-80 shrink-0 flex-col border-l bg-surface",
|
|
21573
|
-
children: /* @__PURE__ */ z(
|
|
21632
|
+
children: /* @__PURE__ */ z(HT, {
|
|
21574
21633
|
...n,
|
|
21575
21634
|
onClose: t,
|
|
21576
21635
|
title: /* @__PURE__ */ z("h3", { children: r("notes.title") }),
|
|
@@ -21587,7 +21646,7 @@ function HT({ open: e, onClose: t, ...n }) {
|
|
|
21587
21646
|
onOpenAutoFocus: (e) => {
|
|
21588
21647
|
e.preventDefault(), a.current?.focus();
|
|
21589
21648
|
},
|
|
21590
|
-
children: /* @__PURE__ */ z(
|
|
21649
|
+
children: /* @__PURE__ */ z(HT, {
|
|
21591
21650
|
...n,
|
|
21592
21651
|
onClose: t,
|
|
21593
21652
|
title: /* @__PURE__ */ z(l_, {
|
|
@@ -21604,33 +21663,33 @@ function HT({ open: e, onClose: t, ...n }) {
|
|
|
21604
21663
|
})
|
|
21605
21664
|
});
|
|
21606
21665
|
}
|
|
21607
|
-
function
|
|
21666
|
+
function WT(e, t) {
|
|
21608
21667
|
return e.isMe ? t("groupInfo.you") : e.name ?? (e.phone ? `+${e.phone}` : e.lid ?? e.jid);
|
|
21609
21668
|
}
|
|
21610
|
-
function
|
|
21669
|
+
function GT(e, t) {
|
|
21611
21670
|
return e.username ? { text: `@${e.username}` } : e.phone ? { text: e.name || e.isMe ? `+${e.phone}` : t("groupInfo.noName") } : {
|
|
21612
21671
|
text: t("groupInfo.hiddenNumber"),
|
|
21613
21672
|
hidden: !0
|
|
21614
21673
|
};
|
|
21615
21674
|
}
|
|
21616
|
-
var
|
|
21675
|
+
var KT = (e) => [
|
|
21617
21676
|
e.name,
|
|
21618
21677
|
e.phone,
|
|
21619
21678
|
e.phone && `+${e.phone}`,
|
|
21620
21679
|
e.username,
|
|
21621
21680
|
e.lid
|
|
21622
21681
|
].filter(Boolean).join(" ").toLowerCase();
|
|
21623
|
-
function
|
|
21624
|
-
let { t: r } = I("inbox"), i =
|
|
21682
|
+
function qT({ groupJid: e, member: t, onOpen: n }) {
|
|
21683
|
+
let { t: r } = I("inbox"), i = WT(t, r), a = GT(t, r), o = !t.name && !t.phone && !t.isMe;
|
|
21625
21684
|
return /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B(K, {
|
|
21626
21685
|
type: "button",
|
|
21627
21686
|
variant: "ghost",
|
|
21628
21687
|
onClick: n,
|
|
21629
21688
|
className: "h-auto min-h-13 w-full justify-start gap-2.5 rounded-none px-4 py-2 text-left font-normal",
|
|
21630
21689
|
children: [
|
|
21631
|
-
/* @__PURE__ */ z(
|
|
21690
|
+
/* @__PURE__ */ z(LC, {
|
|
21632
21691
|
name: t.isMe ? i : t.name ?? "",
|
|
21633
|
-
src: `/api/chats/${
|
|
21692
|
+
src: `/api/chats/${aC(e)}/members/${aC(t.lid ?? t.jid)}/avatar`,
|
|
21634
21693
|
seed: t.jid,
|
|
21635
21694
|
size: "sm"
|
|
21636
21695
|
}),
|
|
@@ -21652,8 +21711,8 @@ function KT({ groupJid: e, member: t, onOpen: n }) {
|
|
|
21652
21711
|
]
|
|
21653
21712
|
}) });
|
|
21654
21713
|
}
|
|
21655
|
-
function
|
|
21656
|
-
let { t: n } = I("inbox"), [r, i] = m(""), [a, o] = m(!1), [s, l] = m(100), u = c(r.trim().toLowerCase()), d = f(() => e.members.map((e) => [e,
|
|
21714
|
+
function JT({ data: e, onOpen: t }) {
|
|
21715
|
+
let { t: n } = I("inbox"), [r, i] = m(""), [a, o] = m(!1), [s, l] = m(100), u = c(r.trim().toLowerCase()), d = f(() => e.members.map((e) => [e, KT(e)]), [e.members]), p = f(() => d.filter(([, e]) => !u || e.includes(u)).map(([e]) => e), [d, u]), h = f(() => a ? p.filter((e) => e.role !== "member") : p, [p, a]), { group: g } = e, _ = g.createdBy ? g.createdBy.name ?? (g.createdBy.phone ? `+${g.createdBy.phone}` : null) : null;
|
|
21657
21716
|
return /* @__PURE__ */ B(R, { children: [
|
|
21658
21717
|
/* @__PURE__ */ B("div", {
|
|
21659
21718
|
className: "space-y-0.5 px-4 pt-3 pb-1",
|
|
@@ -21734,7 +21793,7 @@ function qT({ data: e, onOpen: t }) {
|
|
|
21734
21793
|
children: n("groupInfo.none")
|
|
21735
21794
|
}) : /* @__PURE__ */ z("ul", {
|
|
21736
21795
|
"aria-label": n("groupInfo.listLabel"),
|
|
21737
|
-
children: h.slice(0, s).map((e) => /* @__PURE__ */ z(
|
|
21796
|
+
children: h.slice(0, s).map((e) => /* @__PURE__ */ z(qT, {
|
|
21738
21797
|
groupJid: g.jid,
|
|
21739
21798
|
member: e,
|
|
21740
21799
|
onOpen: () => t(e)
|
|
@@ -21769,8 +21828,8 @@ function qT({ data: e, onOpen: t }) {
|
|
|
21769
21828
|
})
|
|
21770
21829
|
] });
|
|
21771
21830
|
}
|
|
21772
|
-
function
|
|
21773
|
-
let { t: i } = I("inbox"), a = ya(e, t.isMe ? null : t.lid ?? t.jid), o = ba(e), [s, c] = m(!1), l =
|
|
21831
|
+
function YT({ groupJid: e, member: t, onBack: n, onOpenChat: r }) {
|
|
21832
|
+
let { t: i } = I("inbox"), a = ya(e, t.isMe ? null : t.lid ?? t.jid), o = ba(e), [s, c] = m(!1), l = WT(t, i), u = !t.name && !t.phone && !t.isMe, d = [[i("groupInfo.phone"), t.phone ? `+${t.phone}` : /* @__PURE__ */ z("i", { children: i("groupInfo.hiddenNumber") }, "h")]];
|
|
21774
21833
|
t.lid && d.push([i("groupInfo.lid"), /* @__PURE__ */ z("span", {
|
|
21775
21834
|
className: "font-mono text-xs",
|
|
21776
21835
|
children: t.lid
|
|
@@ -21811,9 +21870,9 @@ function JT({ groupJid: e, member: t, onBack: n, onOpenChat: r }) {
|
|
|
21811
21870
|
}),
|
|
21812
21871
|
/* @__PURE__ */ B("div", {
|
|
21813
21872
|
className: "flex items-center gap-3",
|
|
21814
|
-
children: [/* @__PURE__ */ z(
|
|
21873
|
+
children: [/* @__PURE__ */ z(LC, {
|
|
21815
21874
|
name: t.isMe ? l : t.name ?? "",
|
|
21816
|
-
src: `/api/chats/${
|
|
21875
|
+
src: `/api/chats/${aC(e)}/members/${aC(t.lid ?? t.jid)}/avatar`,
|
|
21817
21876
|
seed: t.jid,
|
|
21818
21877
|
size: "lg"
|
|
21819
21878
|
}), /* @__PURE__ */ z("div", {
|
|
@@ -21894,9 +21953,9 @@ function JT({ groupJid: e, member: t, onBack: n, onOpenChat: r }) {
|
|
|
21894
21953
|
]
|
|
21895
21954
|
});
|
|
21896
21955
|
}
|
|
21897
|
-
function
|
|
21956
|
+
function XT({ jid: e, open: t, onClose: n, title: r, description: i }) {
|
|
21898
21957
|
let { t: a } = I("inbox"), o = ee(), s = va(e, t), [c, l] = m(null), u = c ? s.data?.members.find((e) => e.jid === c) : void 0;
|
|
21899
|
-
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(
|
|
21958
|
+
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(qw, {
|
|
21900
21959
|
icon: /* @__PURE__ */ z(ir, {
|
|
21901
21960
|
className: "size-4 shrink-0 text-muted-foreground",
|
|
21902
21961
|
"aria-hidden": "true"
|
|
@@ -21926,24 +21985,24 @@ function YT({ jid: e, open: t, onClose: n, title: r, description: i }) {
|
|
|
21926
21985
|
onClick: () => void s.refetch(),
|
|
21927
21986
|
children: a("groupInfo.retry")
|
|
21928
21987
|
})]
|
|
21929
|
-
}) : u ? /* @__PURE__ */ z(
|
|
21988
|
+
}) : u ? /* @__PURE__ */ z(YT, {
|
|
21930
21989
|
groupJid: e,
|
|
21931
21990
|
member: u,
|
|
21932
21991
|
onBack: () => l(null),
|
|
21933
21992
|
onOpenChat: (e) => {
|
|
21934
|
-
n(), o(`/chats/${
|
|
21993
|
+
n(), o(`/chats/${aC(e)}`);
|
|
21935
21994
|
}
|
|
21936
|
-
}, u.jid) : /* @__PURE__ */ z(
|
|
21995
|
+
}, u.jid) : /* @__PURE__ */ z(JT, {
|
|
21937
21996
|
data: s.data,
|
|
21938
21997
|
onOpen: (e) => l(e.jid)
|
|
21939
21998
|
})] });
|
|
21940
21999
|
}
|
|
21941
|
-
function
|
|
22000
|
+
function ZT({ jid: e, open: t, onClose: n }) {
|
|
21942
22001
|
let { t: r } = I("inbox"), i = go("(min-width: 1024px)"), a = p(null);
|
|
21943
22002
|
return i ? t ? /* @__PURE__ */ z("aside", {
|
|
21944
22003
|
"aria-label": r("groupInfo.title"),
|
|
21945
22004
|
className: "flex w-80 shrink-0 flex-col border-l bg-surface",
|
|
21946
|
-
children: /* @__PURE__ */ z(
|
|
22005
|
+
children: /* @__PURE__ */ z(XT, {
|
|
21947
22006
|
jid: e,
|
|
21948
22007
|
open: t,
|
|
21949
22008
|
onClose: n,
|
|
@@ -21961,7 +22020,7 @@ function XT({ jid: e, open: t, onClose: n }) {
|
|
|
21961
22020
|
onOpenAutoFocus: (e) => {
|
|
21962
22021
|
e.preventDefault(), a.current?.focus();
|
|
21963
22022
|
},
|
|
21964
|
-
children: /* @__PURE__ */ z(
|
|
22023
|
+
children: /* @__PURE__ */ z(XT, {
|
|
21965
22024
|
jid: e,
|
|
21966
22025
|
open: t,
|
|
21967
22026
|
onClose: n,
|
|
@@ -21980,19 +22039,19 @@ function XT({ jid: e, open: t, onClose: n }) {
|
|
|
21980
22039
|
});
|
|
21981
22040
|
}
|
|
21982
22041
|
// src/inbox/timeline.ts
|
|
21983
|
-
var
|
|
22042
|
+
var QT = {
|
|
21984
22043
|
event: 0,
|
|
21985
22044
|
message: 1,
|
|
21986
22045
|
note: 2
|
|
21987
22046
|
};
|
|
21988
|
-
function
|
|
22047
|
+
function $T(e) {
|
|
21989
22048
|
let t = new Date(e);
|
|
21990
22049
|
return t.setHours(0, 0, 0, 0), t.getTime();
|
|
21991
22050
|
}
|
|
21992
|
-
function
|
|
22051
|
+
function eE(e) {
|
|
21993
22052
|
return e.kind === "message" ? e.message.id : e.kind === "event" ? String(e.event.id).padStart(12, "0") : String(e.note.id).padStart(12, "0");
|
|
21994
22053
|
}
|
|
21995
|
-
function
|
|
22054
|
+
function tE(e, t, n) {
|
|
21996
22055
|
let r = [
|
|
21997
22056
|
...e.map((e) => ({
|
|
21998
22057
|
kind: "message",
|
|
@@ -22013,12 +22072,12 @@ function eE(e, t, n) {
|
|
|
22013
22072
|
note: e
|
|
22014
22073
|
}))
|
|
22015
22074
|
];
|
|
22016
|
-
r.sort((e, t) => e.at - t.at ||
|
|
22075
|
+
r.sort((e, t) => e.at - t.at || QT[e.kind] - QT[t.kind] || (eE(e) < eE(t) ? -1 : +(eE(e) > eE(t))));
|
|
22017
22076
|
let i = [], a = /* @__PURE__ */ new Set(), o = null;
|
|
22018
22077
|
for (let e of r) {
|
|
22019
22078
|
if (a.has(e.key)) continue;
|
|
22020
22079
|
a.add(e.key);
|
|
22021
|
-
let t =
|
|
22080
|
+
let t = $T(e.at);
|
|
22022
22081
|
t !== o && (i.push({
|
|
22023
22082
|
kind: "day",
|
|
22024
22083
|
key: `d:${t}`,
|
|
@@ -22028,11 +22087,11 @@ function eE(e, t, n) {
|
|
|
22028
22087
|
return i;
|
|
22029
22088
|
}
|
|
22030
22089
|
// src/inbox/assistant-started.ts
|
|
22031
|
-
function
|
|
22090
|
+
function nE(e, t, n) {
|
|
22032
22091
|
return e.type === "dm" && !n && t.length > 0 && t.every((e) => e.fromMe) && t.some((e) => e.viaAssistant === !0);
|
|
22033
22092
|
}
|
|
22034
22093
|
// src/inbox/TypingIndicator.tsx
|
|
22035
|
-
function
|
|
22094
|
+
function rE({ entries: e, meId: t }) {
|
|
22036
22095
|
let { t: n } = I("inbox"), r = e.filter((e) => e.userId !== t);
|
|
22037
22096
|
if (r.length === 0) return null;
|
|
22038
22097
|
let i = r.map((e) => e.displayName), a = i.length === 1 ? n("typing.one", { name: i[0] }) : i.length === 2 ? n("typing.two", {
|
|
@@ -22057,13 +22116,13 @@ function nE({ entries: e, meId: t }) {
|
|
|
22057
22116
|
});
|
|
22058
22117
|
}
|
|
22059
22118
|
// src/inbox/WaBanner.tsx
|
|
22060
|
-
function
|
|
22119
|
+
function iE(e) {
|
|
22061
22120
|
return e === "disconnected" || e === "connecting";
|
|
22062
22121
|
}
|
|
22063
|
-
function
|
|
22122
|
+
function aE(e) {
|
|
22064
22123
|
return e === "qr" || e === "logged_out" || e === "replaced" || e === "blocked";
|
|
22065
22124
|
}
|
|
22066
|
-
var
|
|
22125
|
+
var oE = {
|
|
22067
22126
|
connecting: {
|
|
22068
22127
|
tone: "info",
|
|
22069
22128
|
titleKey: "waBanner.connecting.title",
|
|
@@ -22101,8 +22160,8 @@ var aE = {
|
|
|
22101
22160
|
bodyKey: "waBanner.blocked.body"
|
|
22102
22161
|
}
|
|
22103
22162
|
};
|
|
22104
|
-
function
|
|
22105
|
-
let { t: r } = I("inbox"), { isAdmin: i } = as(), a =
|
|
22163
|
+
function sE({ state: e, name: t, settingsPath: n }) {
|
|
22164
|
+
let { t: r } = I("inbox"), { isAdmin: i } = as(), a = oE[e], o = r(n === "/admin/inboxes" ? "waBanner.openInboxes" : "waBanner.openSettings");
|
|
22106
22165
|
return /* @__PURE__ */ z(Y, {
|
|
22107
22166
|
tone: a.tone,
|
|
22108
22167
|
title: t === void 0 ? r(a.titleKey) : r(a.inboxTitleKey, { name: t }),
|
|
@@ -22126,17 +22185,17 @@ function oE({ state: e, name: t, settingsPath: n }) {
|
|
|
22126
22185
|
children: r(a.bodyKey)
|
|
22127
22186
|
});
|
|
22128
22187
|
}
|
|
22129
|
-
function
|
|
22130
|
-
let e = Fa(), t =
|
|
22188
|
+
function cE() {
|
|
22189
|
+
let e = Fa(), t = dw(), n = t.length === 1 ? t[0] : void 0, r = (e.data?.maxInboxes ?? 1) > 1, i = Na({ enabled: e.isError || t.some((e) => e.id === 1) || e.data != null && t.length === 0 && !r });
|
|
22131
22190
|
if (e.isPending) return null;
|
|
22132
22191
|
if (t.length > 1) {
|
|
22133
22192
|
let e = t.map((e) => ({
|
|
22134
22193
|
inbox: e,
|
|
22135
|
-
state:
|
|
22194
|
+
state: lE(e, i.data)
|
|
22136
22195
|
})).filter((e) => !!(e.state && e.state !== "open"));
|
|
22137
22196
|
return e.length === 0 ? null : /* @__PURE__ */ z("div", {
|
|
22138
22197
|
className: "space-y-2 border-b bg-surface px-3 py-2",
|
|
22139
|
-
children: e.map(({ inbox: e, state: t }) => /* @__PURE__ */ z(
|
|
22198
|
+
children: e.map(({ inbox: e, state: t }) => /* @__PURE__ */ z(sE, {
|
|
22140
22199
|
state: t,
|
|
22141
22200
|
name: e.name,
|
|
22142
22201
|
settingsPath: "/admin/inboxes"
|
|
@@ -22147,28 +22206,28 @@ function sE() {
|
|
|
22147
22206
|
let a = n && n.id !== 1 ? n : void 0, o = a ? a.status.state : i.data?.state;
|
|
22148
22207
|
return !o || o === "open" ? null : /* @__PURE__ */ z("div", {
|
|
22149
22208
|
className: "border-b bg-surface px-3 py-2",
|
|
22150
|
-
children: a ? /* @__PURE__ */ z(
|
|
22209
|
+
children: a ? /* @__PURE__ */ z(sE, {
|
|
22151
22210
|
state: o,
|
|
22152
22211
|
name: a.name,
|
|
22153
22212
|
settingsPath: "/admin/inboxes"
|
|
22154
|
-
}) : /* @__PURE__ */ z(
|
|
22213
|
+
}) : /* @__PURE__ */ z(sE, {
|
|
22155
22214
|
state: o,
|
|
22156
22215
|
settingsPath: "/admin/whatsapp"
|
|
22157
22216
|
})
|
|
22158
22217
|
});
|
|
22159
22218
|
}
|
|
22160
|
-
function
|
|
22219
|
+
function lE(e, t) {
|
|
22161
22220
|
return e.id === 1 ? t?.state ?? e.status.state : e.status.state;
|
|
22162
22221
|
}
|
|
22163
22222
|
// src/inbox/Conversation.tsx
|
|
22164
|
-
function
|
|
22223
|
+
function uE(e) {
|
|
22165
22224
|
V.error(e instanceof Error ? e.message : F.t("inbox:conversation.updateFailed"));
|
|
22166
22225
|
}
|
|
22167
|
-
var
|
|
22168
|
-
function
|
|
22169
|
-
let { t: r } = I(["inbox", "common"]), i = go("(min-width: 640px)"), a = S(), s = aa(e), c = ca(e), u = ga(e), d = wa(), h =
|
|
22226
|
+
var dE = /* @__PURE__ */ new Set();
|
|
22227
|
+
function fE({ jid: e, directory: t, onBack: n }) {
|
|
22228
|
+
let { t: r } = I(["inbox", "common"]), i = go("(min-width: 640px)"), a = S(), s = aa(e), c = ca(e), u = ga(e), d = wa(), h = fw(), g = ua(e), _ = da(e), [v, y] = m(null);
|
|
22170
22229
|
l(() => y(null), [e]);
|
|
22171
|
-
let b = fa(), { mutate: x } = pa(), C = ha(e), w = ma(e), { typing: T, emitTyping: E } = po(), [D] = M(), [O, k] = m(!1), [A, j] = m(() => D.get("customer") === "1"), [ee, te] = m(!1), ne =
|
|
22230
|
+
let b = fa(), { mutate: x } = pa(), C = ha(e), w = ma(e), { typing: T, emitTyping: E } = po(), [D] = M(), [O, k] = m(!1), [A, j] = m(() => D.get("customer") === "1"), [ee, te] = m(!1), ne = ow(), re = (e) => ne.current ? ne.current(e) : e(), [N, ie] = m(null), [ae, oe] = m(null), P = s.data?.chat, se = La(P?.inboxId)?.state, ce = va(e, P?.type === "group"), le = s.data?.events, ue = t.me, de = f(() => la(c.data), [c.data]), fe = f(() => new Map(de.map((e) => [e.id, e])), [de]), pe = u.data, me = f(() => tE(de, le ?? [], pe ?? []), [
|
|
22172
22231
|
de,
|
|
22173
22232
|
le,
|
|
22174
22233
|
pe
|
|
@@ -22197,7 +22256,7 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22197
22256
|
ve
|
|
22198
22257
|
]);
|
|
22199
22258
|
let ye = o(() => {
|
|
22200
|
-
if (!P || P.assignedTo == null || P.assignedTo === ue?.id ||
|
|
22259
|
+
if (!P || P.assignedTo == null || P.assignedTo === ue?.id || dE.has(e)) return !0;
|
|
22201
22260
|
let n = t.nameOf(P.assignedTo) ?? r("conversation.someoneElse");
|
|
22202
22261
|
return new Promise((e) => ie({
|
|
22203
22262
|
name: n,
|
|
@@ -22211,7 +22270,7 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22211
22270
|
r
|
|
22212
22271
|
]);
|
|
22213
22272
|
function be(t) {
|
|
22214
|
-
t &&
|
|
22273
|
+
t && dE.add(e), N?.resolve(t), ie(null);
|
|
22215
22274
|
}
|
|
22216
22275
|
function xe(t) {
|
|
22217
22276
|
oe(t.id), b.mutate(t.id, {
|
|
@@ -22286,22 +22345,22 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22286
22345
|
})
|
|
22287
22346
|
});
|
|
22288
22347
|
}
|
|
22289
|
-
let De =
|
|
22348
|
+
let De = aE(se), Oe = iE(se), ke = P.type === "dm" ? NC(P, r) : void 0, Ae = nE(P, de, !!Ce);
|
|
22290
22349
|
return /* @__PURE__ */ B("div", {
|
|
22291
22350
|
className: "flex min-h-0 min-w-0 flex-1",
|
|
22292
22351
|
children: [
|
|
22293
22352
|
/* @__PURE__ */ B("section", {
|
|
22294
22353
|
className: "flex min-h-0 min-w-0 flex-1 flex-col",
|
|
22295
|
-
"aria-label": r("conversation.label", { name:
|
|
22354
|
+
"aria-label": r("conversation.label", { name: NC(P, r) }),
|
|
22296
22355
|
children: [
|
|
22297
|
-
/* @__PURE__ */ z(
|
|
22356
|
+
/* @__PURE__ */ z(mT, {
|
|
22298
22357
|
chat: P,
|
|
22299
22358
|
directory: t,
|
|
22300
22359
|
inbox: h(P.inboxId),
|
|
22301
22360
|
onBack: n,
|
|
22302
22361
|
busy: w.isPending,
|
|
22303
|
-
onAssign: (e) => w.mutate({ assignedTo: e }, { onError:
|
|
22304
|
-
onToggleStatus: () => w.mutate({ status: P.status === "resolved" ? "open" : "resolved" }, { onError:
|
|
22362
|
+
onAssign: (e) => w.mutate({ assignedTo: e }, { onError: uE }),
|
|
22363
|
+
onToggleStatus: () => w.mutate({ status: P.status === "resolved" ? "open" : "resolved" }, { onError: uE }),
|
|
22305
22364
|
notesOpen: O,
|
|
22306
22365
|
notesCount: pe?.length ?? 0,
|
|
22307
22366
|
onToggleNotes: () => re(() => {
|
|
@@ -22327,7 +22386,7 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22327
22386
|
children: r("conversation.startedByAssistantBody")
|
|
22328
22387
|
})
|
|
22329
22388
|
}),
|
|
22330
|
-
/* @__PURE__ */ z(
|
|
22389
|
+
/* @__PURE__ */ z(VT, {
|
|
22331
22390
|
items: me,
|
|
22332
22391
|
messagesById: fe,
|
|
22333
22392
|
isGroup: P.type === "group",
|
|
@@ -22346,7 +22405,7 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22346
22405
|
/* @__PURE__ */ B("div", {
|
|
22347
22406
|
className: "safe-bottom border-t bg-surface",
|
|
22348
22407
|
children: [
|
|
22349
|
-
/* @__PURE__ */ z(
|
|
22408
|
+
/* @__PURE__ */ z(rE, {
|
|
22350
22409
|
entries: T[e] ?? [],
|
|
22351
22410
|
meId: ue?.id ?? null
|
|
22352
22411
|
}),
|
|
@@ -22357,7 +22416,7 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22357
22416
|
}),
|
|
22358
22417
|
/* @__PURE__ */ z("div", {
|
|
22359
22418
|
className: "px-2 py-2 sm:px-3",
|
|
22360
|
-
children: /* @__PURE__ */ z(
|
|
22419
|
+
children: /* @__PURE__ */ z(Kw, {
|
|
22361
22420
|
quickReplies: d.data ?? [],
|
|
22362
22421
|
disabled: De,
|
|
22363
22422
|
placeholder: r(De ? "conversation.placeholderBlocked" : i ? "conversation.placeholder" : "composer.placeholder"),
|
|
@@ -22365,8 +22424,8 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22365
22424
|
onTyping: () => E(e),
|
|
22366
22425
|
replyTo: v ? {
|
|
22367
22426
|
id: v.id,
|
|
22368
|
-
author:
|
|
22369
|
-
preview:
|
|
22427
|
+
author: PT(v, r, ke),
|
|
22428
|
+
preview: FT(v, r)
|
|
22370
22429
|
} : null,
|
|
22371
22430
|
onCancelReply: () => y(null),
|
|
22372
22431
|
onSend: (e) => {
|
|
@@ -22398,7 +22457,7 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22398
22457
|
})
|
|
22399
22458
|
]
|
|
22400
22459
|
}),
|
|
22401
|
-
/* @__PURE__ */ z(
|
|
22460
|
+
/* @__PURE__ */ z(UT, {
|
|
22402
22461
|
jid: e,
|
|
22403
22462
|
open: O,
|
|
22404
22463
|
notes: pe ?? [],
|
|
@@ -22406,12 +22465,12 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22406
22465
|
directory: t,
|
|
22407
22466
|
onClose: () => k(!1)
|
|
22408
22467
|
}),
|
|
22409
|
-
P.type === "group" && /* @__PURE__ */ z(
|
|
22468
|
+
P.type === "group" && /* @__PURE__ */ z(ZT, {
|
|
22410
22469
|
jid: e,
|
|
22411
22470
|
open: ee,
|
|
22412
22471
|
onClose: () => te(!1)
|
|
22413
22472
|
}),
|
|
22414
|
-
P.type === "dm" && /* @__PURE__ */ z(
|
|
22473
|
+
P.type === "dm" && /* @__PURE__ */ z(fT, {
|
|
22415
22474
|
jid: e,
|
|
22416
22475
|
open: A,
|
|
22417
22476
|
directory: t,
|
|
@@ -22440,11 +22499,11 @@ function dE({ jid: e, directory: t, onBack: n }) {
|
|
|
22440
22499
|
});
|
|
22441
22500
|
}
|
|
22442
22501
|
// src/inbox/useDirectory.ts
|
|
22443
|
-
function
|
|
22502
|
+
function pE(e, t, n = !1) {
|
|
22444
22503
|
return e.role === "admin" || e.kind === "ai" ? !0 : e.inboxIds == null ? !n : e.inboxIds === "all" || e.inboxIds.includes(t);
|
|
22445
22504
|
}
|
|
22446
|
-
function
|
|
22447
|
-
let i = r.multiInbox ?? !1, a = r.inboxAgents ?? /* @__PURE__ */ new Map(), o = (e, t) => e.kind === "ai" ? e.aiAgentId !== void 0 && a.get(t) === e.aiAgentId :
|
|
22505
|
+
function mE(e, t, n, r = {}) {
|
|
22506
|
+
let i = r.multiInbox ?? !1, a = r.inboxAgents ?? /* @__PURE__ */ new Map(), o = (e, t) => e.kind === "ai" ? e.aiAgentId !== void 0 && a.get(t) === e.aiAgentId : pE(e, t, i), s = /* @__PURE__ */ new Map();
|
|
22448
22507
|
for (let e of n ?? []) s.set(e.id, e);
|
|
22449
22508
|
e && s.set(e.id, {
|
|
22450
22509
|
...e,
|
|
@@ -22465,9 +22524,9 @@ function pE(e, t, n, r = {}) {
|
|
|
22465
22524
|
}
|
|
22466
22525
|
};
|
|
22467
22526
|
}
|
|
22468
|
-
function
|
|
22527
|
+
function hE() {
|
|
22469
22528
|
let { user: e, isAdmin: t } = as(), { i18n: n } = I(), r = n.language, i = Da({ enabled: t }), a = Oa({ enabled: !t && e != null }), o = t ? i.data : a.data, s = Fa({ enabled: e != null }), c = (s.data?.maxInboxes ?? 1) > 1 || (s.data?.inboxes?.length ?? 0) > 1, l = s.data?.inboxes;
|
|
22470
|
-
return f(() =>
|
|
22529
|
+
return f(() => mE(e, t, o, {
|
|
22471
22530
|
multiInbox: c,
|
|
22472
22531
|
inboxAgents: new Map((l ?? []).map((e) => [e.id, e.aiAgentId]))
|
|
22473
22532
|
}), [
|
|
@@ -22480,7 +22539,7 @@ function mE() {
|
|
|
22480
22539
|
]);
|
|
22481
22540
|
}
|
|
22482
22541
|
// src/inbox/ReconnectBanner.tsx
|
|
22483
|
-
function
|
|
22542
|
+
function gE({ connected: e }) {
|
|
22484
22543
|
let { t } = I("inbox"), n = p(!1);
|
|
22485
22544
|
return e && (n.current = !0), e || !n.current ? null : /* @__PURE__ */ z("div", {
|
|
22486
22545
|
className: "border-b bg-surface px-3 py-2",
|
|
@@ -22491,15 +22550,15 @@ function hE({ connected: e }) {
|
|
|
22491
22550
|
})
|
|
22492
22551
|
});
|
|
22493
22552
|
}
|
|
22494
|
-
function
|
|
22553
|
+
function _E() {
|
|
22495
22554
|
let { connected: e } = po();
|
|
22496
|
-
return /* @__PURE__ */ z(
|
|
22555
|
+
return /* @__PURE__ */ z(gE, { connected: e });
|
|
22497
22556
|
}
|
|
22498
22557
|
// src/inbox/useCanonicalChatRedirect.ts
|
|
22499
|
-
function
|
|
22558
|
+
function vE(e) {
|
|
22500
22559
|
let t = aa(e), n = ee(), r = j(), i = t.data?.chat.jid;
|
|
22501
22560
|
l(() => {
|
|
22502
|
-
e && i && i !== e && n(`/chats/${
|
|
22561
|
+
e && i && i !== e && n(`/chats/${aC(i)}`, {
|
|
22503
22562
|
replace: !0,
|
|
22504
22563
|
state: r.state
|
|
22505
22564
|
});
|
|
@@ -22511,14 +22570,14 @@ function _E(e) {
|
|
|
22511
22570
|
]);
|
|
22512
22571
|
}
|
|
22513
22572
|
// src/inbox/InboxPage.tsx
|
|
22514
|
-
var
|
|
22573
|
+
var yE = "wati.inbox.filters", bE = {
|
|
22515
22574
|
assigned: "any",
|
|
22516
22575
|
status: "open"
|
|
22517
22576
|
};
|
|
22518
|
-
function
|
|
22577
|
+
function xE() {
|
|
22519
22578
|
try {
|
|
22520
|
-
let e = sessionStorage.getItem(
|
|
22521
|
-
if (!e) return
|
|
22579
|
+
let e = sessionStorage.getItem(yE);
|
|
22580
|
+
if (!e) return bE;
|
|
22522
22581
|
let t = JSON.parse(e), n = t.assigned === "me" || t.assigned === "none" ? t.assigned : "any", r = t.status === "resolved" ? "resolved" : "open", i = typeof t.tag == "string" && t.tag.trim() && t.tag.length <= 30 ? t.tag.trim() : void 0, a = typeof t.inbox == "number" && Number.isInteger(t.inbox) && t.inbox > 0 ? t.inbox : void 0;
|
|
22523
22582
|
return {
|
|
22524
22583
|
assigned: n,
|
|
@@ -22528,21 +22587,21 @@ function bE() {
|
|
|
22528
22587
|
inbox: a
|
|
22529
22588
|
};
|
|
22530
22589
|
} catch {
|
|
22531
|
-
return
|
|
22590
|
+
return bE;
|
|
22532
22591
|
}
|
|
22533
22592
|
}
|
|
22534
|
-
function
|
|
22535
|
-
let { t: e } = I(["inbox", "common"]), t = te(), n = t.jid ?
|
|
22536
|
-
|
|
22593
|
+
function SE() {
|
|
22594
|
+
let { t: e } = I(["inbox", "common"]), t = te(), n = t.jid ? oC(t.jid) : null, r = ee(), i = j(), a = hE(), s = m_();
|
|
22595
|
+
vE(n);
|
|
22537
22596
|
let c = i.state?.fromList === !0, u = o(() => {
|
|
22538
22597
|
c ? r(-1) : r("/", { replace: !0 });
|
|
22539
|
-
}, [c, r]), [d, p] = m(
|
|
22598
|
+
}, [c, r]), [d, p] = m(xE);
|
|
22540
22599
|
l(() => {
|
|
22541
22600
|
try {
|
|
22542
|
-
sessionStorage.setItem(
|
|
22601
|
+
sessionStorage.setItem(yE, JSON.stringify(d));
|
|
22543
22602
|
} catch {}
|
|
22544
22603
|
}, [d]);
|
|
22545
|
-
let h = Fa().data != null, g =
|
|
22604
|
+
let h = Fa().data != null, g = dw(), _ = f(() => d.inbox == null || !h || g.length > 1 && g.some((e) => e.id === d.inbox) ? d : {
|
|
22546
22605
|
...d,
|
|
22547
22606
|
inbox: void 0
|
|
22548
22607
|
}, [
|
|
@@ -22550,13 +22609,13 @@ function xE() {
|
|
|
22550
22609
|
h,
|
|
22551
22610
|
g
|
|
22552
22611
|
]);
|
|
22553
|
-
return /* @__PURE__ */ z(
|
|
22612
|
+
return /* @__PURE__ */ z(aw, { children: /* @__PURE__ */ B("div", {
|
|
22554
22613
|
className: "safe-x flex h-dvh flex-col overflow-hidden bg-background",
|
|
22555
22614
|
children: [
|
|
22556
22615
|
/* @__PURE__ */ z("div", { className: "safe-top bg-surface" }),
|
|
22557
22616
|
/* @__PURE__ */ z(sc, {}),
|
|
22558
|
-
/* @__PURE__ */ z(
|
|
22559
|
-
/* @__PURE__ */ z(
|
|
22617
|
+
/* @__PURE__ */ z(cE, {}),
|
|
22618
|
+
/* @__PURE__ */ z(_E, {}),
|
|
22560
22619
|
/* @__PURE__ */ B("div", {
|
|
22561
22620
|
className: "flex min-h-0 flex-1",
|
|
22562
22621
|
children: [/* @__PURE__ */ B("aside", {
|
|
@@ -22579,19 +22638,19 @@ function xE() {
|
|
|
22579
22638
|
children: [/* @__PURE__ */ z(Rn, { "aria-hidden": "true" }), e("page.admin")]
|
|
22580
22639
|
})
|
|
22581
22640
|
}),
|
|
22582
|
-
/* @__PURE__ */ z(
|
|
22641
|
+
/* @__PURE__ */ z(eC, {})
|
|
22583
22642
|
]
|
|
22584
22643
|
}),
|
|
22585
|
-
/* @__PURE__ */ z(
|
|
22644
|
+
/* @__PURE__ */ z(OC, {
|
|
22586
22645
|
value: d,
|
|
22587
22646
|
onChange: p,
|
|
22588
22647
|
inboxes: g
|
|
22589
22648
|
}),
|
|
22590
|
-
/* @__PURE__ */ z(
|
|
22649
|
+
/* @__PURE__ */ z(gw, {
|
|
22591
22650
|
filters: _,
|
|
22592
22651
|
activeJid: n,
|
|
22593
22652
|
directory: a,
|
|
22594
|
-
onResetFilters: () => p(
|
|
22653
|
+
onResetFilters: () => p(bE)
|
|
22595
22654
|
}),
|
|
22596
22655
|
s && /* @__PURE__ */ z("p", {
|
|
22597
22656
|
className: "border-t px-3 py-2 text-xs text-muted-foreground",
|
|
@@ -22604,7 +22663,7 @@ function xE() {
|
|
|
22604
22663
|
]
|
|
22605
22664
|
}), /* @__PURE__ */ z("main", {
|
|
22606
22665
|
className: G("min-h-0 min-w-0 flex-1 flex-col bg-background", n ? "flex" : "hidden md:flex"),
|
|
22607
|
-
children: n ? /* @__PURE__ */ z(
|
|
22666
|
+
children: n ? /* @__PURE__ */ z(fE, {
|
|
22608
22667
|
jid: n,
|
|
22609
22668
|
directory: a,
|
|
22610
22669
|
onBack: u
|
|
@@ -22613,7 +22672,7 @@ function xE() {
|
|
|
22613
22672
|
illustration: "/illustrations/empty-inbox.png",
|
|
22614
22673
|
title: e("page.selectTitle"),
|
|
22615
22674
|
description: e("page.selectDescription"),
|
|
22616
|
-
action: /* @__PURE__ */ z(
|
|
22675
|
+
action: /* @__PURE__ */ z(jC, { className: "mt-2" })
|
|
22617
22676
|
})
|
|
22618
22677
|
})]
|
|
22619
22678
|
})
|
|
@@ -22621,16 +22680,16 @@ function xE() {
|
|
|
22621
22680
|
}) });
|
|
22622
22681
|
}
|
|
22623
22682
|
// src/setup/connected-label.ts
|
|
22624
|
-
function
|
|
22683
|
+
function CE(e, t) {
|
|
22625
22684
|
if (!e) return t("setup.wa.connected");
|
|
22626
|
-
let n =
|
|
22685
|
+
let n = rC(e.jid);
|
|
22627
22686
|
return e.name && n ? t("setup.wa.connectedAsNamed", {
|
|
22628
22687
|
name: e.name,
|
|
22629
22688
|
number: n
|
|
22630
22689
|
}) : n || e.name ? t("setup.wa.connectedAs", { number: n || e.name }) : t("setup.wa.connected");
|
|
22631
22690
|
}
|
|
22632
22691
|
// src/setup/WaLinkStep.tsx
|
|
22633
|
-
var
|
|
22692
|
+
var wE = [
|
|
22634
22693
|
"open",
|
|
22635
22694
|
"qr",
|
|
22636
22695
|
"connecting",
|
|
@@ -22639,10 +22698,10 @@ var CE = [
|
|
|
22639
22698
|
"replaced",
|
|
22640
22699
|
"blocked",
|
|
22641
22700
|
"disconnected"
|
|
22642
|
-
],
|
|
22643
|
-
function
|
|
22701
|
+
], TE = (e) => wE.includes(e);
|
|
22702
|
+
function EE({ onContinue: e, onSkip: t }) {
|
|
22644
22703
|
let { t: n } = I(["auth", "common"]), r = Na(), i = Ra(), a = r.data, o;
|
|
22645
|
-
o = r.isPending ? /* @__PURE__ */ z(
|
|
22704
|
+
o = r.isPending ? /* @__PURE__ */ z(DE, { text: n("setup.wa.checking") }) : r.error ? /* @__PURE__ */ z(Y, {
|
|
22646
22705
|
tone: "danger",
|
|
22647
22706
|
children: U(r.error)
|
|
22648
22707
|
}) : a?.state === "open" ? /* @__PURE__ */ B("div", {
|
|
@@ -22658,7 +22717,7 @@ function TE({ onContinue: e, onSkip: t }) {
|
|
|
22658
22717
|
children: n("setup.wa.linked")
|
|
22659
22718
|
}), /* @__PURE__ */ z("p", {
|
|
22660
22719
|
className: "break-words text-muted-foreground",
|
|
22661
|
-
children:
|
|
22720
|
+
children: CE(a.me, n)
|
|
22662
22721
|
})]
|
|
22663
22722
|
})]
|
|
22664
22723
|
}) : a?.state === "qr" && a.qr ? /* @__PURE__ */ B("div", {
|
|
@@ -22697,10 +22756,10 @@ function TE({ onContinue: e, onSkip: t }) {
|
|
|
22697
22756
|
"aria-busy": i.isPending || void 0,
|
|
22698
22757
|
disabled: i.isPending,
|
|
22699
22758
|
onClick: () => i.mutate("relink"),
|
|
22700
|
-
children: [i.isPending ? /* @__PURE__ */ z(
|
|
22759
|
+
children: [i.isPending ? /* @__PURE__ */ z(MS, {}) : /* @__PURE__ */ z(kn, { "aria-hidden": "true" }), n("setup.wa.showNewQr")]
|
|
22701
22760
|
})
|
|
22702
22761
|
]
|
|
22703
|
-
}) : /* @__PURE__ */ z(
|
|
22762
|
+
}) : /* @__PURE__ */ z(DE, { text: n("setup.wa.waitingQr") });
|
|
22704
22763
|
let s = a?.state === "open";
|
|
22705
22764
|
return r.isPending || r.error || a?.state !== "qr" && a?.state !== "connecting" || (o = /* @__PURE__ */ B(Ub, {
|
|
22706
22765
|
defaultValue: "qr",
|
|
@@ -22740,7 +22799,7 @@ function TE({ onContinue: e, onSkip: t }) {
|
|
|
22740
22799
|
pulse: a.state === "qr" || a.state === "connecting",
|
|
22741
22800
|
label: /* @__PURE__ */ z("span", {
|
|
22742
22801
|
className: "text-muted-foreground",
|
|
22743
|
-
children:
|
|
22802
|
+
children: TE(a.state) ? n(`setup.wa.states.${a.state}`) : a.state
|
|
22744
22803
|
})
|
|
22745
22804
|
})]
|
|
22746
22805
|
}), /* @__PURE__ */ B("ol", {
|
|
@@ -22777,7 +22836,7 @@ function TE({ onContinue: e, onSkip: t }) {
|
|
|
22777
22836
|
]
|
|
22778
22837
|
});
|
|
22779
22838
|
}
|
|
22780
|
-
function
|
|
22839
|
+
function DE({ text: e }) {
|
|
22781
22840
|
return /* @__PURE__ */ B("div", {
|
|
22782
22841
|
role: "status",
|
|
22783
22842
|
className: "flex flex-col items-center gap-3 py-8",
|
|
@@ -22790,20 +22849,20 @@ function EE({ text: e }) {
|
|
|
22790
22849
|
})]
|
|
22791
22850
|
});
|
|
22792
22851
|
}
|
|
22793
|
-
function
|
|
22852
|
+
function OE(e, t) {
|
|
22794
22853
|
let n = e.trim().replace(/\s+/g, " "), r = t(n);
|
|
22795
22854
|
if (r.length <= 64) return r;
|
|
22796
22855
|
let i = Math.max(1, 64 - t("").length), a = n.slice(0, i), o = a.lastIndexOf(" ");
|
|
22797
22856
|
return n[i] !== " " && o >= i / 2 && (a = a.slice(0, o)), a = a.replace(/[\s,.;:&/(-]+$/u, ""), t(a).slice(0, 64);
|
|
22798
22857
|
}
|
|
22799
22858
|
// src/setup/AiAssistantStep.tsx
|
|
22800
|
-
function
|
|
22859
|
+
function kE(e) {
|
|
22801
22860
|
let t = e.agents.find((t) => t.userId === e.member?.id);
|
|
22802
22861
|
return t ? t.id : e.agents.length === 1 ? e.agents[0].id : null;
|
|
22803
22862
|
}
|
|
22804
|
-
function
|
|
22863
|
+
function AE({ businessName: e, onDone: t }) {
|
|
22805
22864
|
let { t: n } = I("auth"), r = Ag(), i = Ig(), a = S(), o = u(), s = u(), c = u(), l = e || n("setup.ai.yourBusiness"), d = n("setup.ai.template", { business: l }), [f, h] = m(d), [g, _] = m(!0), [v, y] = m(null), [b, x] = m(!1), C = p(null), w = r.data ? Wv(r.data) : !1, T = async (e, t) => {
|
|
22806
|
-
let n =
|
|
22865
|
+
let n = kE(e);
|
|
22807
22866
|
if (n === null) {
|
|
22808
22867
|
await i.mutateAsync({
|
|
22809
22868
|
kind: "addText",
|
|
@@ -22822,7 +22881,7 @@ function kE({ businessName: e, onDone: t }) {
|
|
|
22822
22881
|
return;
|
|
22823
22882
|
}
|
|
22824
22883
|
let e = w && g, r = be.safeParse({
|
|
22825
|
-
displayName:
|
|
22884
|
+
displayName: OE(l, (e) => n("setup.ai.agentName", { business: e })),
|
|
22826
22885
|
enabled: !1,
|
|
22827
22886
|
instructions: Re,
|
|
22828
22887
|
handoffRules: Le
|
|
@@ -22905,7 +22964,7 @@ function kE({ businessName: e, onDone: t }) {
|
|
|
22905
22964
|
}), r.data ? /* @__PURE__ */ z($v, { status: r.data }) : r.error ? /* @__PURE__ */ z(Y, {
|
|
22906
22965
|
tone: "danger",
|
|
22907
22966
|
children: U(r.error)
|
|
22908
|
-
}) : /* @__PURE__ */ z(
|
|
22967
|
+
}) : /* @__PURE__ */ z(MS, {})]
|
|
22909
22968
|
}),
|
|
22910
22969
|
w && /* @__PURE__ */ B("div", {
|
|
22911
22970
|
className: "flex items-start justify-between gap-4 rounded-lg border p-3",
|
|
@@ -22947,35 +23006,35 @@ function kE({ businessName: e, onDone: t }) {
|
|
|
22947
23006
|
disabled: b,
|
|
22948
23007
|
"aria-busy": b || void 0,
|
|
22949
23008
|
onClick: () => void D(),
|
|
22950
|
-
children: [b && /* @__PURE__ */ z(
|
|
23009
|
+
children: [b && /* @__PURE__ */ z(MS, {}), n("setup.ai.finish")]
|
|
22951
23010
|
})]
|
|
22952
23011
|
})
|
|
22953
23012
|
]
|
|
22954
23013
|
});
|
|
22955
23014
|
}
|
|
22956
23015
|
// src/setup/username.ts
|
|
22957
|
-
var
|
|
22958
|
-
function
|
|
23016
|
+
var jE = "admin";
|
|
23017
|
+
function ME(e) {
|
|
22959
23018
|
return e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().trim().replace(/\s+/g, ".").replace(/[^a-z0-9_.-]/g, "").replace(/\.{2,}/g, ".").slice(0, 32).replace(/^[._-]+|[._-]+$/g, "");
|
|
22960
23019
|
}
|
|
22961
|
-
function
|
|
23020
|
+
function NE(e) {
|
|
22962
23021
|
if (!e.trim()) return "";
|
|
22963
|
-
let t =
|
|
22964
|
-
return t.length >= 3 ? t :
|
|
23022
|
+
let t = ME(e);
|
|
23023
|
+
return t.length >= 3 ? t : jE;
|
|
22965
23024
|
}
|
|
22966
23025
|
// src/setup/SetupWizard.tsx
|
|
22967
|
-
var
|
|
23026
|
+
var PE = [
|
|
22968
23027
|
"account",
|
|
22969
23028
|
"whatsapp",
|
|
22970
23029
|
"ai",
|
|
22971
23030
|
"ready"
|
|
22972
23031
|
];
|
|
22973
|
-
function
|
|
22974
|
-
let { t } = I("auth"), n =
|
|
23032
|
+
function FE({ current: e }) {
|
|
23033
|
+
let { t } = I("auth"), n = PE.indexOf(e);
|
|
22975
23034
|
return /* @__PURE__ */ z("ol", {
|
|
22976
23035
|
className: "mb-5 flex items-center gap-2 text-xs",
|
|
22977
23036
|
"aria-label": t("setup.progress"),
|
|
22978
|
-
children:
|
|
23037
|
+
children: PE.map((e, r) => /* @__PURE__ */ B("li", {
|
|
22979
23038
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
22980
23039
|
children: [
|
|
22981
23040
|
/* @__PURE__ */ z("span", {
|
|
@@ -22990,7 +23049,7 @@ function PE({ current: e }) {
|
|
|
22990
23049
|
className: G("hidden truncate sm:inline", r === n ? "font-medium text-foreground" : "text-muted-foreground"),
|
|
22991
23050
|
children: t(`setup.steps.${e}`)
|
|
22992
23051
|
}),
|
|
22993
|
-
r <
|
|
23052
|
+
r < PE.length - 1 && /* @__PURE__ */ z("span", {
|
|
22994
23053
|
"aria-hidden": "true",
|
|
22995
23054
|
className: G("h-px min-w-3 flex-1", r < n ? "bg-primary" : "bg-border")
|
|
22996
23055
|
})
|
|
@@ -22998,19 +23057,19 @@ function PE({ current: e }) {
|
|
|
22998
23057
|
}, e))
|
|
22999
23058
|
});
|
|
23000
23059
|
}
|
|
23001
|
-
function
|
|
23060
|
+
function IE({ current: e }) {
|
|
23002
23061
|
let { t } = I("auth");
|
|
23003
23062
|
return /* @__PURE__ */ z("p", {
|
|
23004
23063
|
className: "-mt-3 mb-5 text-center text-sm font-medium sm:hidden",
|
|
23005
23064
|
children: t("setup.stepOf", {
|
|
23006
|
-
n:
|
|
23007
|
-
total:
|
|
23065
|
+
n: PE.indexOf(e) + 1,
|
|
23066
|
+
total: PE.length,
|
|
23008
23067
|
name: t(`setup.steps.${e}`)
|
|
23009
23068
|
})
|
|
23010
23069
|
});
|
|
23011
23070
|
}
|
|
23012
|
-
function
|
|
23013
|
-
let { t: r } = I("auth"), i = Qi(), [a, o] = m(""), [s, c] = m(null), l = s ??
|
|
23071
|
+
function LE({ businessName: e, onBusinessName: t, onDone: n }) {
|
|
23072
|
+
let { t: r } = I("auth"), i = Qi(), [a, o] = m(""), [s, c] = m(null), l = s ?? NE(a), [u, d] = m(""), f = (l.length > 0 || s !== null) && !/^[a-zA-Z0-9_.-]{3,32}$/.test(l) ? r("setup.admin.usernameRule") : void 0, p = u.length > 0 && u.length < 8 ? r("setup.admin.minLength") : void 0, h = e.trim().length > 0 && !f && l.length >= 3 && a.trim().length > 0 && u.length >= 8, g = (e) => {
|
|
23014
23073
|
e.preventDefault(), h && i.mutate({
|
|
23015
23074
|
username: l,
|
|
23016
23075
|
displayName: a.trim(),
|
|
@@ -23031,7 +23090,7 @@ function IE({ businessName: e, onBusinessName: t, onDone: n }) {
|
|
|
23031
23090
|
title: _ ? r("setup.admin.forbiddenTitle") : void 0,
|
|
23032
23091
|
children: _ ? r("setup.admin.forbiddenBody") : U(i.error)
|
|
23033
23092
|
}),
|
|
23034
|
-
/* @__PURE__ */ z(
|
|
23093
|
+
/* @__PURE__ */ z(jS, {
|
|
23035
23094
|
label: r("setup.admin.businessName"),
|
|
23036
23095
|
autoComplete: "organization",
|
|
23037
23096
|
value: e,
|
|
@@ -23039,7 +23098,7 @@ function IE({ businessName: e, onBusinessName: t, onDone: n }) {
|
|
|
23039
23098
|
onChange: (e) => t(e.target.value),
|
|
23040
23099
|
hint: r("setup.admin.businessNameHint")
|
|
23041
23100
|
}),
|
|
23042
|
-
/* @__PURE__ */ z(
|
|
23101
|
+
/* @__PURE__ */ z(jS, {
|
|
23043
23102
|
label: r("setup.admin.yourName"),
|
|
23044
23103
|
autoComplete: "name",
|
|
23045
23104
|
value: a,
|
|
@@ -23047,7 +23106,7 @@ function IE({ businessName: e, onBusinessName: t, onDone: n }) {
|
|
|
23047
23106
|
onChange: (e) => o(e.target.value),
|
|
23048
23107
|
hint: r("setup.admin.displayNameHint")
|
|
23049
23108
|
}),
|
|
23050
|
-
/* @__PURE__ */ z(
|
|
23109
|
+
/* @__PURE__ */ z(jS, {
|
|
23051
23110
|
label: r("setup.admin.username"),
|
|
23052
23111
|
autoComplete: "username",
|
|
23053
23112
|
autoCapitalize: "none",
|
|
@@ -23056,9 +23115,9 @@ function IE({ businessName: e, onBusinessName: t, onDone: n }) {
|
|
|
23056
23115
|
value: l,
|
|
23057
23116
|
onChange: (e) => c(e.target.value),
|
|
23058
23117
|
error: f,
|
|
23059
|
-
hint: s === null && a.trim() !== "" &&
|
|
23118
|
+
hint: s === null && a.trim() !== "" && ME(a).length < 3 ? r("setup.admin.usernamePickedHint") : r("setup.admin.usernameAutoHint")
|
|
23060
23119
|
}),
|
|
23061
|
-
/* @__PURE__ */ z(
|
|
23120
|
+
/* @__PURE__ */ z(jS, {
|
|
23062
23121
|
label: r("setup.admin.passLabel"),
|
|
23063
23122
|
type: "password",
|
|
23064
23123
|
autoComplete: "new-password",
|
|
@@ -23074,7 +23133,7 @@ function IE({ businessName: e, onBusinessName: t, onDone: n }) {
|
|
|
23074
23133
|
"aria-busy": i.isPending || void 0,
|
|
23075
23134
|
disabled: i.isPending || !h,
|
|
23076
23135
|
children: [
|
|
23077
|
-
i.isPending && /* @__PURE__ */ z(
|
|
23136
|
+
i.isPending && /* @__PURE__ */ z(MS, {}),
|
|
23078
23137
|
r("setup.admin.submitContinue"),
|
|
23079
23138
|
!i.isPending && /* @__PURE__ */ z(bt, { "aria-hidden": "true" })
|
|
23080
23139
|
]
|
|
@@ -23082,7 +23141,7 @@ function IE({ businessName: e, onBusinessName: t, onDone: n }) {
|
|
|
23082
23141
|
]
|
|
23083
23142
|
});
|
|
23084
23143
|
}
|
|
23085
|
-
function
|
|
23144
|
+
function RE({ done: e, children: t }) {
|
|
23086
23145
|
return /* @__PURE__ */ B("li", {
|
|
23087
23146
|
className: "flex items-start gap-2 text-sm",
|
|
23088
23147
|
children: [e ? /* @__PURE__ */ z(Ft, {
|
|
@@ -23097,7 +23156,7 @@ function LE({ done: e, children: t }) {
|
|
|
23097
23156
|
})]
|
|
23098
23157
|
});
|
|
23099
23158
|
}
|
|
23100
|
-
function
|
|
23159
|
+
function zE({ aiOn: e }) {
|
|
23101
23160
|
let { t } = I("auth"), n = ee(), r = Na().data?.state === "open";
|
|
23102
23161
|
return /* @__PURE__ */ B("div", {
|
|
23103
23162
|
className: "flex flex-col gap-5",
|
|
@@ -23110,10 +23169,10 @@ function RE({ aiOn: e }) {
|
|
|
23110
23169
|
children: t("setup.ready.title")
|
|
23111
23170
|
}), /* @__PURE__ */ B("ul", {
|
|
23112
23171
|
className: "flex flex-col gap-2",
|
|
23113
|
-
children: [/* @__PURE__ */ z(
|
|
23172
|
+
children: [/* @__PURE__ */ z(RE, {
|
|
23114
23173
|
done: r,
|
|
23115
23174
|
children: t(r ? "setup.ready.waLinked" : "setup.ready.waNotLinked")
|
|
23116
|
-
}), /* @__PURE__ */ z(
|
|
23175
|
+
}), /* @__PURE__ */ z(RE, {
|
|
23117
23176
|
done: e,
|
|
23118
23177
|
children: t(e ? "setup.ready.aiOn" : "setup.ready.aiOff")
|
|
23119
23178
|
})]
|
|
@@ -23156,45 +23215,45 @@ function RE({ aiOn: e }) {
|
|
|
23156
23215
|
]
|
|
23157
23216
|
});
|
|
23158
23217
|
}
|
|
23159
|
-
function
|
|
23218
|
+
function BE() {
|
|
23160
23219
|
let { t: e } = I("auth"), t = Zi(), [n, r] = m("account"), [i, a] = m(""), [o, s] = m(!1), [c, l] = m(!1);
|
|
23161
|
-
return t.data?.needsSetup && !c && l(!0), t.isPending ? /* @__PURE__ */ z(
|
|
23220
|
+
return t.data?.needsSetup && !c && l(!0), t.isPending ? /* @__PURE__ */ z(NS, {}) : !c && n === "account" && t.data && !t.data.needsSetup ? /* @__PURE__ */ z(E, {
|
|
23162
23221
|
to: "/",
|
|
23163
23222
|
replace: !0
|
|
23164
|
-
}) : /* @__PURE__ */ B(
|
|
23223
|
+
}) : /* @__PURE__ */ B(AS, {
|
|
23165
23224
|
title: e("setup.title"),
|
|
23166
23225
|
subtitle: e("setup.subtitle"),
|
|
23167
23226
|
illustration: n === "account" ? "/illustrations/welcome.png" : void 0,
|
|
23168
23227
|
wide: !0,
|
|
23169
23228
|
children: [
|
|
23170
|
-
/* @__PURE__ */ z(PE, { current: n }),
|
|
23171
23229
|
/* @__PURE__ */ z(FE, { current: n }),
|
|
23230
|
+
/* @__PURE__ */ z(IE, { current: n }),
|
|
23172
23231
|
t.error && n === "account" && /* @__PURE__ */ z(Y, {
|
|
23173
23232
|
tone: "danger",
|
|
23174
23233
|
className: "mb-4",
|
|
23175
23234
|
children: U(t.error)
|
|
23176
23235
|
}),
|
|
23177
|
-
n === "account" && /* @__PURE__ */ z(
|
|
23236
|
+
n === "account" && /* @__PURE__ */ z(LE, {
|
|
23178
23237
|
businessName: i,
|
|
23179
23238
|
onBusinessName: a,
|
|
23180
23239
|
onDone: () => r("whatsapp")
|
|
23181
23240
|
}),
|
|
23182
|
-
n === "whatsapp" && /* @__PURE__ */ z(
|
|
23241
|
+
n === "whatsapp" && /* @__PURE__ */ z(EE, {
|
|
23183
23242
|
onContinue: () => r("ai"),
|
|
23184
23243
|
onSkip: () => r("ai")
|
|
23185
23244
|
}),
|
|
23186
|
-
n === "ai" && /* @__PURE__ */ z(
|
|
23245
|
+
n === "ai" && /* @__PURE__ */ z(AE, {
|
|
23187
23246
|
businessName: i.trim(),
|
|
23188
23247
|
onDone: (e) => {
|
|
23189
23248
|
s(e), r("ready");
|
|
23190
23249
|
}
|
|
23191
23250
|
}),
|
|
23192
|
-
n === "ready" && /* @__PURE__ */ z(
|
|
23251
|
+
n === "ready" && /* @__PURE__ */ z(zE, { aiOn: o })
|
|
23193
23252
|
]
|
|
23194
23253
|
});
|
|
23195
23254
|
}
|
|
23196
23255
|
// src/components/app/DevBuildBadge.tsx
|
|
23197
|
-
function
|
|
23256
|
+
function VE() {
|
|
23198
23257
|
let { t: e } = I("common"), t = h_() === "dev", n = e("devBuild");
|
|
23199
23258
|
return l(() => {
|
|
23200
23259
|
if (!t) return;
|
|
@@ -23212,49 +23271,49 @@ function BE() {
|
|
|
23212
23271
|
}) : null;
|
|
23213
23272
|
}
|
|
23214
23273
|
// src/App.tsx
|
|
23215
|
-
function
|
|
23274
|
+
function HE() {
|
|
23216
23275
|
let { pathname: e } = j(), t = $s();
|
|
23217
23276
|
return /* @__PURE__ */ B(Rs, {
|
|
23218
23277
|
resetKey: e,
|
|
23219
23278
|
children: [
|
|
23220
23279
|
/* @__PURE__ */ z(Ss, {}),
|
|
23221
|
-
/* @__PURE__ */ z(
|
|
23280
|
+
/* @__PURE__ */ z(VE, {}),
|
|
23222
23281
|
/* @__PURE__ */ B(k, { children: [
|
|
23223
23282
|
/* @__PURE__ */ z(O, {
|
|
23224
23283
|
path: "/setup",
|
|
23225
|
-
element: /* @__PURE__ */ z(
|
|
23284
|
+
element: /* @__PURE__ */ z(BE, {})
|
|
23226
23285
|
}),
|
|
23227
23286
|
/* @__PURE__ */ z(O, {
|
|
23228
23287
|
path: "/login",
|
|
23229
|
-
element: /* @__PURE__ */ z(
|
|
23288
|
+
element: /* @__PURE__ */ z(IS, {})
|
|
23230
23289
|
}),
|
|
23231
23290
|
/* @__PURE__ */ z(O, {
|
|
23232
23291
|
path: "/change-password",
|
|
23233
|
-
element: /* @__PURE__ */ z(
|
|
23292
|
+
element: /* @__PURE__ */ z(zS, { children: /* @__PURE__ */ z(PS, {}) })
|
|
23234
23293
|
}),
|
|
23235
23294
|
/* @__PURE__ */ B(O, {
|
|
23236
|
-
element: /* @__PURE__ */ z(
|
|
23295
|
+
element: /* @__PURE__ */ z(zS, {}),
|
|
23237
23296
|
children: [
|
|
23238
23297
|
/* @__PURE__ */ z(O, {
|
|
23239
23298
|
path: "/",
|
|
23240
|
-
element: /* @__PURE__ */ z(
|
|
23299
|
+
element: /* @__PURE__ */ z(SE, {})
|
|
23241
23300
|
}),
|
|
23242
23301
|
/* @__PURE__ */ z(O, {
|
|
23243
23302
|
path: "/oauth/authorize",
|
|
23244
|
-
element: /* @__PURE__ */ z(
|
|
23303
|
+
element: /* @__PURE__ */ z(RS, {})
|
|
23245
23304
|
}),
|
|
23246
23305
|
/* @__PURE__ */ z(O, {
|
|
23247
23306
|
path: "/chats/:jid",
|
|
23248
|
-
element: /* @__PURE__ */ z(
|
|
23307
|
+
element: /* @__PURE__ */ z(SE, {})
|
|
23249
23308
|
}),
|
|
23250
23309
|
rc(t, !1)
|
|
23251
23310
|
]
|
|
23252
23311
|
}),
|
|
23253
23312
|
/* @__PURE__ */ z(O, {
|
|
23254
23313
|
path: "/admin/*",
|
|
23255
|
-
element: /* @__PURE__ */ z(
|
|
23314
|
+
element: /* @__PURE__ */ z(zS, {
|
|
23256
23315
|
admin: !0,
|
|
23257
|
-
children: /* @__PURE__ */ z(
|
|
23316
|
+
children: /* @__PURE__ */ z(DS, {})
|
|
23258
23317
|
})
|
|
23259
23318
|
}),
|
|
23260
23319
|
/* @__PURE__ */ z(O, {
|
|
@@ -23269,8 +23328,8 @@ function VE() {
|
|
|
23269
23328
|
});
|
|
23270
23329
|
}
|
|
23271
23330
|
// src/access/AccessGate.tsx
|
|
23272
|
-
var
|
|
23273
|
-
async function
|
|
23331
|
+
var UE = 6e4, WE = 5e3;
|
|
23332
|
+
async function GE(e) {
|
|
23274
23333
|
try {
|
|
23275
23334
|
let t = await fetch("/api/access", {
|
|
23276
23335
|
headers: { accept: "application/json" },
|
|
@@ -23284,10 +23343,10 @@ async function WE(e) {
|
|
|
23284
23343
|
return null;
|
|
23285
23344
|
}
|
|
23286
23345
|
}
|
|
23287
|
-
function
|
|
23346
|
+
function KE() {
|
|
23288
23347
|
window.location.reload();
|
|
23289
23348
|
}
|
|
23290
|
-
function
|
|
23349
|
+
function qE({ children: e, reload: t = KE }) {
|
|
23291
23350
|
let n = $s(), [r, i] = m({ status: "loading" }), a = p(r);
|
|
23292
23351
|
l(() => {
|
|
23293
23352
|
a.current = r;
|
|
@@ -23296,7 +23355,7 @@ function KE({ children: e, reload: t = GE }) {
|
|
|
23296
23355
|
if (!c.current) {
|
|
23297
23356
|
c.current = !0, s.current = Date.now();
|
|
23298
23357
|
try {
|
|
23299
|
-
let e = await
|
|
23358
|
+
let e = await GE(), n = a.current;
|
|
23300
23359
|
e && !e.open ? i({
|
|
23301
23360
|
status: "closed",
|
|
23302
23361
|
code: e.code ?? "access_closed",
|
|
@@ -23317,7 +23376,7 @@ function KE({ children: e, reload: t = GE }) {
|
|
|
23317
23376
|
confirmed: !1
|
|
23318
23377
|
}), t());
|
|
23319
23378
|
}, t = () => {
|
|
23320
|
-
Date.now() - s.current >=
|
|
23379
|
+
Date.now() - s.current >= WE && u();
|
|
23321
23380
|
};
|
|
23322
23381
|
return window.addEventListener(Fr, e), window.addEventListener(Ir, t), () => {
|
|
23323
23382
|
window.removeEventListener(Fr, e), window.removeEventListener(Ir, t);
|
|
@@ -23326,13 +23385,13 @@ function KE({ children: e, reload: t = GE }) {
|
|
|
23326
23385
|
let d = r.status === "closed";
|
|
23327
23386
|
l(() => {
|
|
23328
23387
|
if (!d) return;
|
|
23329
|
-
let e = setInterval(() => void u(),
|
|
23388
|
+
let e = setInterval(() => void u(), UE);
|
|
23330
23389
|
return () => clearInterval(e);
|
|
23331
23390
|
}, [d, u]);
|
|
23332
23391
|
let f = o(() => void u(), [u]);
|
|
23333
|
-
if (r.status === "loading") return /* @__PURE__ */ z(
|
|
23392
|
+
if (r.status === "loading") return /* @__PURE__ */ z(NS, {});
|
|
23334
23393
|
if (r.status === "open") return /* @__PURE__ */ z(R, { children: e });
|
|
23335
|
-
let h = n.find((e) => e.lockScreen)?.lockScreen, g = /* @__PURE__ */ z(
|
|
23394
|
+
let h = n.find((e) => e.lockScreen)?.lockScreen, g = /* @__PURE__ */ z(JE, {
|
|
23336
23395
|
code: r.code,
|
|
23337
23396
|
recheck: f
|
|
23338
23397
|
});
|
|
@@ -23344,13 +23403,13 @@ function KE({ children: e, reload: t = GE }) {
|
|
|
23344
23403
|
}) : g
|
|
23345
23404
|
});
|
|
23346
23405
|
}
|
|
23347
|
-
function
|
|
23406
|
+
function JE({ code: e, recheck: t }) {
|
|
23348
23407
|
let { t: n } = I(), [r, i] = m(!1);
|
|
23349
23408
|
return l(() => {
|
|
23350
23409
|
if (!r) return;
|
|
23351
23410
|
let e = setTimeout(() => i(!1), 1500);
|
|
23352
23411
|
return () => clearTimeout(e);
|
|
23353
|
-
}, [r]), /* @__PURE__ */ z(
|
|
23412
|
+
}, [r]), /* @__PURE__ */ z(AS, {
|
|
23354
23413
|
title: n("access.pausedTitle"),
|
|
23355
23414
|
subtitle: n("access.pausedBody"),
|
|
23356
23415
|
languageSelect: !1,
|
|
@@ -23387,7 +23446,7 @@ function qE({ code: e, recheck: t }) {
|
|
|
23387
23446
|
});
|
|
23388
23447
|
}
|
|
23389
23448
|
// src/components/ui/sonner.tsx
|
|
23390
|
-
var
|
|
23449
|
+
var YE = ({ ...e }) => {
|
|
23391
23450
|
let { resolvedTheme: t } = ax();
|
|
23392
23451
|
return /* @__PURE__ */ z(Mr, {
|
|
23393
23452
|
theme: t,
|
|
@@ -23409,26 +23468,26 @@ var JE = ({ ...e }) => {
|
|
|
23409
23468
|
});
|
|
23410
23469
|
};
|
|
23411
23470
|
// src/components/ui/tooltip.tsx
|
|
23412
|
-
function
|
|
23471
|
+
function XE({ delayDuration: e = 0, ...t }) {
|
|
23413
23472
|
return /* @__PURE__ */ z(Tr.Provider, {
|
|
23414
23473
|
"data-slot": "tooltip-provider",
|
|
23415
23474
|
delayDuration: e,
|
|
23416
23475
|
...t
|
|
23417
23476
|
});
|
|
23418
23477
|
}
|
|
23419
|
-
function
|
|
23478
|
+
function ZE({ ...e }) {
|
|
23420
23479
|
return /* @__PURE__ */ z(Tr.Root, {
|
|
23421
23480
|
"data-slot": "tooltip",
|
|
23422
23481
|
...e
|
|
23423
23482
|
});
|
|
23424
23483
|
}
|
|
23425
|
-
function
|
|
23484
|
+
function QE({ ...e }) {
|
|
23426
23485
|
return /* @__PURE__ */ z(Tr.Trigger, {
|
|
23427
23486
|
"data-slot": "tooltip-trigger",
|
|
23428
23487
|
...e
|
|
23429
23488
|
});
|
|
23430
23489
|
}
|
|
23431
|
-
function
|
|
23490
|
+
function $E({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
23432
23491
|
return /* @__PURE__ */ z(Tr.Portal, { children: /* @__PURE__ */ B(Tr.Content, {
|
|
23433
23492
|
"data-slot": "tooltip-content",
|
|
23434
23493
|
sideOffset: t,
|
|
@@ -23438,14 +23497,14 @@ function QE({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
|
23438
23497
|
}) });
|
|
23439
23498
|
}
|
|
23440
23499
|
// src/i18n/LocaleSync.tsx
|
|
23441
|
-
function
|
|
23500
|
+
function eD() {
|
|
23442
23501
|
let { user: e } = as(), { t } = I(), n = e?.locale ?? null;
|
|
23443
23502
|
return l(() => {
|
|
23444
23503
|
n && n !== Zb.getSnapshot() && Zb.setLocale(n).catch(() => V.error(t("language.loadFailed")));
|
|
23445
23504
|
}, [n, t]), null;
|
|
23446
23505
|
}
|
|
23447
23506
|
// src/create-app.tsx
|
|
23448
|
-
function
|
|
23507
|
+
function tD() {
|
|
23449
23508
|
return new _({ defaultOptions: {
|
|
23450
23509
|
queries: {
|
|
23451
23510
|
staleTime: 15e3,
|
|
@@ -23455,20 +23514,20 @@ function eD() {
|
|
|
23455
23514
|
mutations: { retry: !1 }
|
|
23456
23515
|
} });
|
|
23457
23516
|
}
|
|
23458
|
-
async function
|
|
23517
|
+
async function nD({ extensions: e = [], root: t = document.getElementById("root") ?? void 0, productName: r, links: i } = {}) {
|
|
23459
23518
|
Xs(e);
|
|
23460
23519
|
let a = Jo(i);
|
|
23461
23520
|
if (r !== void 0 && ri(r), !t) throw Error("#root missing");
|
|
23462
23521
|
gi();
|
|
23463
|
-
let o =
|
|
23522
|
+
let o = tD(), s = () => g(t).render(/* @__PURE__ */ z(n, { children: /* @__PURE__ */ z(v, {
|
|
23464
23523
|
client: o,
|
|
23465
23524
|
children: /* @__PURE__ */ z(C, { children: /* @__PURE__ */ z(Qs, {
|
|
23466
23525
|
extensions: e,
|
|
23467
23526
|
children: /* @__PURE__ */ z($o, {
|
|
23468
23527
|
links: a,
|
|
23469
|
-
children: /* @__PURE__ */ B(
|
|
23528
|
+
children: /* @__PURE__ */ B(XE, {
|
|
23470
23529
|
delayDuration: 300,
|
|
23471
|
-
children: [/* @__PURE__ */ z(
|
|
23530
|
+
children: [/* @__PURE__ */ z(qE, { children: /* @__PURE__ */ B(is, { children: [/* @__PURE__ */ z(eD, {}), /* @__PURE__ */ z(mo, { children: /* @__PURE__ */ z(HE, {}) })] }) }), /* @__PURE__ */ z(YE, {
|
|
23472
23531
|
position: "top-center",
|
|
23473
23532
|
closeButton: !0,
|
|
23474
23533
|
richColors: !1
|
|
@@ -23480,4 +23539,4 @@ async function tD({ extensions: e = [], root: t = document.getElementById("root"
|
|
|
23480
23539
|
for (let e of Object.values(c)) e().then((e) => (e.registerSW ?? e.default)?.()).catch((e) => console.warn("Service worker registration failed", e));
|
|
23481
23540
|
await (e.length > 0 ? ec(e) : Promise.resolve()).then(() => Zb.ready()).catch((e) => console.warn("Language load failed", e)).finally(s);
|
|
23482
23541
|
}
|
|
23483
|
-
export { uv as AlertDialog, bv as AlertDialogAction, xv as AlertDialogCancel, mv as AlertDialogContent, vv as AlertDialogDescription, gv as AlertDialogFooter, hv as AlertDialogHeader, yv as AlertDialogMedia, pv as AlertDialogOverlay, fv as AlertDialogPortal, _v as AlertDialogTitle, dv as AlertDialogTrigger, li as ApiError,
|
|
23542
|
+
export { uv as AlertDialog, bv as AlertDialogAction, xv as AlertDialogCancel, mv as AlertDialogContent, vv as AlertDialogDescription, gv as AlertDialogFooter, hv as AlertDialogHeader, yv as AlertDialogMedia, pv as AlertDialogOverlay, fv as AlertDialogPortal, _v as AlertDialogTitle, dv as AlertDialogTrigger, li as ApiError, kS as AppMark, AS as AuthShell, cb as Avatar, db as AvatarBadge, ub as AvatarFallback, fb as AvatarGroup, pb as AvatarGroupCount, lb as AvatarImage, q as Badge, Y as Banner, K as Button, Q as Card, y_ as CardAction, b_ as CardContent, v_ as CardDescription, x_ as CardFooter, g_ as CardHeader, __ as CardTitle, B_ as Checkbox, sC as Command, cC as CommandDialog, dC as CommandEmpty, fC as CommandGroup, lC as CommandInput, mC as CommandItem, uC as CommandList, pC as CommandSeparator, hC as CommandShortcut, _o as Dialog, bo as DialogClose, So as DialogContent, Eo as DialogDescription, wo as DialogFooter, Co as DialogHeader, xo as DialogOverlay, yo as DialogPortal, To as DialogTitle, vo as DialogTrigger, Do as Drawer, Ao as DrawerClose, Mo as DrawerContent, Io as DrawerDescription, Po as DrawerFooter, No as DrawerHeader, jo as DrawerOverlay, ko as DrawerPortal, Fo as DrawerTitle, Oo as DrawerTrigger, V_ as DropdownMenu, q_ as DropdownMenuCheckboxItem, W_ as DropdownMenuContent, G_ as DropdownMenuGroup, K_ as DropdownMenuItem, X_ as DropdownMenuLabel, H_ as DropdownMenuPortal, J_ as DropdownMenuRadioGroup, Y_ as DropdownMenuRadioItem, Z_ as DropdownMenuSeparator, Q_ as DropdownMenuShortcut, $_ as DropdownMenuSub, tv as DropdownMenuSubContent, ev as DropdownMenuSubTrigger, U_ as DropdownMenuTrigger, Vs as EXTENSION_NAME_PATTERN, As as EmptyState, Rs as ErrorBoundary, S_ as Input, qo as LITE_APP_LINKS, J as Label, Is as PageHeader, JE as PausedScreen, gC as Popover, yC as PopoverAnchor, vC as PopoverContent, SC as PopoverDescription, bC as PopoverHeader, xC as PopoverTitle, _C as PopoverTrigger, hx as Progress, Ds as RadioGroup, Os as RadioGroupItem, Fs as ResponsiveDialog, Ls as ResponsiveTable, Jx as ScrollArea, Yx as ScrollBar, ks as SegmentedControl, C_ as Select, D_ as SelectContent, w_ as SelectGroup, k_ as SelectItem, O_ as SelectLabel, M_ as SelectScrollDownButton, j_ as SelectScrollUpButton, A_ as SelectSeparator, E_ as SelectTrigger, T_ as SelectValue, e_ as Separator, t_ as Sheet, r_ as SheetClose, o_ as SheetContent, u_ as SheetDescription, c_ as SheetFooter, s_ as SheetHeader, l_ as SheetTitle, n_ as SheetTrigger, $ as Skeleton, lc as SlimBanner, Ms as StatusDot, Xg as Switch, nv as Table, iv as TableBody, lv as TableCaption, cv as TableCell, av as TableFooter, sv as TableHead, rv as TableHeader, ov as TableRow, Ub as Tabs, qb as TabsContent, Gb as TabsList, Kb as TabsTrigger, N_ as Textarea, YE as Toaster, ZE as Tooltip, $E as TooltipContent, XE as TooltipProvider, QE as TooltipTrigger, ut as Trans, Bs as WEB_EXTENSION_ADMIN_SECTIONS, Ks as WebExtensionError, H as api, bs as badgeVariants, ho as buttonVariants, G as cn, nD as createInboxApp, U as errorMessage, Js as extensionKeyPrefix, Ys as extensionPath, Wb as tabsListVariants, oc as useAgentSection, es as useAppLinks, as as useAuth, tc as useExtensionTranslation, pt as useTranslation, Xs as validateWebExtensions };
|