kaafil-react-uikit 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/admin/index.cjs +565 -387
- package/dist/admin/index.cjs.map +1 -1
- package/dist/admin/index.d.cts +2 -2
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.js +231 -53
- package/dist/admin/index.js.map +1 -1
- package/dist/{chunk-RO2RNHQP.js → chunk-2LMFSKZU.js} +56 -17
- package/dist/chunk-2LMFSKZU.js.map +1 -0
- package/dist/{chunk-BBC5EX5O.cjs → chunk-2XW5EIMS.cjs} +17 -17
- package/dist/{chunk-BBC5EX5O.cjs.map → chunk-2XW5EIMS.cjs.map} +1 -1
- package/dist/{chunk-YU2242AR.js → chunk-3BEQYIFU.js} +5 -5
- package/dist/{chunk-YU2242AR.js.map → chunk-3BEQYIFU.js.map} +1 -1
- package/dist/{chunk-UALMCHNW.cjs → chunk-3N2EQ2KC.cjs} +84 -36
- package/dist/chunk-3N2EQ2KC.cjs.map +1 -0
- package/dist/{chunk-57SUK3GD.cjs → chunk-4QYI7TOF.cjs} +7 -7
- package/dist/{chunk-57SUK3GD.cjs.map → chunk-4QYI7TOF.cjs.map} +1 -1
- package/dist/{chunk-ECCQW5LN.cjs → chunk-6BY2NPBZ.cjs} +4 -4
- package/dist/{chunk-ECCQW5LN.cjs.map → chunk-6BY2NPBZ.cjs.map} +1 -1
- package/dist/{chunk-YNHOPYBK.cjs → chunk-7356B6YS.cjs} +12 -12
- package/dist/{chunk-YNHOPYBK.cjs.map → chunk-7356B6YS.cjs.map} +1 -1
- package/dist/{chunk-A4Z2YBEF.js → chunk-7G6IENKN.js} +84 -36
- package/dist/chunk-7G6IENKN.js.map +1 -0
- package/dist/{chunk-6TI6YQPE.cjs → chunk-A7C74SJT.cjs} +168 -123
- package/dist/chunk-A7C74SJT.cjs.map +1 -0
- package/dist/{chunk-KW5LH6KV.js → chunk-CLHAJBJS.js} +3 -3
- package/dist/{chunk-KW5LH6KV.js.map → chunk-CLHAJBJS.js.map} +1 -1
- package/dist/{chunk-GJ2J3PYN.js → chunk-E6ER25BG.js} +3 -3
- package/dist/{chunk-GJ2J3PYN.js.map → chunk-E6ER25BG.js.map} +1 -1
- package/dist/{chunk-HACH2NUM.cjs → chunk-KETEED2T.cjs} +9 -9
- package/dist/{chunk-HACH2NUM.cjs.map → chunk-KETEED2T.cjs.map} +1 -1
- package/dist/{chunk-RWLO6IFX.js → chunk-KTEXDGAA.js} +3 -3
- package/dist/{chunk-RWLO6IFX.js.map → chunk-KTEXDGAA.js.map} +1 -1
- package/dist/{chunk-VLP323AD.js → chunk-RBIEMGHT.js} +3 -3
- package/dist/{chunk-VLP323AD.js.map → chunk-RBIEMGHT.js.map} +1 -1
- package/dist/{chunk-JHMN6Q5R.js → chunk-WPQB7JWS.js} +92 -47
- package/dist/chunk-WPQB7JWS.js.map +1 -0
- package/dist/{chunk-IU2UM5JP.cjs → chunk-XBLAVNP3.cjs} +88 -48
- package/dist/chunk-XBLAVNP3.cjs.map +1 -0
- package/dist/core/index.cjs +124 -121
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +10 -1
- package/dist/core/index.d.ts +10 -1
- package/dist/core/index.js +20 -19
- package/dist/core/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/manager/index.cjs +239 -239
- package/dist/manager/index.js +6 -6
- package/dist/tokens.json +5013 -0
- package/dist/traveller/index.cjs +46 -40
- package/dist/traveller/index.cjs.map +1 -1
- package/dist/traveller/index.js +16 -10
- package/dist/traveller/index.js.map +1 -1
- package/dist/{useAgencyTrip-BUYSIaC2.d.cts → useAgencyTrip-C1YmfuQq.d.cts} +35 -1
- package/dist/{useAgencyTrip-BzyJB1D9.d.ts → useAgencyTrip-gZB0NILH.d.ts} +35 -1
- package/package.json +4 -3
- package/dist/chunk-6TI6YQPE.cjs.map +0 -1
- package/dist/chunk-A4Z2YBEF.js.map +0 -1
- package/dist/chunk-IU2UM5JP.cjs.map +0 -1
- package/dist/chunk-JHMN6Q5R.js.map +0 -1
- package/dist/chunk-RO2RNHQP.js.map +0 -1
- package/dist/chunk-UALMCHNW.cjs.map +0 -1
package/dist/admin/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkXBLAVNP3_cjs = require('../chunk-XBLAVNP3.cjs');
|
|
4
|
+
var chunkA7C74SJT_cjs = require('../chunk-A7C74SJT.cjs');
|
|
5
|
+
require('../chunk-6BY2NPBZ.cjs');
|
|
6
|
+
var chunk7356B6YS_cjs = require('../chunk-7356B6YS.cjs');
|
|
7
|
+
var chunk3N2EQ2KC_cjs = require('../chunk-3N2EQ2KC.cjs');
|
|
8
8
|
var react = require('react');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
@@ -109,13 +109,13 @@ function CloseIcon(props) {
|
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
function StatusPill({ tone, children, style }) {
|
|
112
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-admin-shared-patterns-pill", "data-tone": tone, style:
|
|
112
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-admin-shared-patterns-pill", "data-tone": tone, style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
113
113
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-admin-shared-patterns-pill-dot", "aria-hidden": "true" }),
|
|
114
114
|
children
|
|
115
115
|
] });
|
|
116
116
|
}
|
|
117
117
|
function Tag({ tone, children, style }) {
|
|
118
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-admin-shared-patterns-tag", "data-tone": tone, style:
|
|
118
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-admin-shared-patterns-tag", "data-tone": tone, style: chunk3N2EQ2KC_cjs.tokenStyle(style), children });
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
// src/admin/composite/office/AgencySettingsScreen/internal/fieldDisplayValue.ts
|
|
@@ -183,7 +183,7 @@ function SheetDialog({
|
|
|
183
183
|
role: "dialog",
|
|
184
184
|
"aria-modal": "true",
|
|
185
185
|
"aria-labelledby": titleId,
|
|
186
|
-
style:
|
|
186
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
187
187
|
children: [
|
|
188
188
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-shared-patterns-sheet-header", children: [
|
|
189
189
|
eyebrow === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-admin-shared-patterns-sheet-eyebrow", children: eyebrow }),
|
|
@@ -479,7 +479,7 @@ function TriStateToggle({ entry, onChange, t }) {
|
|
|
479
479
|
function NoRender() {
|
|
480
480
|
return null;
|
|
481
481
|
}
|
|
482
|
-
var fieldKindRegistry =
|
|
482
|
+
var fieldKindRegistry = chunk3N2EQ2KC_cjs.createRegistry({
|
|
483
483
|
fallback: { render: NoRender }
|
|
484
484
|
});
|
|
485
485
|
fieldKindRegistry.register("toggle", {
|
|
@@ -629,11 +629,11 @@ function SectionCard({
|
|
|
629
629
|
onDismissError,
|
|
630
630
|
style
|
|
631
631
|
}) {
|
|
632
|
-
const { t } =
|
|
632
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
633
633
|
const [dialogOpen, setDialogOpen] = react.useState(false);
|
|
634
634
|
const setFields = section.fields.filter((field) => stored?.[field.key] !== void 0);
|
|
635
635
|
const isCustomized = setFields.length > 0;
|
|
636
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-agency-settings-screen__panel-inner", style:
|
|
636
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-agency-settings-screen__panel-inner", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
637
637
|
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "kf-agency-settings-screen__panel-head", children: [
|
|
638
638
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-agency-settings-screen__panel-head-copy", children: [
|
|
639
639
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "kf-agency-settings-screen__panel-eyebrow", children: [
|
|
@@ -1005,8 +1005,8 @@ function AgencySettingsScreen({
|
|
|
1005
1005
|
components,
|
|
1006
1006
|
style
|
|
1007
1007
|
}) {
|
|
1008
|
-
const { t } =
|
|
1009
|
-
const { document: document2, loaded, lastFetchFailed, refresh, patchSettings } =
|
|
1008
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
1009
|
+
const { document: document2, loaded, lastFetchFailed, refresh, patchSettings } = chunkXBLAVNP3_cjs.useAgencySettings();
|
|
1010
1010
|
const [selectedSectionId, setSelectedSectionId] = react.useState(AGENCY_SETTINGS_SECTIONS[0]?.id);
|
|
1011
1011
|
const [savingSectionId, setSavingSectionId] = react.useState(void 0);
|
|
1012
1012
|
const [sectionError, setSectionError] = react.useState(void 0);
|
|
@@ -1023,13 +1023,13 @@ function AgencySettingsScreen({
|
|
|
1023
1023
|
try {
|
|
1024
1024
|
await patchSettings({ version: document2.version, [sectionId]: patch });
|
|
1025
1025
|
} catch (error) {
|
|
1026
|
-
const kind =
|
|
1026
|
+
const kind = chunkA7C74SJT_cjs.classifyError(error).code === "CONFLICT_VERSION" ? "conflict" : "failed";
|
|
1027
1027
|
setSectionError({ sectionId, kind });
|
|
1028
1028
|
} finally {
|
|
1029
1029
|
setSavingSectionId(void 0);
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-agency-settings-screen", style:
|
|
1032
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-agency-settings-screen", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
1033
1033
|
title !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-agency-settings-screen__heading", children: [
|
|
1034
1034
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-agency-settings-screen__eyebrow", children: t("chrome.agencySettingsScreen.eyebrow") }),
|
|
1035
1035
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "kf-agency-settings-screen__title", children: title }),
|
|
@@ -1146,7 +1146,7 @@ function summaryFor(t, selected, everyLabelKey, optionLabelKey) {
|
|
|
1146
1146
|
return selected.length === 0 ? t(everyLabelKey) : selected.map(optionLabelKey).join(", ");
|
|
1147
1147
|
}
|
|
1148
1148
|
function AutoAttachPanel({ template, saving, onSave }) {
|
|
1149
|
-
const { t } =
|
|
1149
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
1150
1150
|
const titleId = react.useId();
|
|
1151
1151
|
const [dialogOpen, setDialogOpen] = react.useState(false);
|
|
1152
1152
|
const [draft, setDraft] = react.useState(() => draftFromTemplate(template));
|
|
@@ -1382,9 +1382,9 @@ function TemplateEditorHeader({
|
|
|
1382
1382
|
onPublish,
|
|
1383
1383
|
style
|
|
1384
1384
|
}) {
|
|
1385
|
-
const { t } =
|
|
1385
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
1386
1386
|
const statusLabelKey5 = template.status === "PUBLISHED" ? "chrome.checklistTemplateEditor.status.published" : "chrome.checklistTemplateEditor.status.draft";
|
|
1387
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor__header", style:
|
|
1387
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor__header", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
1388
1388
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor__header-identity", children: [
|
|
1389
1389
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor__header-top", children: [
|
|
1390
1390
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1453,7 +1453,7 @@ function TemplateItemEditDialog({
|
|
|
1453
1453
|
onRemove,
|
|
1454
1454
|
onClose
|
|
1455
1455
|
}) {
|
|
1456
|
-
const { t } =
|
|
1456
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
1457
1457
|
const titleId = react.useId();
|
|
1458
1458
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1459
1459
|
SheetDialog,
|
|
@@ -1603,7 +1603,7 @@ function TemplateItemRow({
|
|
|
1603
1603
|
onReorder,
|
|
1604
1604
|
style
|
|
1605
1605
|
}) {
|
|
1606
|
-
const { t } =
|
|
1606
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
1607
1607
|
const dayOffset = item.dayOffset.trim().length > 0 ? Number.parseInt(item.dayOffset, 10) : null;
|
|
1608
1608
|
const dayLabel = dayOffset === null ? "\u2014" : dayOffset > 0 ? `D+${dayOffset}` : `D${dayOffset}`;
|
|
1609
1609
|
return (
|
|
@@ -1631,7 +1631,7 @@ function TemplateItemRow({
|
|
|
1631
1631
|
onReorder(draggedDraftId, item.draftId);
|
|
1632
1632
|
}
|
|
1633
1633
|
},
|
|
1634
|
-
style:
|
|
1634
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
1635
1635
|
children: [
|
|
1636
1636
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-checklist-template-editor__item-drag", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(DragHandleIcon, {}) }),
|
|
1637
1637
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-checklist-template-editor__item-index", children: String(index + 1).padStart(2, "0") }),
|
|
@@ -1703,8 +1703,8 @@ function ChecklistTemplateEditor({
|
|
|
1703
1703
|
components,
|
|
1704
1704
|
style
|
|
1705
1705
|
}) {
|
|
1706
|
-
const { t } =
|
|
1707
|
-
const { templates, loaded, lastFetchFailed, refresh, patchTemplate, publishTemplate } =
|
|
1706
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
1707
|
+
const { templates, loaded, lastFetchFailed, refresh, patchTemplate, publishTemplate } = chunkXBLAVNP3_cjs.useAgencyChecklistTemplates();
|
|
1708
1708
|
const template = templates.find((candidate) => candidate.id === templateId);
|
|
1709
1709
|
const [title, setTitle] = react.useState("");
|
|
1710
1710
|
const [items, setItems] = react.useState([]);
|
|
@@ -1821,7 +1821,7 @@ function ChecklistTemplateEditor({
|
|
|
1821
1821
|
}
|
|
1822
1822
|
};
|
|
1823
1823
|
if (lastFetchFailed && !loaded) {
|
|
1824
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-checklist-template-editor", "data-framed": "true", style:
|
|
1824
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-checklist-template-editor", "data-framed": "true", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor__status-block", role: "alert", children: [
|
|
1825
1825
|
/* @__PURE__ */ jsxRuntime.jsx(WarningIcon2, { className: "kf-checklist-template-editor__status-icon kf-checklist-template-editor__status-icon--danger" }),
|
|
1826
1826
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-checklist-template-editor__status-title", children: t("chrome.checklistTemplateEditor.errorTitle") }),
|
|
1827
1827
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1836,20 +1836,20 @@ function ChecklistTemplateEditor({
|
|
|
1836
1836
|
] }) });
|
|
1837
1837
|
}
|
|
1838
1838
|
if (!loaded) {
|
|
1839
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-checklist-template-editor", "data-framed": "true", style:
|
|
1839
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-checklist-template-editor", "data-framed": "true", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor__skeleton", "aria-hidden": "true", children: [
|
|
1840
1840
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-checklist-template-editor__skeleton-block" }),
|
|
1841
1841
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-checklist-template-editor__skeleton-block" }),
|
|
1842
1842
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-checklist-template-editor__skeleton-block" })
|
|
1843
1843
|
] }) });
|
|
1844
1844
|
}
|
|
1845
1845
|
if (template === void 0) {
|
|
1846
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-checklist-template-editor", "data-framed": "true", style:
|
|
1846
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-checklist-template-editor", "data-framed": "true", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor__status-block", children: [
|
|
1847
1847
|
/* @__PURE__ */ jsxRuntime.jsx(EmptyStateIcon2, { className: "kf-checklist-template-editor__status-icon" }),
|
|
1848
1848
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-checklist-template-editor__status-title", children: t("chrome.checklistTemplateEditor.notFoundTitle") })
|
|
1849
1849
|
] }) });
|
|
1850
1850
|
}
|
|
1851
1851
|
const editingItem = items.find((item) => item.draftId === editingDraftId);
|
|
1852
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor", style:
|
|
1852
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-editor", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
1853
1853
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1854
1854
|
TemplateEditorHeader2,
|
|
1855
1855
|
{
|
|
@@ -1952,7 +1952,7 @@ var AUDIENCE_HINT_KEY = {
|
|
|
1952
1952
|
EXTERNAL: "chrome.checklistTemplateLibrary.audience.externalHint"
|
|
1953
1953
|
};
|
|
1954
1954
|
function CreateTemplateSheet({ onSubmit, onClose }) {
|
|
1955
|
-
const { t } =
|
|
1955
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
1956
1956
|
const titleId = react.useId();
|
|
1957
1957
|
const [locale, setLocale] = react.useState("en");
|
|
1958
1958
|
const [title, setTitle] = react.useState("");
|
|
@@ -2069,7 +2069,7 @@ function DeleteTemplateConfirmSheet({
|
|
|
2069
2069
|
onConfirm,
|
|
2070
2070
|
onClose
|
|
2071
2071
|
}) {
|
|
2072
|
-
const { t } =
|
|
2072
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
2073
2073
|
const titleId = react.useId();
|
|
2074
2074
|
if (template === void 0) {
|
|
2075
2075
|
return null;
|
|
@@ -2188,7 +2188,7 @@ function TemplateRow({
|
|
|
2188
2188
|
onDelete,
|
|
2189
2189
|
style
|
|
2190
2190
|
}) {
|
|
2191
|
-
const { t } =
|
|
2191
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
2192
2192
|
const statusLabelKey5 = template.status === "PUBLISHED" ? "chrome.checklistTemplateLibrary.status.published" : "chrome.checklistTemplateLibrary.status.draft";
|
|
2193
2193
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2194
2194
|
"tr",
|
|
@@ -2197,7 +2197,7 @@ function TemplateRow({
|
|
|
2197
2197
|
className: "kf-checklist-template-library__table-row",
|
|
2198
2198
|
"data-selectable": onSelect !== void 0 ? "true" : void 0,
|
|
2199
2199
|
"data-selected": selected === true ? "true" : void 0,
|
|
2200
|
-
style:
|
|
2200
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
2201
2201
|
children: [
|
|
2202
2202
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2203
2203
|
"td",
|
|
@@ -2287,7 +2287,7 @@ function TemplateLibrarySkeleton() {
|
|
|
2287
2287
|
] }, rowIndex)) }) }) });
|
|
2288
2288
|
}
|
|
2289
2289
|
function CardHeading({ count }) {
|
|
2290
|
-
const { t } =
|
|
2290
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
2291
2291
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-checklist-template-library__card-title", children: t(
|
|
2292
2292
|
count === 1 ? "chrome.checklistTemplateLibrary.countLabelOne" : "chrome.checklistTemplateLibrary.countLabel"
|
|
2293
2293
|
).replace("{count}", String(count)) });
|
|
@@ -2303,8 +2303,8 @@ function ChecklistTemplateLibrary({
|
|
|
2303
2303
|
components,
|
|
2304
2304
|
style
|
|
2305
2305
|
}) {
|
|
2306
|
-
const { t } =
|
|
2307
|
-
const { templates, loaded, lastFetchFailed, refresh, createTemplate, removeTemplate } =
|
|
2306
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
2307
|
+
const { templates, loaded, lastFetchFailed, refresh, createTemplate, removeTemplate } = chunkXBLAVNP3_cjs.useAgencyChecklistTemplates();
|
|
2308
2308
|
const isControlled = controlledCreating !== void 0 && onCreatingChange !== void 0;
|
|
2309
2309
|
const [internalCreating, setInternalCreating] = react.useState(false);
|
|
2310
2310
|
const creating = isControlled ? controlledCreating : internalCreating;
|
|
@@ -2340,7 +2340,7 @@ function ChecklistTemplateLibrary({
|
|
|
2340
2340
|
]
|
|
2341
2341
|
}
|
|
2342
2342
|
);
|
|
2343
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-library", style:
|
|
2343
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-library", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
2344
2344
|
title !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-library__heading", children: [
|
|
2345
2345
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-checklist-template-library__heading-copy", children: [
|
|
2346
2346
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-checklist-template-library__title", children: title }),
|
|
@@ -2635,8 +2635,8 @@ function BuilderHeader({
|
|
|
2635
2635
|
pending,
|
|
2636
2636
|
style
|
|
2637
2637
|
}) {
|
|
2638
|
-
const { t } =
|
|
2639
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-form-builder__header", style:
|
|
2638
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
2639
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-form-builder__header", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
2640
2640
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-form-builder__header-identity", children: [
|
|
2641
2641
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-form-builder__header-top", children: [
|
|
2642
2642
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2832,7 +2832,7 @@ var fallback = {
|
|
|
2832
2832
|
preview: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-form-builder__preview-unsupported", children: field.label }),
|
|
2833
2833
|
configFields: NoConfigFields
|
|
2834
2834
|
};
|
|
2835
|
-
var fieldRegistry =
|
|
2835
|
+
var fieldRegistry = chunk3N2EQ2KC_cjs.createRegistry({ fallback });
|
|
2836
2836
|
fieldRegistry.register("HEADING", {
|
|
2837
2837
|
preview: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-form-builder__preview-heading", children: field.label }),
|
|
2838
2838
|
configFields: NoConfigFields
|
|
@@ -3304,7 +3304,7 @@ fieldRegistry.register("ADDRESS", {
|
|
|
3304
3304
|
}
|
|
3305
3305
|
});
|
|
3306
3306
|
function FieldEditDialog(props) {
|
|
3307
|
-
const { t } =
|
|
3307
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
3308
3308
|
const titleId = react.useId();
|
|
3309
3309
|
const { bindings, saving, onClose } = props;
|
|
3310
3310
|
const isEdit = props.mode === "edit";
|
|
@@ -3541,7 +3541,7 @@ function FieldEditDialog(props) {
|
|
|
3541
3541
|
);
|
|
3542
3542
|
}
|
|
3543
3543
|
function LivePreviewPane({ title, sections, fields }) {
|
|
3544
|
-
const { t } =
|
|
3544
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
3545
3545
|
const [frame, setFrame] = react.useState("desktop");
|
|
3546
3546
|
const [answers, setAnswers] = react.useState({});
|
|
3547
3547
|
function setAnswer(fieldId, value) {
|
|
@@ -3630,7 +3630,7 @@ function FieldRow({
|
|
|
3630
3630
|
onDragEnd,
|
|
3631
3631
|
style
|
|
3632
3632
|
}) {
|
|
3633
|
-
const { t } =
|
|
3633
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
3634
3634
|
const hasHelp = field.helpText !== null && field.helpText.length > 0;
|
|
3635
3635
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3636
3636
|
"li",
|
|
@@ -3638,7 +3638,7 @@ function FieldRow({
|
|
|
3638
3638
|
className: "kf-form-builder__field-row",
|
|
3639
3639
|
"data-dragging": dragging ? "true" : void 0,
|
|
3640
3640
|
"data-drag-over": dragOver ? "true" : void 0,
|
|
3641
|
-
style:
|
|
3641
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
3642
3642
|
onDragOver: (event) => {
|
|
3643
3643
|
event.preventDefault();
|
|
3644
3644
|
onDragOverRow();
|
|
@@ -3700,7 +3700,7 @@ function SectionBlock({
|
|
|
3700
3700
|
onOpenField,
|
|
3701
3701
|
onReorderField
|
|
3702
3702
|
}) {
|
|
3703
|
-
const { t } =
|
|
3703
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
3704
3704
|
const [title, setTitle] = react.useState(section.title ?? "");
|
|
3705
3705
|
const [draggedFieldId, setDraggedFieldId] = react.useState(void 0);
|
|
3706
3706
|
const [dragOverFieldId, setDragOverFieldId] = react.useState(void 0);
|
|
@@ -3834,7 +3834,7 @@ function draftFromForm(form) {
|
|
|
3834
3834
|
};
|
|
3835
3835
|
}
|
|
3836
3836
|
function TargetingSummary({ form }) {
|
|
3837
|
-
const { t } =
|
|
3837
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
3838
3838
|
const anchorLabel = (anchor) => t(`chrome.formBuilder.summary.anchor.${anchor}`);
|
|
3839
3839
|
const eventTypes = form.appliesToEventTypes.length === 0 ? t("chrome.formBuilder.summary.everyEventType") : form.appliesToEventTypes.map((type) => t(`chrome.formBuilder.targeting.eventType.${type}`)).join(" \xB7 ");
|
|
3840
3840
|
const tripModes = form.appliesToTripModes.length === 0 ? t("chrome.formBuilder.summary.everyTripMode") : form.appliesToTripModes.map((mode) => t(`chrome.formBuilder.targeting.tripMode.${mode}`)).join(" \xB7 ");
|
|
@@ -3895,7 +3895,7 @@ function TargetingSummary({ form }) {
|
|
|
3895
3895
|
] }, cell.key)) });
|
|
3896
3896
|
}
|
|
3897
3897
|
function TargetingPanel({ form, saving, onSave }) {
|
|
3898
|
-
const { t } =
|
|
3898
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
3899
3899
|
const [editing, setEditing] = react.useState(false);
|
|
3900
3900
|
const [submitted, setSubmitted] = react.useState(false);
|
|
3901
3901
|
const [draft, setDraft] = react.useState(() => draftFromForm(form));
|
|
@@ -4191,7 +4191,7 @@ function buildReorderSections(sections, fieldsBySection) {
|
|
|
4191
4191
|
}));
|
|
4192
4192
|
}
|
|
4193
4193
|
function FormBuilder({ formId, onBack, components, style }) {
|
|
4194
|
-
const { t } =
|
|
4194
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
4195
4195
|
const {
|
|
4196
4196
|
getForm,
|
|
4197
4197
|
patchForm,
|
|
@@ -4209,7 +4209,7 @@ function FormBuilder({ formId, onBack, components, style }) {
|
|
|
4209
4209
|
deleteField,
|
|
4210
4210
|
reorderForm,
|
|
4211
4211
|
listBindings
|
|
4212
|
-
} =
|
|
4212
|
+
} = chunkXBLAVNP3_cjs.useAgencyForms();
|
|
4213
4213
|
const [form, setForm] = react.useState(void 0);
|
|
4214
4214
|
const [loadFailed, setLoadFailed] = react.useState(false);
|
|
4215
4215
|
const [bindings, setBindings] = react.useState([]);
|
|
@@ -4420,7 +4420,7 @@ function FormBuilder({ formId, onBack, components, style }) {
|
|
|
4420
4420
|
}
|
|
4421
4421
|
}
|
|
4422
4422
|
if (loadFailed && form === void 0) {
|
|
4423
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-form-builder", style:
|
|
4423
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-form-builder", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-form-builder__status-block", role: "alert", children: [
|
|
4424
4424
|
/* @__PURE__ */ jsxRuntime.jsx(WarningIcon4, { className: "kf-form-builder__status-icon kf-form-builder__status-icon--danger" }),
|
|
4425
4425
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-form-builder__status-title", children: t("chrome.formBuilder.errorTitle") }),
|
|
4426
4426
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4435,13 +4435,13 @@ function FormBuilder({ formId, onBack, components, style }) {
|
|
|
4435
4435
|
] }) });
|
|
4436
4436
|
}
|
|
4437
4437
|
if (form === void 0) {
|
|
4438
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-form-builder", style:
|
|
4438
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-form-builder", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-form-builder__skeleton", "aria-hidden": "true", children: [
|
|
4439
4439
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-form-builder__skeleton-block" }),
|
|
4440
4440
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-form-builder__skeleton-block" }),
|
|
4441
4441
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-form-builder__skeleton-block" })
|
|
4442
4442
|
] }) });
|
|
4443
4443
|
}
|
|
4444
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-form-builder", style:
|
|
4444
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-form-builder", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
4445
4445
|
onBack !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: onBack, className: "kf-form-builder__back-link", children: [
|
|
4446
4446
|
/* @__PURE__ */ jsxRuntime.jsx(BackIcon, {}),
|
|
4447
4447
|
t("chrome.formBuilder.backToLibrary")
|
|
@@ -4574,6 +4574,11 @@ function FormBuilder({ formId, onBack, components, style }) {
|
|
|
4574
4574
|
] });
|
|
4575
4575
|
}
|
|
4576
4576
|
var KEY_PATTERN2 = /^[a-z][a-z0-9_]{0,59}$/;
|
|
4577
|
+
var CREATE_FAILURE_KEY = {
|
|
4578
|
+
CONFLICT_VERSION: "chrome.formsLibrary.create.failedDuplicate",
|
|
4579
|
+
BUSINESS_RULE_VIOLATION: "chrome.formsLibrary.create.failedDuplicate",
|
|
4580
|
+
VALIDATION_ERROR: "chrome.formsLibrary.create.failedInvalid"
|
|
4581
|
+
};
|
|
4577
4582
|
function slugifyFormKey(title) {
|
|
4578
4583
|
const slug = title.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 60);
|
|
4579
4584
|
return /^[a-z]/.test(slug) ? slug : `f_${slug}`.slice(0, 60);
|
|
@@ -4590,13 +4595,14 @@ var AUDIENCE_LABEL_KEY2 = {
|
|
|
4590
4595
|
MANAGER: "chrome.formsLibrary.audience.manager"
|
|
4591
4596
|
};
|
|
4592
4597
|
function CreateFormSheet({ onSubmit, onClose }) {
|
|
4593
|
-
const { t } =
|
|
4598
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
4594
4599
|
const titleId = react.useId();
|
|
4595
4600
|
const [locale, setLocale] = react.useState("en");
|
|
4596
4601
|
const [title, setTitle] = react.useState("");
|
|
4597
4602
|
const [phase, setPhase] = react.useState("PRE_DEPARTURE");
|
|
4598
4603
|
const [audience, setAudience] = react.useState("TRAVELLER");
|
|
4599
4604
|
const [pending, setPending] = react.useState(false);
|
|
4605
|
+
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
4600
4606
|
const trimmedTitle = title.trim();
|
|
4601
4607
|
const generatedKey = slugifyFormKey(trimmedTitle);
|
|
4602
4608
|
const keyValid = KEY_PATTERN2.test(generatedKey);
|
|
@@ -4606,6 +4612,7 @@ function CreateFormSheet({ onSubmit, onClose }) {
|
|
|
4606
4612
|
return;
|
|
4607
4613
|
}
|
|
4608
4614
|
setPending(true);
|
|
4615
|
+
setErrorCode(void 0);
|
|
4609
4616
|
try {
|
|
4610
4617
|
await onSubmit({
|
|
4611
4618
|
key: generatedKey,
|
|
@@ -4615,6 +4622,8 @@ function CreateFormSheet({ onSubmit, onClose }) {
|
|
|
4615
4622
|
audience
|
|
4616
4623
|
});
|
|
4617
4624
|
onClose();
|
|
4625
|
+
} catch (error) {
|
|
4626
|
+
setErrorCode(chunkA7C74SJT_cjs.classifyError(error).code ?? "unknown");
|
|
4618
4627
|
} finally {
|
|
4619
4628
|
setPending(false);
|
|
4620
4629
|
}
|
|
@@ -4626,15 +4635,25 @@ function CreateFormSheet({ onSubmit, onClose }) {
|
|
|
4626
4635
|
title: t("chrome.formsLibrary.create.title"),
|
|
4627
4636
|
onClose,
|
|
4628
4637
|
closeLabel: t("chrome.close"),
|
|
4629
|
-
footer:
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
+
footer: (
|
|
4639
|
+
// A column, because this sheet's submit is a full-width button — the
|
|
4640
|
+
// shared footer is a flex ROW, so an error beside it would squeeze
|
|
4641
|
+
// both. Stacked, the reason sits directly above the control it
|
|
4642
|
+
// explains.
|
|
4643
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-forms-library__sheet-actions", children: [
|
|
4644
|
+
errorCode === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-forms-library__sheet-error", role: "alert", children: t(CREATE_FAILURE_KEY[errorCode] ?? "chrome.formsLibrary.create.failed") }),
|
|
4645
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4646
|
+
"button",
|
|
4647
|
+
{
|
|
4648
|
+
type: "button",
|
|
4649
|
+
className: "kf-forms-library__sheet-submit",
|
|
4650
|
+
disabled: !canSubmit || pending,
|
|
4651
|
+
onClick: () => void handleSubmit(),
|
|
4652
|
+
children: pending ? t("chrome.formsLibrary.create.submitting") : t("chrome.formsLibrary.create.submit")
|
|
4653
|
+
}
|
|
4654
|
+
),
|
|
4655
|
+
canSubmit || pending ? null : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-forms-library__hint-copy", children: t("chrome.formsLibrary.create.needsTitle") })
|
|
4656
|
+
] })
|
|
4638
4657
|
),
|
|
4639
4658
|
children: [
|
|
4640
4659
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-forms-library__field-label", children: t("chrome.formsLibrary.create.titleLabel") }),
|
|
@@ -4792,7 +4811,7 @@ function formatDate2(iso) {
|
|
|
4792
4811
|
});
|
|
4793
4812
|
}
|
|
4794
4813
|
function FormRow({ form, selected, onSelect, style }) {
|
|
4795
|
-
const { t } =
|
|
4814
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
4796
4815
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4797
4816
|
"tr",
|
|
4798
4817
|
{
|
|
@@ -4800,7 +4819,7 @@ function FormRow({ form, selected, onSelect, style }) {
|
|
|
4800
4819
|
className: "kf-forms-library__table-row",
|
|
4801
4820
|
"data-selectable": onSelect !== void 0 ? "true" : void 0,
|
|
4802
4821
|
"data-selected": selected === true ? "true" : void 0,
|
|
4803
|
-
style:
|
|
4822
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
4804
4823
|
children: [
|
|
4805
4824
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4806
4825
|
"td",
|
|
@@ -4856,7 +4875,7 @@ function FormsLibrarySkeleton() {
|
|
|
4856
4875
|
] }, rowIndex)) }) }) });
|
|
4857
4876
|
}
|
|
4858
4877
|
function CardHeading2({ count }) {
|
|
4859
|
-
const { t } =
|
|
4878
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
4860
4879
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-forms-library__card-title", children: t(
|
|
4861
4880
|
count === 1 ? "chrome.formsLibrary.countLabelOne" : "chrome.formsLibrary.countLabel"
|
|
4862
4881
|
).replace("{count}", String(count)) });
|
|
@@ -4871,7 +4890,7 @@ function StatusFilterBar({
|
|
|
4871
4890
|
active,
|
|
4872
4891
|
onChange
|
|
4873
4892
|
}) {
|
|
4874
|
-
const { t } =
|
|
4893
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
4875
4894
|
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "kf-forms-library__filter-bar", children: [
|
|
4876
4895
|
/* @__PURE__ */ jsxRuntime.jsx("legend", { className: "kf-visually-hidden", children: t("chrome.formsLibrary.filter.legend") }),
|
|
4877
4896
|
STATUS_FILTERS.map((filter) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4897,8 +4916,8 @@ function FormsLibrary({
|
|
|
4897
4916
|
components,
|
|
4898
4917
|
style
|
|
4899
4918
|
}) {
|
|
4900
|
-
const { t } =
|
|
4901
|
-
const { forms, loaded, lastFetchFailed, refresh, createForm } =
|
|
4919
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
4920
|
+
const { forms, loaded, lastFetchFailed, refresh, createForm } = chunkXBLAVNP3_cjs.useAgencyForms();
|
|
4902
4921
|
const isControlled = controlledCreating !== void 0 && onCreatingChange !== void 0;
|
|
4903
4922
|
const [internalCreating, setInternalCreating] = react.useState(false);
|
|
4904
4923
|
const creating = isControlled ? controlledCreating : internalCreating;
|
|
@@ -4909,7 +4928,7 @@ function FormsLibrary({
|
|
|
4909
4928
|
await createForm(input);
|
|
4910
4929
|
};
|
|
4911
4930
|
const visibleForms = statusFilter === "ALL" ? forms : forms.filter((form) => form.status === statusFilter);
|
|
4912
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-forms-library", style:
|
|
4931
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-forms-library", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
4913
4932
|
title !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-forms-library__heading", children: [
|
|
4914
4933
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-forms-library__title", children: title }),
|
|
4915
4934
|
subtitle !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-forms-library__subtitle", children: subtitle }) : null
|
|
@@ -4985,9 +5004,9 @@ function FormsAuthoringFlow({ initialFormId, style }) {
|
|
|
4985
5004
|
setSelectedFormId(void 0);
|
|
4986
5005
|
}
|
|
4987
5006
|
if (selectedFormId === void 0) {
|
|
4988
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-forms-authoring-flow", style:
|
|
5007
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-forms-authoring-flow", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsx(FormsLibrary, { onSelectForm: handleSelect }) });
|
|
4989
5008
|
}
|
|
4990
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-forms-authoring-flow", style:
|
|
5009
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-forms-authoring-flow", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsx(FormBuilder, { formId: selectedFormId, onBack: handleBack }) });
|
|
4991
5010
|
}
|
|
4992
5011
|
function SearchIcon(props) {
|
|
4993
5012
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5138,7 +5157,7 @@ function AdminAvatar({
|
|
|
5138
5157
|
className: "kf-admin-shared-patterns-avatar",
|
|
5139
5158
|
"data-size": size,
|
|
5140
5159
|
"aria-hidden": "true",
|
|
5141
|
-
style:
|
|
5160
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style, {
|
|
5142
5161
|
"--kf-admin-shared-patterns-avatar-computed-size": SIZE_VAR[size],
|
|
5143
5162
|
"--kf-admin-shared-patterns-avatar-computed-bg": `var(--kf-color-avatar-${step})`
|
|
5144
5163
|
}),
|
|
@@ -5158,7 +5177,7 @@ function ManagerResultRow({
|
|
|
5158
5177
|
onSelect,
|
|
5159
5178
|
style
|
|
5160
5179
|
}) {
|
|
5161
|
-
const { t } =
|
|
5180
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5162
5181
|
const initials = initialsFromName(manager.fullName);
|
|
5163
5182
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5164
5183
|
"tr",
|
|
@@ -5166,7 +5185,7 @@ function ManagerResultRow({
|
|
|
5166
5185
|
role: "row",
|
|
5167
5186
|
className: "kf-manager-directory-flow__table-row",
|
|
5168
5187
|
"data-selectable": onSelect !== void 0 ? "true" : void 0,
|
|
5169
|
-
style:
|
|
5188
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
5170
5189
|
children: [
|
|
5171
5190
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5172
5191
|
"td",
|
|
@@ -5275,8 +5294,8 @@ function ManagerResultsListBody({
|
|
|
5275
5294
|
onCountChange,
|
|
5276
5295
|
onRetry
|
|
5277
5296
|
}) {
|
|
5278
|
-
const { t } =
|
|
5279
|
-
const directories =
|
|
5297
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5298
|
+
const directories = chunkXBLAVNP3_cjs.useDirectories();
|
|
5280
5299
|
const [errorMessage, setErrorMessage] = react.useState(void 0);
|
|
5281
5300
|
const [hasSettled, setHasSettled] = react.useState(false);
|
|
5282
5301
|
const ManagerRow = ManagerResultRowComponent ?? ManagerResultRow;
|
|
@@ -5287,7 +5306,7 @@ function ManagerResultsListBody({
|
|
|
5287
5306
|
setErrorMessage(void 0);
|
|
5288
5307
|
return page;
|
|
5289
5308
|
} catch (error) {
|
|
5290
|
-
setErrorMessage(
|
|
5309
|
+
setErrorMessage(chunkA7C74SJT_cjs.classifyError(error).code ?? "unknown");
|
|
5291
5310
|
return { rows: [], nextCursor: void 0 };
|
|
5292
5311
|
} finally {
|
|
5293
5312
|
setHasSettled(true);
|
|
@@ -5295,7 +5314,7 @@ function ManagerResultsListBody({
|
|
|
5295
5314
|
},
|
|
5296
5315
|
[directories, filters]
|
|
5297
5316
|
);
|
|
5298
|
-
const { rows, hasNext, hasPrev, loadNext, loadPrev } =
|
|
5317
|
+
const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkXBLAVNP3_cjs.usePaginatedList(fetch);
|
|
5299
5318
|
const isLoading = !hasSettled;
|
|
5300
5319
|
const reportedCount = isLoading || errorMessage !== void 0 ? void 0 : rows.length;
|
|
5301
5320
|
react.useEffect(() => {
|
|
@@ -5392,7 +5411,7 @@ function ManagerSearchInput({
|
|
|
5392
5411
|
debounceMs,
|
|
5393
5412
|
onDebouncedChange
|
|
5394
5413
|
}) {
|
|
5395
|
-
const { t } =
|
|
5414
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5396
5415
|
const [value, setValue] = react.useState("");
|
|
5397
5416
|
react.useEffect(() => {
|
|
5398
5417
|
const timer = setTimeout(() => onDebouncedChange(value), debounceMs);
|
|
@@ -5431,12 +5450,12 @@ function ManagerDirectoryFlow({
|
|
|
5431
5450
|
components,
|
|
5432
5451
|
style
|
|
5433
5452
|
}) {
|
|
5434
|
-
const { t } =
|
|
5453
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5435
5454
|
const [query, setQuery] = react.useState("");
|
|
5436
5455
|
const [count, setCount] = react.useState(void 0);
|
|
5437
5456
|
const trimmedQuery = query.trim();
|
|
5438
5457
|
const handleCountChange = react.useCallback((next) => setCount(next), []);
|
|
5439
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-manager-directory-flow", style:
|
|
5458
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-manager-directory-flow", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
5440
5459
|
title !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-manager-directory-flow__heading", children: [
|
|
5441
5460
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-manager-directory-flow__title", children: title }),
|
|
5442
5461
|
subtitle !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-manager-directory-flow__subtitle", children: subtitle }) : null
|
|
@@ -5508,7 +5527,7 @@ function formatDate3(iso) {
|
|
|
5508
5527
|
return new Date(iso).toLocaleDateString("en-GB", { day: "2-digit", month: "short" });
|
|
5509
5528
|
}
|
|
5510
5529
|
function ManagerAssignmentsCard({ trips }) {
|
|
5511
|
-
const { t } =
|
|
5530
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5512
5531
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-manager-profile-section__card", children: [
|
|
5513
5532
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-manager-profile-section__card-head", children: [
|
|
5514
5533
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-manager-profile-section__card-title", children: t("chrome.managerProfileSection.trips.title") }),
|
|
@@ -5572,7 +5591,7 @@ function HeroProfileHeader({
|
|
|
5572
5591
|
glowTone,
|
|
5573
5592
|
style
|
|
5574
5593
|
}) {
|
|
5575
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-shared-patterns-hero", "data-glow": glowTone, style:
|
|
5594
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-shared-patterns-hero", "data-glow": glowTone, style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
5576
5595
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-admin-shared-patterns-hero-glow", "aria-hidden": "true" }),
|
|
5577
5596
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-shared-patterns-hero-row", children: [
|
|
5578
5597
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-admin-shared-patterns-hero-avatar", "aria-hidden": "true", children: avatarInitials }),
|
|
@@ -5605,7 +5624,7 @@ function initialsFromName2(name) {
|
|
|
5605
5624
|
return `${first}${last}`.toUpperCase();
|
|
5606
5625
|
}
|
|
5607
5626
|
function ManagerProfileHero({ profile, onBack }) {
|
|
5608
|
-
const { t } =
|
|
5627
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5609
5628
|
const initials = initialsFromName2(profile.fullName);
|
|
5610
5629
|
const stats = [
|
|
5611
5630
|
{ key: "trips", label: t("chrome.managerProfileSection.hero.trips"), value: profile.tripCount },
|
|
@@ -5664,12 +5683,12 @@ function ManagerProfileSection({
|
|
|
5664
5683
|
components,
|
|
5665
5684
|
style
|
|
5666
5685
|
}) {
|
|
5667
|
-
const { t } =
|
|
5668
|
-
const { read, readFailed, refresh } =
|
|
5686
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5687
|
+
const { read, readFailed, refresh } = chunkXBLAVNP3_cjs.useAgencyManagerProfile(managerRef);
|
|
5669
5688
|
const Hero = components?.Hero ?? ManagerProfileHero;
|
|
5670
5689
|
const AssignmentsCard = components?.AssignmentsCard ?? ManagerAssignmentsCard;
|
|
5671
5690
|
if (readFailed) {
|
|
5672
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-manager-profile-section", style:
|
|
5691
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-manager-profile-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-manager-profile-section__status-block", role: "alert", children: [
|
|
5673
5692
|
/* @__PURE__ */ jsxRuntime.jsx(WarningIcon7, { className: "kf-manager-profile-section__status-icon kf-manager-profile-section__status-icon--danger" }),
|
|
5674
5693
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-manager-profile-section__status-title", children: t("chrome.managerProfileSection.errorTitle") }),
|
|
5675
5694
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-manager-profile-section__status-body", children: t("chrome.managerProfileSection.errorBody") }),
|
|
@@ -5685,9 +5704,9 @@ function ManagerProfileSection({
|
|
|
5685
5704
|
] }) });
|
|
5686
5705
|
}
|
|
5687
5706
|
if (read === void 0) {
|
|
5688
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-manager-profile-section", style:
|
|
5707
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-manager-profile-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsx(ManagerProfileSkeleton, {}) });
|
|
5689
5708
|
}
|
|
5690
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-manager-profile-section", style:
|
|
5709
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-manager-profile-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
5691
5710
|
/* @__PURE__ */ jsxRuntime.jsx(Hero, { profile: read, onBack }),
|
|
5692
5711
|
/* @__PURE__ */ jsxRuntime.jsx(AssignmentsCard, { trips: read.trips })
|
|
5693
5712
|
] });
|
|
@@ -5714,7 +5733,7 @@ function TemplateAuthoringFlow({
|
|
|
5714
5733
|
initialTemplateId,
|
|
5715
5734
|
style
|
|
5716
5735
|
}) {
|
|
5717
|
-
const { t } =
|
|
5736
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5718
5737
|
const [selectedTemplateId, setSelectedTemplateId] = react.useState(
|
|
5719
5738
|
initialTemplateId
|
|
5720
5739
|
);
|
|
@@ -5725,9 +5744,9 @@ function TemplateAuthoringFlow({
|
|
|
5725
5744
|
setSelectedTemplateId(void 0);
|
|
5726
5745
|
}
|
|
5727
5746
|
if (selectedTemplateId === void 0) {
|
|
5728
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-template-authoring-flow", style:
|
|
5747
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-template-authoring-flow", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsx(ChecklistTemplateLibrary, { onSelectTemplate: handleSelect }) });
|
|
5729
5748
|
}
|
|
5730
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-template-authoring-flow", style:
|
|
5749
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-template-authoring-flow", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
5731
5750
|
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: handleBack, className: "kf-template-authoring-flow__back-link", children: [
|
|
5732
5751
|
/* @__PURE__ */ jsxRuntime.jsx(BackIcon3, {}),
|
|
5733
5752
|
t("chrome.templateAuthoringFlow.backToLibrary")
|
|
@@ -5736,8 +5755,8 @@ function TemplateAuthoringFlow({
|
|
|
5736
5755
|
] });
|
|
5737
5756
|
}
|
|
5738
5757
|
function AddTravellerModal({ onClose, onCreated }) {
|
|
5739
|
-
const { t } =
|
|
5740
|
-
const directories =
|
|
5758
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5759
|
+
const directories = chunkXBLAVNP3_cjs.useDirectories();
|
|
5741
5760
|
const titleId = react.useId();
|
|
5742
5761
|
const [fullName, setFullName] = react.useState("");
|
|
5743
5762
|
const [phone, setPhone] = react.useState("");
|
|
@@ -5761,7 +5780,7 @@ function AddTravellerModal({ onClose, onCreated }) {
|
|
|
5761
5780
|
});
|
|
5762
5781
|
onCreated(created);
|
|
5763
5782
|
} catch (error) {
|
|
5764
|
-
setErrorMessage(
|
|
5783
|
+
setErrorMessage(chunkA7C74SJT_cjs.classifyError(error).code ?? "unknown");
|
|
5765
5784
|
} finally {
|
|
5766
5785
|
setIsSubmitting(false);
|
|
5767
5786
|
}
|
|
@@ -5975,7 +5994,7 @@ function TravellerResultRow({
|
|
|
5975
5994
|
onSelect,
|
|
5976
5995
|
style
|
|
5977
5996
|
}) {
|
|
5978
|
-
const { t } =
|
|
5997
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
5979
5998
|
const initials = initialsFromName3(traveller.fullName);
|
|
5980
5999
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5981
6000
|
"tr",
|
|
@@ -5983,7 +6002,7 @@ function TravellerResultRow({
|
|
|
5983
6002
|
role: "row",
|
|
5984
6003
|
className: "kf-traveller-directory__table-row",
|
|
5985
6004
|
"data-selectable": onSelect !== void 0 ? "true" : void 0,
|
|
5986
|
-
style:
|
|
6005
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
5987
6006
|
children: [
|
|
5988
6007
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5989
6008
|
"td",
|
|
@@ -6111,8 +6130,8 @@ function TravellerResultsListBody({
|
|
|
6111
6130
|
onCountChange,
|
|
6112
6131
|
onRetry
|
|
6113
6132
|
}) {
|
|
6114
|
-
const { t } =
|
|
6115
|
-
const directories =
|
|
6133
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6134
|
+
const directories = chunkXBLAVNP3_cjs.useDirectories();
|
|
6116
6135
|
const [errorMessage, setErrorMessage] = react.useState(void 0);
|
|
6117
6136
|
const [hasSettled, setHasSettled] = react.useState(false);
|
|
6118
6137
|
const fetch = react.useCallback(
|
|
@@ -6123,7 +6142,7 @@ function TravellerResultsListBody({
|
|
|
6123
6142
|
setErrorMessage(void 0);
|
|
6124
6143
|
return page;
|
|
6125
6144
|
} catch (error) {
|
|
6126
|
-
setErrorMessage(
|
|
6145
|
+
setErrorMessage(chunkA7C74SJT_cjs.classifyError(error).code ?? "unknown");
|
|
6127
6146
|
return { rows: [], nextCursor: void 0 };
|
|
6128
6147
|
} finally {
|
|
6129
6148
|
setHasSettled(true);
|
|
@@ -6131,7 +6150,7 @@ function TravellerResultsListBody({
|
|
|
6131
6150
|
},
|
|
6132
6151
|
[directories, query]
|
|
6133
6152
|
);
|
|
6134
|
-
const { rows, hasNext, hasPrev, loadNext, loadPrev } =
|
|
6153
|
+
const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkXBLAVNP3_cjs.usePaginatedList(fetch);
|
|
6135
6154
|
const isLoading = !hasSettled;
|
|
6136
6155
|
const reportedCount = isLoading || errorMessage !== void 0 ? void 0 : rows.length;
|
|
6137
6156
|
react.useEffect(() => {
|
|
@@ -6226,7 +6245,7 @@ function TravellerSearchInput({
|
|
|
6226
6245
|
debounceMs,
|
|
6227
6246
|
onDebouncedChange
|
|
6228
6247
|
}) {
|
|
6229
|
-
const { t } =
|
|
6248
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6230
6249
|
const [value, setValue] = react.useState("");
|
|
6231
6250
|
react.useEffect(() => {
|
|
6232
6251
|
const timer = setTimeout(() => onDebouncedChange(value), debounceMs);
|
|
@@ -6266,13 +6285,13 @@ function TravellerSearchBox({
|
|
|
6266
6285
|
trailingAction,
|
|
6267
6286
|
style
|
|
6268
6287
|
}) {
|
|
6269
|
-
const { t } =
|
|
6288
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6270
6289
|
const [query, setQuery] = react.useState("");
|
|
6271
6290
|
const [count, setCount] = react.useState(void 0);
|
|
6272
6291
|
const trimmed = query.trim();
|
|
6273
6292
|
const handleCountChange = react.useCallback((next) => setCount(next), []);
|
|
6274
6293
|
const isBelowFloor = minQueryLength > 0 && trimmed.length < minQueryLength;
|
|
6275
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-directory__search-box", style:
|
|
6294
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-directory__search-box", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
6276
6295
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-directory__search-box-input-row", children: [
|
|
6277
6296
|
/* @__PURE__ */ jsxRuntime.jsx(TravellerSearchInput, { debounceMs, onDebouncedChange: setQuery }),
|
|
6278
6297
|
count !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-traveller-directory__count", children: t(
|
|
@@ -6304,7 +6323,7 @@ function TravellerDirectoryFlow({
|
|
|
6304
6323
|
components,
|
|
6305
6324
|
style
|
|
6306
6325
|
}) {
|
|
6307
|
-
const { t } =
|
|
6326
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6308
6327
|
const [uncontrolledOpen, setUncontrolledOpen] = react.useState(false);
|
|
6309
6328
|
const isControlled = adding !== void 0 && onAddingChange !== void 0;
|
|
6310
6329
|
const isAddModalOpen = isControlled ? adding : uncontrolledOpen;
|
|
@@ -6327,7 +6346,7 @@ function TravellerDirectoryFlow({
|
|
|
6327
6346
|
);
|
|
6328
6347
|
const SearchBox = components?.TravellerSearchBox ?? TravellerSearchBox;
|
|
6329
6348
|
const AddModal = components?.AddTravellerModal ?? AddTravellerModal;
|
|
6330
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-directory-flow", style:
|
|
6349
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-directory-flow", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
6331
6350
|
title !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-directory-flow__heading", children: [
|
|
6332
6351
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-traveller-directory-flow__title", children: title }),
|
|
6333
6352
|
subtitle !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-traveller-directory-flow__subtitle", children: subtitle }) : null
|
|
@@ -6353,7 +6372,7 @@ function TravellerDirectoryFlow({
|
|
|
6353
6372
|
] });
|
|
6354
6373
|
}
|
|
6355
6374
|
function useAgencyTravellerProfile(travellerRef) {
|
|
6356
|
-
const client =
|
|
6375
|
+
const client = chunk3N2EQ2KC_cjs.useKaafilClient();
|
|
6357
6376
|
const [read, setRead] = react.useState(void 0);
|
|
6358
6377
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
6359
6378
|
const refresh = react.useCallback(async () => {
|
|
@@ -6410,7 +6429,7 @@ function formatMinor(minor, currency) {
|
|
|
6410
6429
|
}).format(minor / 100);
|
|
6411
6430
|
}
|
|
6412
6431
|
function TravellerLifetimeCard({ lifetime }) {
|
|
6413
|
-
const { t } =
|
|
6432
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6414
6433
|
if (lifetime.currency === null) {
|
|
6415
6434
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-traveller-profile-section__card", children: [
|
|
6416
6435
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-profile-section__card-head", children: [
|
|
@@ -6458,7 +6477,7 @@ function formatTimestamp(iso) {
|
|
|
6458
6477
|
});
|
|
6459
6478
|
}
|
|
6460
6479
|
function TravellerNotesList({ notes }) {
|
|
6461
|
-
const { t } =
|
|
6480
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6462
6481
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-traveller-profile-section__card", children: [
|
|
6463
6482
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-profile-section__card-head", children: [
|
|
6464
6483
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-traveller-profile-section__card-title", children: t("chrome.travellerProfileSection.notes.title") }),
|
|
@@ -6504,7 +6523,7 @@ function formatDateOfBirth(iso) {
|
|
|
6504
6523
|
});
|
|
6505
6524
|
}
|
|
6506
6525
|
function TravellerPersonalCard({ profile }) {
|
|
6507
|
-
const { t } =
|
|
6526
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6508
6527
|
const p = profile.profile;
|
|
6509
6528
|
const dob = formatDateOfBirth(p.dateOfBirth);
|
|
6510
6529
|
const email = p.email ?? profile.email;
|
|
@@ -6619,7 +6638,7 @@ function formatMinor2(minor, currency) {
|
|
|
6619
6638
|
}).format(minor / 100);
|
|
6620
6639
|
}
|
|
6621
6640
|
function TravellerProfileHero({ profile, onBack }) {
|
|
6622
|
-
const { t } =
|
|
6641
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6623
6642
|
const initials = initialsFromName4(profile.fullName);
|
|
6624
6643
|
const { lifetime } = profile;
|
|
6625
6644
|
const stats = lifetime.currency !== null ? [
|
|
@@ -6710,7 +6729,7 @@ function formatMinor3(minor, currency) {
|
|
|
6710
6729
|
}).format(minor / 100);
|
|
6711
6730
|
}
|
|
6712
6731
|
function TravellerTripHistoryTable({ trips }) {
|
|
6713
|
-
const { t } =
|
|
6732
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6714
6733
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-traveller-profile-section__card", children: [
|
|
6715
6734
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-profile-section__card-head", children: [
|
|
6716
6735
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-traveller-profile-section__card-title", children: t("chrome.travellerProfileSection.trips.title") }),
|
|
@@ -6761,7 +6780,7 @@ function TravellerProfileSection({
|
|
|
6761
6780
|
components,
|
|
6762
6781
|
style
|
|
6763
6782
|
}) {
|
|
6764
|
-
const { t } =
|
|
6783
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
6765
6784
|
const { read, readFailed, refresh } = useAgencyTravellerProfile(travellerRef);
|
|
6766
6785
|
const Hero = components?.Hero ?? TravellerProfileHero;
|
|
6767
6786
|
const PersonalCard = components?.PersonalCard ?? TravellerPersonalCard;
|
|
@@ -6769,7 +6788,7 @@ function TravellerProfileSection({
|
|
|
6769
6788
|
const TripHistoryTable = components?.TripHistoryTable ?? TravellerTripHistoryTable;
|
|
6770
6789
|
const NotesList = components?.NotesList ?? TravellerNotesList;
|
|
6771
6790
|
if (readFailed) {
|
|
6772
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-traveller-profile-section", style:
|
|
6791
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-traveller-profile-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-profile-section__status-block", role: "alert", children: [
|
|
6773
6792
|
/* @__PURE__ */ jsxRuntime.jsx(WarningIcon9, { className: "kf-traveller-profile-section__status-icon kf-traveller-profile-section__status-icon--danger" }),
|
|
6774
6793
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-traveller-profile-section__status-title", children: t("chrome.travellerProfileSection.errorTitle") }),
|
|
6775
6794
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-traveller-profile-section__status-body", children: t("chrome.travellerProfileSection.errorBody") }),
|
|
@@ -6785,9 +6804,9 @@ function TravellerProfileSection({
|
|
|
6785
6804
|
] }) });
|
|
6786
6805
|
}
|
|
6787
6806
|
if (read === void 0) {
|
|
6788
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-traveller-profile-section", style:
|
|
6807
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-traveller-profile-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsx(TravellerProfileSkeleton, {}) });
|
|
6789
6808
|
}
|
|
6790
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-profile-section", style:
|
|
6809
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-profile-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
6791
6810
|
/* @__PURE__ */ jsxRuntime.jsx(Hero, { profile: read, onBack }),
|
|
6792
6811
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-profile-section__body", children: [
|
|
6793
6812
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-traveller-profile-section__column", children: [
|
|
@@ -6879,7 +6898,7 @@ function ToggleSwitch({
|
|
|
6879
6898
|
disabled,
|
|
6880
6899
|
className: "kf-admin-shared-patterns-toggle-row",
|
|
6881
6900
|
onClick: () => onChange(!checked),
|
|
6882
|
-
style:
|
|
6901
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
6883
6902
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6884
6903
|
"span",
|
|
6885
6904
|
{
|
|
@@ -7317,7 +7336,7 @@ function TriggerDetailPanel({
|
|
|
7317
7336
|
style
|
|
7318
7337
|
}) {
|
|
7319
7338
|
const [dialogOpen, setDialogOpen] = react.useState(false);
|
|
7320
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trigger-template-editor__detail", style:
|
|
7339
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trigger-template-editor__detail", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
7321
7340
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trigger-template-editor__detail-head", children: [
|
|
7322
7341
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trigger-template-editor__detail-eyebrow", children: t("chrome.triggerTemplateEditor.selected") }),
|
|
7323
7342
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7401,8 +7420,8 @@ function TriggerTemplateEditor({
|
|
|
7401
7420
|
onTriggerPatched,
|
|
7402
7421
|
style
|
|
7403
7422
|
}) {
|
|
7404
|
-
const { t } =
|
|
7405
|
-
const { triggers, loaded, lastFetchFailed, refresh, patchTrigger } =
|
|
7423
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7424
|
+
const { triggers, loaded, lastFetchFailed, refresh, patchTrigger } = chunkXBLAVNP3_cjs.useAgencyJourneyTriggers();
|
|
7406
7425
|
const [savingId, setSavingId] = react.useState(void 0);
|
|
7407
7426
|
const [selectedId, setSelectedId] = react.useState(void 0);
|
|
7408
7427
|
const filtered = tripModeFilter === void 0 ? triggers : triggers.filter((trigger) => trigger.tripMode === tripModeFilter);
|
|
@@ -7437,7 +7456,7 @@ function TriggerTemplateEditor({
|
|
|
7437
7456
|
setSavingId(void 0);
|
|
7438
7457
|
}
|
|
7439
7458
|
}
|
|
7440
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trigger-template-editor", style:
|
|
7459
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trigger-template-editor", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
7441
7460
|
title !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trigger-template-editor__heading", children: [
|
|
7442
7461
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-trigger-template-editor__title", children: title }),
|
|
7443
7462
|
subtitle !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trigger-template-editor__subtitle", children: subtitle }) : null
|
|
@@ -7585,14 +7604,14 @@ function BookingsSkeleton() {
|
|
|
7585
7604
|
] }, id)) });
|
|
7586
7605
|
}
|
|
7587
7606
|
function BookingsEmpty() {
|
|
7588
|
-
const { t } =
|
|
7607
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7589
7608
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-bookings-section__state", children: [
|
|
7590
7609
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-bookings-section__state-title", children: t("chrome.tripBookings.emptyTitle") }),
|
|
7591
7610
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-bookings-section__state-body", children: t("chrome.tripBookings.emptyBody") })
|
|
7592
7611
|
] });
|
|
7593
7612
|
}
|
|
7594
7613
|
function BookingsFailed({ onRetry }) {
|
|
7595
|
-
const { t } =
|
|
7614
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7596
7615
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-bookings-section__state", role: "alert", children: [
|
|
7597
7616
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-bookings-section__state-title", children: t("chrome.tripBookings.failedTitle") }),
|
|
7598
7617
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-bookings-section__state-body", children: t("chrome.tripBookings.failedBody") }),
|
|
@@ -7600,7 +7619,7 @@ function BookingsFailed({ onRetry }) {
|
|
|
7600
7619
|
] });
|
|
7601
7620
|
}
|
|
7602
7621
|
function BookingsDark({ reason }) {
|
|
7603
|
-
const { t } =
|
|
7622
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7604
7623
|
if (reason === "mode") return null;
|
|
7605
7624
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-bookings-section__state", "data-dark": reason, children: [
|
|
7606
7625
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-bookings-section__state-title", children: t(
|
|
@@ -7645,8 +7664,8 @@ function TripBookingsSection({
|
|
|
7645
7664
|
onOpenDocuments,
|
|
7646
7665
|
style
|
|
7647
7666
|
}) {
|
|
7648
|
-
const { t } =
|
|
7649
|
-
const bookings =
|
|
7667
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7668
|
+
const bookings = chunkXBLAVNP3_cjs.useBookings(tripRef);
|
|
7650
7669
|
const ready = bookings.status === "ready" ? bookings : null;
|
|
7651
7670
|
const groups = react.useMemo(
|
|
7652
7671
|
() => ready === null ? [] : groupByKind(liveBookings(ready.bookings)),
|
|
@@ -7656,7 +7675,7 @@ function TripBookingsSection({
|
|
|
7656
7675
|
const unreadable = ready !== null && ready.syncedAt === void 0;
|
|
7657
7676
|
const refreshLive = ready?.refreshLive;
|
|
7658
7677
|
if (bookings.status === "dark") return /* @__PURE__ */ jsxRuntime.jsx(BookingsDark, { reason: bookings.reason });
|
|
7659
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-bookings-section", style:
|
|
7678
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-bookings-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
7660
7679
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-bookings-section__head", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-bookings-section__head-text", children: [
|
|
7661
7680
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-trip-bookings-section__title", children: t("chrome.tripBookings.panelLabel") }),
|
|
7662
7681
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-bookings-section__subtitle", children: t("chrome.tripBookings.subtitle").replace("{count}", String(total)) })
|
|
@@ -7728,7 +7747,7 @@ function LockIcon2() {
|
|
|
7728
7747
|
);
|
|
7729
7748
|
}
|
|
7730
7749
|
function CloseoutLockNotice({ whatKey }) {
|
|
7731
|
-
const { t } =
|
|
7750
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7732
7751
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-closeout-lock", role: "status", children: [
|
|
7733
7752
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-admin-closeout-lock__glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(LockIcon2, {}) }),
|
|
7734
7753
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-admin-closeout-lock__body", children: [
|
|
@@ -7832,7 +7851,7 @@ function ChecklistSkeleton() {
|
|
|
7832
7851
|
] }, column)) });
|
|
7833
7852
|
}
|
|
7834
7853
|
function ChecklistEmpty({ onPull }) {
|
|
7835
|
-
const { t } =
|
|
7854
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7836
7855
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-checklist-section__state", children: [
|
|
7837
7856
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-checklist-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(ChecklistIcon, {}) }),
|
|
7838
7857
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-checklist-section__state-title", children: t("chrome.tripChecklist.emptyTitle") }),
|
|
@@ -7841,7 +7860,7 @@ function ChecklistEmpty({ onPull }) {
|
|
|
7841
7860
|
] });
|
|
7842
7861
|
}
|
|
7843
7862
|
function ChecklistFailed({ onRetry }) {
|
|
7844
|
-
const { t } =
|
|
7863
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7845
7864
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-checklist-section__state", children: [
|
|
7846
7865
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-checklist-section__state-title", children: t("chrome.tripChecklist.failedTitle") }),
|
|
7847
7866
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-checklist-section__state-body", children: t("chrome.tripChecklist.failedBody") }),
|
|
@@ -7849,7 +7868,7 @@ function ChecklistFailed({ onRetry }) {
|
|
|
7849
7868
|
] });
|
|
7850
7869
|
}
|
|
7851
7870
|
function ChecklistDark({ reason }) {
|
|
7852
|
-
const { t } =
|
|
7871
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7853
7872
|
if (reason === "mode") return null;
|
|
7854
7873
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-checklist-section__state", "data-dark": reason, children: [
|
|
7855
7874
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-checklist-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(LockIcon3, {}) }),
|
|
@@ -7949,7 +7968,7 @@ function ItemDialog({
|
|
|
7949
7968
|
onClose,
|
|
7950
7969
|
onSubmit
|
|
7951
7970
|
}) {
|
|
7952
|
-
const { t } =
|
|
7971
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
7953
7972
|
const titleId = react.useId();
|
|
7954
7973
|
const [values, setValues] = react.useState(initial);
|
|
7955
7974
|
const [sectionChoice, setSectionChoice] = react.useState(
|
|
@@ -8146,7 +8165,7 @@ function ChecklistItemRow({
|
|
|
8146
8165
|
onToggle,
|
|
8147
8166
|
onEdit
|
|
8148
8167
|
}) {
|
|
8149
|
-
const { t } =
|
|
8168
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
8150
8169
|
const complete = item.status === "COMPLETE";
|
|
8151
8170
|
const day = dayOffsetLabel(item.dayOffset);
|
|
8152
8171
|
const actorKey = actorLabelKey(item.performedByKind);
|
|
@@ -8198,7 +8217,7 @@ function SectionCard2({
|
|
|
8198
8217
|
onAddToSection,
|
|
8199
8218
|
ItemRow: ItemRow2 = ChecklistItemRow
|
|
8200
8219
|
}) {
|
|
8201
|
-
const { t } =
|
|
8220
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
8202
8221
|
const openMandatory = items.filter((one) => one.isMandatory && one.status === "OPEN").length;
|
|
8203
8222
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-checklist-section__section", children: [
|
|
8204
8223
|
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "kf-trip-checklist-section__section-head", children: [
|
|
@@ -8252,7 +8271,7 @@ function PhasePanel({
|
|
|
8252
8271
|
onAddToPhase,
|
|
8253
8272
|
ItemRow: ItemRow2
|
|
8254
8273
|
}) {
|
|
8255
|
-
const { t } =
|
|
8274
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
8256
8275
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: sections.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-checklist-section__phase-empty", children: [
|
|
8257
8276
|
/* @__PURE__ */ jsxRuntime.jsx("p", { children: t("chrome.tripChecklist.phaseEmpty") }),
|
|
8258
8277
|
readOnly ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8288,7 +8307,7 @@ function PhaseSwitcher({
|
|
|
8288
8307
|
value,
|
|
8289
8308
|
onChange
|
|
8290
8309
|
}) {
|
|
8291
|
-
const { t } =
|
|
8310
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
8292
8311
|
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "kf-trip-checklist-section__segment", children: [
|
|
8293
8312
|
/* @__PURE__ */ jsxRuntime.jsx("legend", { className: "kf-visually-hidden", children: t("chrome.tripChecklist.phaseLabel") }),
|
|
8294
8313
|
OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8321,7 +8340,7 @@ function TemplatePickerDialog({
|
|
|
8321
8340
|
onClose,
|
|
8322
8341
|
onPull
|
|
8323
8342
|
}) {
|
|
8324
|
-
const { t } =
|
|
8343
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
8325
8344
|
const titleId = react.useId();
|
|
8326
8345
|
const [selectedId, setSelectedId] = react.useState(null);
|
|
8327
8346
|
const [mode, setMode] = react.useState("append");
|
|
@@ -8450,8 +8469,8 @@ function TripChecklistSection({
|
|
|
8450
8469
|
components,
|
|
8451
8470
|
style
|
|
8452
8471
|
}) {
|
|
8453
|
-
const { t } =
|
|
8454
|
-
const checklists =
|
|
8472
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
8473
|
+
const checklists = chunkA7C74SJT_cjs.useChecklists(tripRef);
|
|
8455
8474
|
const [overlay, setOverlay] = react.useState({ kind: "none" });
|
|
8456
8475
|
const [pending, setPending] = react.useState(false);
|
|
8457
8476
|
const [busyItemId, setBusyItemId] = react.useState(null);
|
|
@@ -8618,7 +8637,7 @@ function TripChecklistSection({
|
|
|
8618
8637
|
const inert = readOnly || locked;
|
|
8619
8638
|
const unreadable = aggregate?.lastFetchFailed === true && aggregate.loaded === false;
|
|
8620
8639
|
const percent = overallPercent(aggregate?.progress);
|
|
8621
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-checklist-section", style:
|
|
8640
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-checklist-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
8622
8641
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-checklist-section__head", children: [
|
|
8623
8642
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-checklist-section__head-text", children: [
|
|
8624
8643
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-trip-checklist-section__title", children: t("chrome.tripChecklist.panelLabel") }),
|
|
@@ -9007,7 +9026,7 @@ var STATUS_LABEL_KEY5 = {
|
|
|
9007
9026
|
CANCELLED: "chrome.tripDirectory.status.cancelled"
|
|
9008
9027
|
};
|
|
9009
9028
|
function TripRow({ trip, index, onOpen, style }) {
|
|
9010
|
-
const { t } =
|
|
9029
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9011
9030
|
const derived = deriveTripRow(trip, index);
|
|
9012
9031
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9013
9032
|
"tr",
|
|
@@ -9015,7 +9034,7 @@ function TripRow({ trip, index, onOpen, style }) {
|
|
|
9015
9034
|
role: "row",
|
|
9016
9035
|
className: "kf-trip-directory-flow__row",
|
|
9017
9036
|
"data-dimming": derived.dimming === "none" ? void 0 : derived.dimming,
|
|
9018
|
-
style:
|
|
9037
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
9019
9038
|
children: [
|
|
9020
9039
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9021
9040
|
"td",
|
|
@@ -9134,8 +9153,8 @@ function TripResultsListBody({
|
|
|
9134
9153
|
hasActiveFilter,
|
|
9135
9154
|
onRetry
|
|
9136
9155
|
}) {
|
|
9137
|
-
const { t } =
|
|
9138
|
-
const { makeTripsFetch } =
|
|
9156
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9157
|
+
const { makeTripsFetch } = chunkXBLAVNP3_cjs.useAgencyTrips();
|
|
9139
9158
|
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
9140
9159
|
const [hasSettled, setHasSettled] = react.useState(false);
|
|
9141
9160
|
const Row = TripRowComponent ?? TripRow;
|
|
@@ -9146,7 +9165,7 @@ function TripResultsListBody({
|
|
|
9146
9165
|
setErrorCode(void 0);
|
|
9147
9166
|
return page;
|
|
9148
9167
|
} catch (error) {
|
|
9149
|
-
setErrorCode(
|
|
9168
|
+
setErrorCode(chunkA7C74SJT_cjs.classifyError(error).code ?? "unknown");
|
|
9150
9169
|
return { rows: [], nextCursor: void 0 };
|
|
9151
9170
|
} finally {
|
|
9152
9171
|
setHasSettled(true);
|
|
@@ -9154,7 +9173,7 @@ function TripResultsListBody({
|
|
|
9154
9173
|
},
|
|
9155
9174
|
[makeTripsFetch, filters]
|
|
9156
9175
|
);
|
|
9157
|
-
const { rows, hasNext, hasPrev, loadNext, loadPrev } =
|
|
9176
|
+
const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkXBLAVNP3_cjs.usePaginatedList(fetch);
|
|
9158
9177
|
const isLoading = !hasSettled;
|
|
9159
9178
|
const reportedCount = isLoading || errorCode !== void 0 ? void 0 : rows.length;
|
|
9160
9179
|
react.useEffect(() => {
|
|
@@ -9256,7 +9275,7 @@ function TripSearchInput({
|
|
|
9256
9275
|
debounceMs,
|
|
9257
9276
|
onDebouncedChange
|
|
9258
9277
|
}) {
|
|
9259
|
-
const { t } =
|
|
9278
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9260
9279
|
const [value, setValue] = react.useState("");
|
|
9261
9280
|
react.useEffect(() => {
|
|
9262
9281
|
const timer = setTimeout(() => onDebouncedChange(value.trim()), debounceMs);
|
|
@@ -9326,7 +9345,7 @@ function TripDirectoryFlow({
|
|
|
9326
9345
|
components,
|
|
9327
9346
|
style
|
|
9328
9347
|
}) {
|
|
9329
|
-
const { t } =
|
|
9348
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9330
9349
|
const [eventType, setEventType] = react.useState(initialEventType ?? "TRIP");
|
|
9331
9350
|
const [segment, setSegment] = react.useState("all");
|
|
9332
9351
|
const [q, setQ] = react.useState("");
|
|
@@ -9346,7 +9365,7 @@ function TripDirectoryFlow({
|
|
|
9346
9365
|
);
|
|
9347
9366
|
const filterKey = react.useMemo(() => JSON.stringify(filters), [filters]);
|
|
9348
9367
|
const hasActiveFilter = segment !== "all" || q.length > 0 || status !== void 0;
|
|
9349
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-directory-flow", style:
|
|
9368
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-directory-flow", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
9350
9369
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-directory-flow__toolbar", children: [
|
|
9351
9370
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-directory-flow__toolbar-row", children: [
|
|
9352
9371
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9607,7 +9626,7 @@ function KindIcon({
|
|
|
9607
9626
|
return /* @__PURE__ */ jsxRuntime.jsx(GenericFileIcon, {});
|
|
9608
9627
|
}
|
|
9609
9628
|
function DocumentRow({ row, onOpen }) {
|
|
9610
|
-
const { t } =
|
|
9629
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9611
9630
|
const { file, spend } = row;
|
|
9612
9631
|
const purged = file.status === "purged";
|
|
9613
9632
|
const retention = retentionStateOf(file);
|
|
@@ -9668,7 +9687,7 @@ function DocumentsSkeleton() {
|
|
|
9668
9687
|
] }, id)) });
|
|
9669
9688
|
}
|
|
9670
9689
|
function DocumentsEmpty() {
|
|
9671
|
-
const { t } =
|
|
9690
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9672
9691
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-documents-section__state", children: [
|
|
9673
9692
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-documents-section__state-mark", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(EmptyDocumentsIcon, {}) }),
|
|
9674
9693
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-documents-section__state-title", children: t("chrome.tripDocuments.emptyTitle") }),
|
|
@@ -9676,7 +9695,7 @@ function DocumentsEmpty() {
|
|
|
9676
9695
|
] });
|
|
9677
9696
|
}
|
|
9678
9697
|
function DocumentsFailed({ onRetry }) {
|
|
9679
|
-
const { t } =
|
|
9698
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9680
9699
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-documents-section__state", role: "alert", children: [
|
|
9681
9700
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-documents-section__state-title", children: t("chrome.tripDocuments.failedTitle") }),
|
|
9682
9701
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-documents-section__state-body", children: t("chrome.tripDocuments.failedBody") }),
|
|
@@ -9684,7 +9703,7 @@ function DocumentsFailed({ onRetry }) {
|
|
|
9684
9703
|
] });
|
|
9685
9704
|
}
|
|
9686
9705
|
function DocumentsDark({ reason }) {
|
|
9687
|
-
const { t } =
|
|
9706
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9688
9707
|
if (reason === "mode") return null;
|
|
9689
9708
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-documents-section__state", "data-dark": reason, children: [
|
|
9690
9709
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-documents-section__state-title", children: t(
|
|
@@ -9707,7 +9726,7 @@ function DocumentViewer({
|
|
|
9707
9726
|
failed,
|
|
9708
9727
|
onClose
|
|
9709
9728
|
}) {
|
|
9710
|
-
const { t } =
|
|
9729
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9711
9730
|
const titleId = react.useId();
|
|
9712
9731
|
const { file } = row;
|
|
9713
9732
|
const classKey = retentionClassLabelKey(file.retentionClass);
|
|
@@ -9788,7 +9807,7 @@ function DocumentViewer({
|
|
|
9788
9807
|
);
|
|
9789
9808
|
}
|
|
9790
9809
|
function PurposeChips({ counts, value, onChange }) {
|
|
9791
|
-
const { t } =
|
|
9810
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9792
9811
|
const options = [
|
|
9793
9812
|
{
|
|
9794
9813
|
key: "all",
|
|
@@ -9858,7 +9877,7 @@ function UploadDialog({
|
|
|
9858
9877
|
onClose,
|
|
9859
9878
|
onSubmit
|
|
9860
9879
|
}) {
|
|
9861
|
-
const { t } =
|
|
9880
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
9862
9881
|
const titleId = react.useId();
|
|
9863
9882
|
const nameId = react.useId();
|
|
9864
9883
|
const fileId = react.useId();
|
|
@@ -10020,12 +10039,12 @@ function UploadDialog({
|
|
|
10020
10039
|
);
|
|
10021
10040
|
}
|
|
10022
10041
|
function TripDocumentsSection({ tripRef, style }) {
|
|
10023
|
-
const { t } =
|
|
10024
|
-
const files =
|
|
10025
|
-
const expenses =
|
|
10026
|
-
const bookings =
|
|
10027
|
-
const { listTripManifest } =
|
|
10028
|
-
const { statuses, loaded: capabilityLoaded } =
|
|
10042
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10043
|
+
const files = chunkA7C74SJT_cjs.useFiles({ tripRef });
|
|
10044
|
+
const expenses = chunkA7C74SJT_cjs.useExpenses(tripRef);
|
|
10045
|
+
const bookings = chunkXBLAVNP3_cjs.useBookings(tripRef);
|
|
10046
|
+
const { listTripManifest } = chunkXBLAVNP3_cjs.useDirectories();
|
|
10047
|
+
const { statuses, loaded: capabilityLoaded } = chunkXBLAVNP3_cjs.useCapabilityStatuses(tripRef);
|
|
10029
10048
|
const capability = statuses.get("files");
|
|
10030
10049
|
const [state, setState] = react.useState({ kind: "loading" });
|
|
10031
10050
|
const [purpose, setPurpose] = react.useState(null);
|
|
@@ -10172,7 +10191,7 @@ function TripDocumentsSection({ tripRef, style }) {
|
|
|
10172
10191
|
if (capabilityLoaded && capability === "mode-dark") return /* @__PURE__ */ jsxRuntime.jsx(DocumentsDark, { reason: "mode" });
|
|
10173
10192
|
if (capabilityLoaded && capability === "flag-dark") return /* @__PURE__ */ jsxRuntime.jsx(DocumentsDark, { reason: "flag" });
|
|
10174
10193
|
if (capabilityLoaded && capability === "data-dark") return /* @__PURE__ */ jsxRuntime.jsx(DocumentsDark, { reason: "data" });
|
|
10175
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-documents-section", style:
|
|
10194
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-documents-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
10176
10195
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-documents-section__head", children: [
|
|
10177
10196
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-documents-section__head-text", children: [
|
|
10178
10197
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-trip-documents-section__title", children: t("chrome.tripDocuments.panelLabel") }),
|
|
@@ -10461,7 +10480,7 @@ function ExpensesSkeleton() {
|
|
|
10461
10480
|
] }, id)) });
|
|
10462
10481
|
}
|
|
10463
10482
|
function ExpensesEmpty({ onLog }) {
|
|
10464
|
-
const { t } =
|
|
10483
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10465
10484
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-expenses-section__state", children: [
|
|
10466
10485
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-expenses-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(WalletIcon, {}) }),
|
|
10467
10486
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-expenses-section__state-title", children: t("chrome.tripExpenses.emptyTitle") }),
|
|
@@ -10470,7 +10489,7 @@ function ExpensesEmpty({ onLog }) {
|
|
|
10470
10489
|
] });
|
|
10471
10490
|
}
|
|
10472
10491
|
function ExpensesFailed({ onRetry }) {
|
|
10473
|
-
const { t } =
|
|
10492
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10474
10493
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-expenses-section__state", role: "alert", children: [
|
|
10475
10494
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-expenses-section__state-title", children: t("chrome.tripExpenses.failedTitle") }),
|
|
10476
10495
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-expenses-section__state-body", children: t("chrome.tripExpenses.failedBody") }),
|
|
@@ -10478,7 +10497,7 @@ function ExpensesFailed({ onRetry }) {
|
|
|
10478
10497
|
] });
|
|
10479
10498
|
}
|
|
10480
10499
|
function ExpensesDark({ reason }) {
|
|
10481
|
-
const { t } =
|
|
10500
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10482
10501
|
if (reason === "mode") {
|
|
10483
10502
|
return null;
|
|
10484
10503
|
}
|
|
@@ -10499,7 +10518,7 @@ function ExpensesTable({
|
|
|
10499
10518
|
onVoid,
|
|
10500
10519
|
onViewReceipt
|
|
10501
10520
|
}) {
|
|
10502
|
-
const { t } =
|
|
10521
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10503
10522
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-expenses-section__table-wrap", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "kf-trip-expenses-section__table", children: [
|
|
10504
10523
|
/* @__PURE__ */ jsxRuntime.jsx("caption", { className: "kf-visually-hidden", children: t("chrome.tripExpenses.tableCaption") }),
|
|
10505
10524
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
@@ -10559,7 +10578,7 @@ function LogExpenseDialog({
|
|
|
10559
10578
|
onClose,
|
|
10560
10579
|
onSubmit
|
|
10561
10580
|
}) {
|
|
10562
|
-
const { t } =
|
|
10581
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10563
10582
|
const titleId = react.useId();
|
|
10564
10583
|
const [category, setCategory] = react.useState("MISC");
|
|
10565
10584
|
const [amount, setAmount] = react.useState("");
|
|
@@ -10722,9 +10741,9 @@ function ReceiptDialog({
|
|
|
10722
10741
|
description,
|
|
10723
10742
|
onClose
|
|
10724
10743
|
}) {
|
|
10725
|
-
const { t } =
|
|
10744
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10726
10745
|
const titleId = react.useId();
|
|
10727
|
-
const files =
|
|
10746
|
+
const files = chunkA7C74SJT_cjs.useFiles({ tripRef });
|
|
10728
10747
|
const [phase, setPhase] = react.useState({ kind: "loading" });
|
|
10729
10748
|
const [imageBroke, setImageBroke] = react.useState(false);
|
|
10730
10749
|
const readUrl = files.url;
|
|
@@ -10798,7 +10817,7 @@ function VoidExpenseDialog({
|
|
|
10798
10817
|
onClose,
|
|
10799
10818
|
onSubmit
|
|
10800
10819
|
}) {
|
|
10801
|
-
const { t } =
|
|
10820
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10802
10821
|
const titleId = react.useId();
|
|
10803
10822
|
const [reason, setReason] = react.useState("");
|
|
10804
10823
|
const trimmed = reason.trim();
|
|
@@ -10872,9 +10891,9 @@ function isCloseoutLocked2(error) {
|
|
|
10872
10891
|
return classification?.status === 423 || classification?.code === "TRIP_CLOSED_OUT";
|
|
10873
10892
|
}
|
|
10874
10893
|
function TripExpensesSection({ tripRef, style }) {
|
|
10875
|
-
const { t } =
|
|
10876
|
-
const expenses =
|
|
10877
|
-
const vendors =
|
|
10894
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
10895
|
+
const expenses = chunkA7C74SJT_cjs.useExpenses(tripRef);
|
|
10896
|
+
const vendors = chunkA7C74SJT_cjs.useVendors(tripRef, "");
|
|
10878
10897
|
const [category, setCategory] = react.useState(null);
|
|
10879
10898
|
const [paymentMode, setPaymentMode] = react.useState(null);
|
|
10880
10899
|
const [missingReceiptOnly, setMissingReceiptOnly] = react.useState(false);
|
|
@@ -10943,7 +10962,7 @@ function TripExpensesSection({ tripRef, style }) {
|
|
|
10943
10962
|
return /* @__PURE__ */ jsxRuntime.jsx(ExpensesDark, { reason: expenses.reason });
|
|
10944
10963
|
}
|
|
10945
10964
|
const filtered = category !== null || paymentMode !== null || missingReceiptOnly;
|
|
10946
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-expenses-section", style:
|
|
10965
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-expenses-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
10947
10966
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-expenses-section__toolbar", children: [
|
|
10948
10967
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-expenses-section__toolbar-title", children: t("chrome.tripExpenses.panelLabel") }),
|
|
10949
10968
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-expenses-section__toolbar-spacer" }),
|
|
@@ -11223,7 +11242,7 @@ function FloatMovementDialog({
|
|
|
11223
11242
|
onClose,
|
|
11224
11243
|
onSubmit
|
|
11225
11244
|
}) {
|
|
11226
|
-
const { t } =
|
|
11245
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
11227
11246
|
const titleId = react.useId();
|
|
11228
11247
|
const [managerId, setManagerId] = react.useState(manager?.managerId ?? null);
|
|
11229
11248
|
const [amount, setAmount] = react.useState(
|
|
@@ -11456,7 +11475,7 @@ function FloatSkeleton() {
|
|
|
11456
11475
|
] }, id)) });
|
|
11457
11476
|
}
|
|
11458
11477
|
function FloatEmpty({ onIssue }) {
|
|
11459
|
-
const { t } =
|
|
11478
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
11460
11479
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-float-section__state", children: [
|
|
11461
11480
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-float-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(SafeIcon, {}) }),
|
|
11462
11481
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-float-section__state-title", children: t("chrome.tripFloat.emptyTitle") }),
|
|
@@ -11465,7 +11484,7 @@ function FloatEmpty({ onIssue }) {
|
|
|
11465
11484
|
] });
|
|
11466
11485
|
}
|
|
11467
11486
|
function FloatFailed({ onRetry }) {
|
|
11468
|
-
const { t } =
|
|
11487
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
11469
11488
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-float-section__state", role: "alert", children: [
|
|
11470
11489
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-float-section__state-title", children: t("chrome.tripFloat.failedTitle") }),
|
|
11471
11490
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-float-section__state-body", children: t("chrome.tripFloat.failedBody") }),
|
|
@@ -11473,7 +11492,7 @@ function FloatFailed({ onRetry }) {
|
|
|
11473
11492
|
] });
|
|
11474
11493
|
}
|
|
11475
11494
|
function FloatDark({ reason }) {
|
|
11476
|
-
const { t } =
|
|
11495
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
11477
11496
|
if (reason === "mode") {
|
|
11478
11497
|
return null;
|
|
11479
11498
|
}
|
|
@@ -11496,7 +11515,7 @@ function ManagerFloatCard({
|
|
|
11496
11515
|
onAdjust,
|
|
11497
11516
|
onSettle
|
|
11498
11517
|
}) {
|
|
11499
|
-
const { t } =
|
|
11518
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
11500
11519
|
const bodyId = `kf-float-${row.managerId}`;
|
|
11501
11520
|
const summary = row.summary;
|
|
11502
11521
|
const shares = summary === void 0 ? void 0 : usageShares(summary);
|
|
@@ -11702,9 +11721,9 @@ function refusedBalanceOf(error) {
|
|
|
11702
11721
|
return details?.currentBalanceMinor;
|
|
11703
11722
|
}
|
|
11704
11723
|
function TripFloatSection({ tripRef, style }) {
|
|
11705
|
-
const { t } =
|
|
11706
|
-
const float =
|
|
11707
|
-
const managers =
|
|
11724
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
11725
|
+
const float = chunkA7C74SJT_cjs.useFloat(tripRef);
|
|
11726
|
+
const managers = chunkA7C74SJT_cjs.useManagers(tripRef);
|
|
11708
11727
|
const [openManagerId, setOpenManagerId] = react.useState(null);
|
|
11709
11728
|
const [ledgers, setLedgers] = react.useState({});
|
|
11710
11729
|
const [overlay, setOverlay] = react.useState({ kind: "none" });
|
|
@@ -11830,7 +11849,7 @@ function TripFloatSection({ tripRef, style }) {
|
|
|
11830
11849
|
if (float.status === "dark") {
|
|
11831
11850
|
return /* @__PURE__ */ jsxRuntime.jsx(FloatDark, { reason: float.reason });
|
|
11832
11851
|
}
|
|
11833
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-float-section", style:
|
|
11852
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-float-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
11834
11853
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-float-section__toolbar", children: [
|
|
11835
11854
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-float-section__toolbar-title", children: t("chrome.tripFloat.panelLabel") }),
|
|
11836
11855
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-float-section__toolbar-spacer" }),
|
|
@@ -11945,7 +11964,7 @@ function DispatchDialog({
|
|
|
11945
11964
|
onClose,
|
|
11946
11965
|
onSend
|
|
11947
11966
|
}) {
|
|
11948
|
-
const { t } =
|
|
11967
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
11949
11968
|
const titleId = react.useId();
|
|
11950
11969
|
const [everyone, setEveryone] = react.useState(true);
|
|
11951
11970
|
const [picked, setPicked] = react.useState(/* @__PURE__ */ new Set());
|
|
@@ -12093,7 +12112,7 @@ function FormRow2({
|
|
|
12093
12112
|
onExport,
|
|
12094
12113
|
onOpenMissing
|
|
12095
12114
|
}) {
|
|
12096
|
-
const { t } =
|
|
12115
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12097
12116
|
const canSeeMissing = supportsWhoIsMissing(form);
|
|
12098
12117
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "kf-trip-forms-section__row", children: [
|
|
12099
12118
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-trip-forms-section__row-body", children: [
|
|
@@ -12146,14 +12165,14 @@ function FormsSkeleton() {
|
|
|
12146
12165
|
] }, id)) });
|
|
12147
12166
|
}
|
|
12148
12167
|
function FormsEmpty() {
|
|
12149
|
-
const { t } =
|
|
12168
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12150
12169
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-forms-section__state", children: [
|
|
12151
12170
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-forms-section__state-title", children: t("chrome.tripForms.emptyTitle") }),
|
|
12152
12171
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-forms-section__state-body", children: t("chrome.tripForms.emptyBody") })
|
|
12153
12172
|
] });
|
|
12154
12173
|
}
|
|
12155
12174
|
function FormsFailed({ onRetry }) {
|
|
12156
|
-
const { t } =
|
|
12175
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12157
12176
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-forms-section__state", role: "alert", children: [
|
|
12158
12177
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-forms-section__state-title", children: t("chrome.tripForms.failedTitle") }),
|
|
12159
12178
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-forms-section__state-body", children: t("chrome.tripForms.failedBody") }),
|
|
@@ -12161,7 +12180,7 @@ function FormsFailed({ onRetry }) {
|
|
|
12161
12180
|
] });
|
|
12162
12181
|
}
|
|
12163
12182
|
function FormsDark({ reason }) {
|
|
12164
|
-
const { t } =
|
|
12183
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12165
12184
|
if (reason === "mode") return null;
|
|
12166
12185
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-forms-section__state", "data-dark": reason, children: [
|
|
12167
12186
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-forms-section__state-title", children: t(reason === "flag" ? "chrome.tripForms.flagDarkTitle" : "chrome.tripForms.dataDarkTitle") }),
|
|
@@ -12206,7 +12225,7 @@ function OnBehalfDialog({
|
|
|
12206
12225
|
onClose,
|
|
12207
12226
|
onSubmit
|
|
12208
12227
|
}) {
|
|
12209
|
-
const { t } =
|
|
12228
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12210
12229
|
const titleId = react.useId();
|
|
12211
12230
|
const [values, setValues] = react.useState({});
|
|
12212
12231
|
const answerable = react.useMemo(
|
|
@@ -12344,7 +12363,7 @@ function ParticipantRow({
|
|
|
12344
12363
|
onFillOnBehalf,
|
|
12345
12364
|
onOpenResponse
|
|
12346
12365
|
}) {
|
|
12347
|
-
const { t } =
|
|
12366
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12348
12367
|
const status = row.response?.status;
|
|
12349
12368
|
const submitted = status === "SUBMITTED";
|
|
12350
12369
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "kf-trip-forms-section__row", "data-done": submitted ? "true" : void 0, children: [
|
|
@@ -12397,7 +12416,7 @@ function ResponseViewer({
|
|
|
12397
12416
|
failed,
|
|
12398
12417
|
onClose
|
|
12399
12418
|
}) {
|
|
12400
|
-
const { t } =
|
|
12419
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12401
12420
|
const titleId = react.useId();
|
|
12402
12421
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12403
12422
|
SheetDialog,
|
|
@@ -12433,9 +12452,9 @@ function TripFormsSection({
|
|
|
12433
12452
|
components,
|
|
12434
12453
|
style
|
|
12435
12454
|
}) {
|
|
12436
|
-
const { t } =
|
|
12437
|
-
const forms =
|
|
12438
|
-
const { listTripManifest } =
|
|
12455
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12456
|
+
const forms = chunkA7C74SJT_cjs.useForms(tripRef);
|
|
12457
|
+
const { listTripManifest } = chunkXBLAVNP3_cjs.useDirectories();
|
|
12439
12458
|
const [openFormId, setOpenFormId] = react.useState(null);
|
|
12440
12459
|
const [completion, setCompletion] = react.useState(void 0);
|
|
12441
12460
|
const [manifest, setManifest] = react.useState(void 0);
|
|
@@ -12557,7 +12576,7 @@ function TripFormsSection({
|
|
|
12557
12576
|
if (forms.status === "dark") return /* @__PURE__ */ jsxRuntime.jsx(FormsDark, { reason: forms.reason });
|
|
12558
12577
|
const inert = readOnly;
|
|
12559
12578
|
const unreadable = ready !== null && ready.syncedAt === void 0 && rows.length === 0;
|
|
12560
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-forms-section", style:
|
|
12579
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-forms-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
12561
12580
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-forms-section__head", children: [
|
|
12562
12581
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-forms-section__head-text", children: [
|
|
12563
12582
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-trip-forms-section__title", children: openForm === null ? t("chrome.tripForms.panelLabel") : openForm.title }),
|
|
@@ -12707,7 +12726,7 @@ function ChangeLogDialog({
|
|
|
12707
12726
|
onRetry,
|
|
12708
12727
|
onClose
|
|
12709
12728
|
}) {
|
|
12710
|
-
const { t } =
|
|
12729
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
12711
12730
|
const titleId = react.useId();
|
|
12712
12731
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12713
12732
|
SheetDialog,
|
|
@@ -13054,7 +13073,7 @@ function ItemRow({
|
|
|
13054
13073
|
onMoveBy,
|
|
13055
13074
|
onOpenVendor
|
|
13056
13075
|
}) {
|
|
13057
|
-
const { t } =
|
|
13076
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13058
13077
|
const derived = deriveItineraryItem(item, timeZone, serverTime);
|
|
13059
13078
|
const isDone = item.status === "COMPLETED";
|
|
13060
13079
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -13176,7 +13195,7 @@ function DayCard({
|
|
|
13176
13195
|
onSwitchToTimeline,
|
|
13177
13196
|
onOpenVendor
|
|
13178
13197
|
}) {
|
|
13179
|
-
const { t } =
|
|
13198
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13180
13199
|
const { draggingId, overIndex, rowProps, moveBy } = useListReorder({
|
|
13181
13200
|
enabled: canEdit,
|
|
13182
13201
|
onMove: onReorder
|
|
@@ -13227,7 +13246,7 @@ function DayCard({
|
|
|
13227
13246
|
] });
|
|
13228
13247
|
}
|
|
13229
13248
|
function DayPillStrip({ pills, activeIso, onSelect }) {
|
|
13230
|
-
const { t } =
|
|
13249
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13231
13250
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13232
13251
|
"div",
|
|
13233
13252
|
{
|
|
@@ -13304,7 +13323,7 @@ function EditDayDialog({
|
|
|
13304
13323
|
onClose,
|
|
13305
13324
|
onSubmit
|
|
13306
13325
|
}) {
|
|
13307
|
-
const { t } =
|
|
13326
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13308
13327
|
const titleId = react.useId();
|
|
13309
13328
|
const [cardTitle, setCardTitle] = react.useState(group.day.cardTitle);
|
|
13310
13329
|
const [hasSummary, setHasSummary] = react.useState(
|
|
@@ -13447,7 +13466,7 @@ function ItemFormDialog({
|
|
|
13447
13466
|
onSubmit,
|
|
13448
13467
|
onDelete
|
|
13449
13468
|
}) {
|
|
13450
|
-
const { t } =
|
|
13469
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13451
13470
|
const titleId = react.useId();
|
|
13452
13471
|
const isEdit = item !== null;
|
|
13453
13472
|
const [isoDate, setIsoDate] = react.useState(
|
|
@@ -13702,7 +13721,7 @@ function ItinerarySkeleton({ view }) {
|
|
|
13702
13721
|
] });
|
|
13703
13722
|
}
|
|
13704
13723
|
function ItineraryEmpty() {
|
|
13705
|
-
const { t } =
|
|
13724
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13706
13725
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-itinerary-section__state", children: [
|
|
13707
13726
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-itinerary-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, {}) }),
|
|
13708
13727
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-itinerary-section__state-title", children: t("chrome.tripItinerary.emptyTitle") }),
|
|
@@ -13710,7 +13729,7 @@ function ItineraryEmpty() {
|
|
|
13710
13729
|
] });
|
|
13711
13730
|
}
|
|
13712
13731
|
function ItineraryFailed({ onRetry }) {
|
|
13713
|
-
const { t } =
|
|
13732
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13714
13733
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-itinerary-section__state", role: "alert", children: [
|
|
13715
13734
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-itinerary-section__state-title", children: t("chrome.tripItinerary.failedTitle") }),
|
|
13716
13735
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-itinerary-section__state-body", children: t("chrome.tripItinerary.failedBody") }),
|
|
@@ -13718,7 +13737,7 @@ function ItineraryFailed({ onRetry }) {
|
|
|
13718
13737
|
] });
|
|
13719
13738
|
}
|
|
13720
13739
|
function TimelineView({ entries, onOpenDay }) {
|
|
13721
|
-
const { t } =
|
|
13740
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13722
13741
|
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: "kf-trip-itinerary-section__timeline", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-itinerary-section__timeline-grid", children: [
|
|
13723
13742
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-itinerary-section__timeline-line", "aria-hidden": "true" }),
|
|
13724
13743
|
entries.map((entry, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13805,7 +13824,7 @@ var OPTIONS2 = [
|
|
|
13805
13824
|
{ value: "timeline", labelKey: "chrome.tripItinerary.viewTimeline" }
|
|
13806
13825
|
];
|
|
13807
13826
|
function ViewSegment({ value, onChange }) {
|
|
13808
|
-
const { t } =
|
|
13827
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13809
13828
|
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "kf-trip-itinerary-section__segment", children: [
|
|
13810
13829
|
/* @__PURE__ */ jsxRuntime.jsx("legend", { className: "kf-visually-hidden", children: t("chrome.tripItinerary.viewLabel") }),
|
|
13811
13830
|
OPTIONS2.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13831,8 +13850,8 @@ function TripItinerarySection({
|
|
|
13831
13850
|
onOpenVendor,
|
|
13832
13851
|
style
|
|
13833
13852
|
}) {
|
|
13834
|
-
const { t } =
|
|
13835
|
-
const itinerary =
|
|
13853
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
13854
|
+
const itinerary = chunkA7C74SJT_cjs.useItinerary(tripRef);
|
|
13836
13855
|
const [view, setView] = react.useState("days");
|
|
13837
13856
|
const [activeIso, setActiveIso] = react.useState(null);
|
|
13838
13857
|
const [overlay, setOverlay] = react.useState({ kind: "none" });
|
|
@@ -14005,7 +14024,7 @@ function TripItinerarySection({
|
|
|
14005
14024
|
setActiveIso(isoDate);
|
|
14006
14025
|
setView("days");
|
|
14007
14026
|
}
|
|
14008
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-itinerary-section", style:
|
|
14027
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-itinerary-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
14009
14028
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-itinerary-section__toolbar", children: [
|
|
14010
14029
|
/* @__PURE__ */ jsxRuntime.jsx(ViewSegment, { value: view, onChange: setView }),
|
|
14011
14030
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-itinerary-section__toolbar-spacer" }),
|
|
@@ -14179,14 +14198,20 @@ function WarningIcon12(props) {
|
|
|
14179
14198
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 9v4M12 17h.01" })
|
|
14180
14199
|
] });
|
|
14181
14200
|
}
|
|
14201
|
+
var ADD_FAILURE_KEY = {
|
|
14202
|
+
LOCKED: "chrome.tripManifest.addFailedLocked",
|
|
14203
|
+
BUSINESS_RULE_VIOLATION: "chrome.tripManifest.addFailedRule",
|
|
14204
|
+
VALIDATION_ERROR: "chrome.tripManifest.addFailedInvalid",
|
|
14205
|
+
RESOURCE_NOT_FOUND: "chrome.tripManifest.addFailedGone"
|
|
14206
|
+
};
|
|
14182
14207
|
function AddTravellerDialog({
|
|
14183
14208
|
tripRef,
|
|
14184
14209
|
onClose,
|
|
14185
14210
|
onAdded
|
|
14186
14211
|
}) {
|
|
14187
|
-
const { t } =
|
|
14212
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
14188
14213
|
const titleId = react.useId();
|
|
14189
|
-
const { makeTravellersFetch, addTraveller, createAgencyTraveller } =
|
|
14214
|
+
const { makeTravellersFetch, addTraveller, createAgencyTraveller } = chunkXBLAVNP3_cjs.useDirectories();
|
|
14190
14215
|
const [mode, setMode] = react.useState("search");
|
|
14191
14216
|
const [term, setTerm] = react.useState("");
|
|
14192
14217
|
const [debounced, setDebounced] = react.useState("");
|
|
@@ -14194,16 +14219,17 @@ function AddTravellerDialog({
|
|
|
14194
14219
|
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
14195
14220
|
const [newName, setNewName] = react.useState("");
|
|
14196
14221
|
const [newPhone, setNewPhone] = react.useState("");
|
|
14222
|
+
const [pendingId, setPendingId] = react.useState(void 0);
|
|
14197
14223
|
react.useEffect(() => {
|
|
14198
14224
|
const timer = setTimeout(() => setDebounced(term.trim()), 300);
|
|
14199
14225
|
return () => clearTimeout(timer);
|
|
14200
14226
|
}, [term]);
|
|
14201
14227
|
function reportFailure(error) {
|
|
14202
|
-
|
|
14203
|
-
setErrorCode(classification?.code ?? "unknown");
|
|
14228
|
+
setErrorCode(chunkA7C74SJT_cjs.classifyError(error).code ?? "unknown");
|
|
14204
14229
|
}
|
|
14205
14230
|
async function addExisting(externalTravellerId, fullName) {
|
|
14206
14231
|
setPending(true);
|
|
14232
|
+
setPendingId(externalTravellerId);
|
|
14207
14233
|
setErrorCode(void 0);
|
|
14208
14234
|
try {
|
|
14209
14235
|
await addTraveller({ tripRef, externalTravellerId, fullName });
|
|
@@ -14212,6 +14238,7 @@ function AddTravellerDialog({
|
|
|
14212
14238
|
reportFailure(error);
|
|
14213
14239
|
} finally {
|
|
14214
14240
|
setPending(false);
|
|
14241
|
+
setPendingId(void 0);
|
|
14215
14242
|
}
|
|
14216
14243
|
}
|
|
14217
14244
|
async function createAndAdd() {
|
|
@@ -14245,6 +14272,7 @@ function AddTravellerDialog({
|
|
|
14245
14272
|
onClose,
|
|
14246
14273
|
closeLabel: t("chrome.tripManifest.close"),
|
|
14247
14274
|
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14275
|
+
errorCode === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-manifest-section__dialog-error", role: "alert", children: t(ADD_FAILURE_KEY[errorCode] ?? "chrome.tripManifest.addFailed") }),
|
|
14248
14276
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14249
14277
|
"button",
|
|
14250
14278
|
{
|
|
@@ -14309,6 +14337,7 @@ function AddTravellerDialog({
|
|
|
14309
14337
|
{
|
|
14310
14338
|
fetch: makeTravellersFetch(debounced.length > 0 ? { q: debounced } : {}),
|
|
14311
14339
|
disabled: pending,
|
|
14340
|
+
...pendingId !== void 0 ? { pendingId } : {},
|
|
14312
14341
|
onPick: (externalTravellerId, fullName) => void addExisting(externalTravellerId, fullName)
|
|
14313
14342
|
},
|
|
14314
14343
|
debounced
|
|
@@ -14337,15 +14366,25 @@ function AddTravellerDialog({
|
|
|
14337
14366
|
)
|
|
14338
14367
|
] }),
|
|
14339
14368
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-manifest-section__dialog-note", children: t("chrome.tripManifest.addCreateNote") })
|
|
14340
|
-
] })
|
|
14341
|
-
errorCode === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-manifest-section__dialog-error", role: "alert", children: t("chrome.tripManifest.addFailed") })
|
|
14369
|
+
] })
|
|
14342
14370
|
]
|
|
14343
14371
|
}
|
|
14344
14372
|
);
|
|
14345
14373
|
}
|
|
14346
|
-
function DirectoryResults({
|
|
14347
|
-
|
|
14348
|
-
|
|
14374
|
+
function DirectoryResults({
|
|
14375
|
+
fetch,
|
|
14376
|
+
disabled,
|
|
14377
|
+
pendingId,
|
|
14378
|
+
onPick
|
|
14379
|
+
}) {
|
|
14380
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
14381
|
+
const { rows, hasNext, loadNext, settled, error } = chunkXBLAVNP3_cjs.usePaginatedList(fetch);
|
|
14382
|
+
if (!settled) {
|
|
14383
|
+
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-manifest-section__dialog-note", "aria-live": "polite", children: t("chrome.tripManifest.addSearching") });
|
|
14384
|
+
}
|
|
14385
|
+
if (error !== void 0) {
|
|
14386
|
+
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-manifest-section__dialog-error", role: "alert", children: t("chrome.tripManifest.addSearchFailed") });
|
|
14387
|
+
}
|
|
14349
14388
|
if (rows.length === 0) {
|
|
14350
14389
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-manifest-section__dialog-note", children: t("chrome.tripManifest.addNoMatches") });
|
|
14351
14390
|
}
|
|
@@ -14368,7 +14407,7 @@ function DirectoryResults({ fetch, disabled, onPick }) {
|
|
|
14368
14407
|
onPick(row.externalTravellerId, row.fullName);
|
|
14369
14408
|
}
|
|
14370
14409
|
},
|
|
14371
|
-
children: t("chrome.tripManifest.addPick")
|
|
14410
|
+
children: pendingId !== void 0 && pendingId === row.externalTravellerId ? t("chrome.tripManifest.adding") : t("chrome.tripManifest.addPick")
|
|
14372
14411
|
}
|
|
14373
14412
|
)
|
|
14374
14413
|
] }, row.travellerId)) }),
|
|
@@ -14390,7 +14429,7 @@ function deriveManifestGroups(rows) {
|
|
|
14390
14429
|
const byParty = /* @__PURE__ */ new Map();
|
|
14391
14430
|
const solos = [];
|
|
14392
14431
|
for (const row of rows) {
|
|
14393
|
-
if (row.party
|
|
14432
|
+
if (row.party == null) {
|
|
14394
14433
|
solos.push(row);
|
|
14395
14434
|
continue;
|
|
14396
14435
|
}
|
|
@@ -14422,9 +14461,9 @@ function EditPartyDialog({
|
|
|
14422
14461
|
onClose,
|
|
14423
14462
|
onSaved
|
|
14424
14463
|
}) {
|
|
14425
|
-
const { t } =
|
|
14464
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
14426
14465
|
const titleId = react.useId();
|
|
14427
|
-
const { patchParty, deleteParty } =
|
|
14466
|
+
const { patchParty, deleteParty } = chunkXBLAVNP3_cjs.useDirectories();
|
|
14428
14467
|
const party = group.party;
|
|
14429
14468
|
const [kind, setKind] = react.useState(
|
|
14430
14469
|
party?.kind ?? "OTHER"
|
|
@@ -14585,7 +14624,7 @@ function EditPartyDialog({
|
|
|
14585
14624
|
}
|
|
14586
14625
|
var DIET_BUCKET_CAP = 4;
|
|
14587
14626
|
function ManifestFacetTiles({ facets, filtered }) {
|
|
14588
|
-
const { t } =
|
|
14627
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
14589
14628
|
const dietEntries = Object.entries(facets.dietCounts).filter(([, count]) => count > 0).sort((a, b) => b[1] - a[1]);
|
|
14590
14629
|
const shown = dietEntries.slice(0, DIET_BUCKET_CAP);
|
|
14591
14630
|
const hiddenCount = dietEntries.length - shown.length;
|
|
@@ -14600,10 +14639,13 @@ function ManifestFacetTiles({ facets, filtered }) {
|
|
|
14600
14639
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-manifest-section__tile", children: [
|
|
14601
14640
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-manifest-section__tile-label", children: t("chrome.tripManifest.tileDiet") }),
|
|
14602
14641
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-manifest-section__tile-diet", children: [
|
|
14603
|
-
shown.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__empty-value", children: t("chrome.tripManifest.noDiet") }) : shown.map(([key, count]) =>
|
|
14604
|
-
|
|
14605
|
-
/* @__PURE__ */ jsxRuntime.
|
|
14606
|
-
|
|
14642
|
+
shown.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__empty-value", children: t("chrome.tripManifest.noDiet") }) : shown.map(([key, count]) => {
|
|
14643
|
+
const label = key === "unspecified" ? t("chrome.tripManifest.dietUnspecified") : key;
|
|
14644
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-trip-manifest-section__tile-diet-entry", children: [
|
|
14645
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__tile-diet-count", children: count }),
|
|
14646
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__tile-diet-key", title: label, children: label })
|
|
14647
|
+
] }, key);
|
|
14648
|
+
}),
|
|
14607
14649
|
hiddenCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__tile-diet-more", children: t("chrome.tripManifest.dietMore").replace("{count}", String(hiddenCount)) }) : null
|
|
14608
14650
|
] })
|
|
14609
14651
|
] }),
|
|
@@ -14617,7 +14659,23 @@ function ManifestFacetTiles({ facets, filtered }) {
|
|
|
14617
14659
|
children: facets.medicalCount
|
|
14618
14660
|
}
|
|
14619
14661
|
),
|
|
14620
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-manifest-section__tile-sub", children: t(
|
|
14662
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-manifest-section__tile-sub", children: t(
|
|
14663
|
+
facets.medicalCount === 1 ? "chrome.tripManifest.tileFlagsSubOne" : "chrome.tripManifest.tileFlagsSubMany"
|
|
14664
|
+
) })
|
|
14665
|
+
] }),
|
|
14666
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-manifest-section__tile", children: [
|
|
14667
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-manifest-section__tile-label", children: t("chrome.tripManifest.tileBalance") }),
|
|
14668
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14669
|
+
"div",
|
|
14670
|
+
{
|
|
14671
|
+
className: "kf-trip-manifest-section__tile-value",
|
|
14672
|
+
"data-tone": facets.dueCount > 0 ? "warn" : void 0,
|
|
14673
|
+
children: facets.dueCount
|
|
14674
|
+
}
|
|
14675
|
+
),
|
|
14676
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-manifest-section__tile-sub", children: t(
|
|
14677
|
+
facets.dueCount === 1 ? "chrome.tripManifest.tileBalanceSubOne" : "chrome.tripManifest.tileBalanceSubMany"
|
|
14678
|
+
) })
|
|
14621
14679
|
] })
|
|
14622
14680
|
] });
|
|
14623
14681
|
}
|
|
@@ -14648,7 +14706,7 @@ function ManifestFiltersPopover({
|
|
|
14648
14706
|
value,
|
|
14649
14707
|
onChange
|
|
14650
14708
|
}) {
|
|
14651
|
-
const { t } =
|
|
14709
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
14652
14710
|
const [open, setOpen] = react.useState(false);
|
|
14653
14711
|
const rootRef = react.useRef(null);
|
|
14654
14712
|
const triggerRef = react.useRef(null);
|
|
@@ -14788,7 +14846,7 @@ var KIND_LABEL_KEY2 = {
|
|
|
14788
14846
|
OTHER: "chrome.tripManifest.partyKind.other"
|
|
14789
14847
|
};
|
|
14790
14848
|
function ManifestGroupCard({ group, onEdit, children }) {
|
|
14791
|
-
const { t } =
|
|
14849
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
14792
14850
|
const party = group.party;
|
|
14793
14851
|
const isSolo = party === null;
|
|
14794
14852
|
const heading = isSolo ? t("chrome.tripManifest.soloHeading") : party.label ?? t(KIND_LABEL_KEY2[party.kind] ?? "chrome.tripManifest.partyKind.other");
|
|
@@ -14876,7 +14934,7 @@ function ManifestRowKebab({
|
|
|
14876
14934
|
onShareLink,
|
|
14877
14935
|
onOpenProfile
|
|
14878
14936
|
}) {
|
|
14879
|
-
const { t } =
|
|
14937
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
14880
14938
|
const [open, setOpen] = react.useState(false);
|
|
14881
14939
|
const rootRef = react.useRef(null);
|
|
14882
14940
|
const triggerRef = react.useRef(null);
|
|
@@ -14975,10 +15033,10 @@ function ManifestRow({
|
|
|
14975
15033
|
onOpenProfile,
|
|
14976
15034
|
style
|
|
14977
15035
|
}) {
|
|
14978
|
-
const { t } =
|
|
15036
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
14979
15037
|
const derived = deriveManifestRow(row, index, serverTime);
|
|
14980
15038
|
const traveller = row.traveller;
|
|
14981
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("tr", { role: "row", className: "kf-trip-manifest-section__row", style:
|
|
15039
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("tr", { role: "row", className: "kf-trip-manifest-section__row", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
14982
15040
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14983
15041
|
"td",
|
|
14984
15042
|
{
|
|
@@ -15052,7 +15110,7 @@ function ManifestTable({
|
|
|
15052
15110
|
onOpenProfile,
|
|
15053
15111
|
RowComponent
|
|
15054
15112
|
}) {
|
|
15055
|
-
const { t } =
|
|
15113
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
15056
15114
|
const Row = RowComponent ?? ManifestRow;
|
|
15057
15115
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-manifest-section__table-wrap", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { role: "table", className: "kf-trip-manifest-section__table", children: [
|
|
15058
15116
|
showHead ? /* @__PURE__ */ jsxRuntime.jsx("thead", { role: "rowgroup", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { role: "row", className: "kf-trip-manifest-section__head-row", children: [
|
|
@@ -15099,8 +15157,8 @@ function ManifestResultsBody({
|
|
|
15099
15157
|
RowComponent,
|
|
15100
15158
|
onRetry
|
|
15101
15159
|
}) {
|
|
15102
|
-
const { t } =
|
|
15103
|
-
const { makeManifestFetch, facets, groupedPageSize } =
|
|
15160
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
15161
|
+
const { makeManifestFetch, facets, groupedPageSize } = chunkXBLAVNP3_cjs.useAgencyTripManifest(tripRef);
|
|
15104
15162
|
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
15105
15163
|
const [hasSettled, setHasSettled] = react.useState(false);
|
|
15106
15164
|
const [serverTime, setServerTime] = react.useState(void 0);
|
|
@@ -15117,7 +15175,7 @@ function ManifestResultsBody({
|
|
|
15117
15175
|
if (meta?.serverTime !== void 0) setServerTime(meta.serverTime);
|
|
15118
15176
|
return page;
|
|
15119
15177
|
} catch (error) {
|
|
15120
|
-
setErrorCode(
|
|
15178
|
+
setErrorCode(chunkA7C74SJT_cjs.classifyError(error).code ?? "unknown");
|
|
15121
15179
|
return { rows: [], nextCursor: void 0 };
|
|
15122
15180
|
} finally {
|
|
15123
15181
|
setHasSettled(true);
|
|
@@ -15125,7 +15183,9 @@ function ManifestResultsBody({
|
|
|
15125
15183
|
},
|
|
15126
15184
|
[makeManifestFetch, filters, grouped, groupedPageSize]
|
|
15127
15185
|
);
|
|
15128
|
-
const { rows, hasNext, hasPrev, loadNext, loadPrev } =
|
|
15186
|
+
const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkXBLAVNP3_cjs.usePaginatedList(fetch, {
|
|
15187
|
+
accumulate: grouped
|
|
15188
|
+
});
|
|
15129
15189
|
react.useEffect(() => {
|
|
15130
15190
|
onFacetsChange?.(facets);
|
|
15131
15191
|
}, [onFacetsChange, facets]);
|
|
@@ -15169,6 +15229,22 @@ function ManifestResultsBody({
|
|
|
15169
15229
|
}
|
|
15170
15230
|
if (grouped) {
|
|
15171
15231
|
const groups = deriveManifestGroups(rows);
|
|
15232
|
+
if (groups.length === 0) {
|
|
15233
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15234
|
+
ManifestTable,
|
|
15235
|
+
{
|
|
15236
|
+
rows,
|
|
15237
|
+
serverTime,
|
|
15238
|
+
showHead: true,
|
|
15239
|
+
indexOffset: 0,
|
|
15240
|
+
onOpen,
|
|
15241
|
+
onRemove,
|
|
15242
|
+
onShareLink,
|
|
15243
|
+
...onOpenProfile !== void 0 ? { onOpenProfile } : {},
|
|
15244
|
+
...RowComponent !== void 0 ? { RowComponent } : {}
|
|
15245
|
+
}
|
|
15246
|
+
);
|
|
15247
|
+
}
|
|
15172
15248
|
let offset = 0;
|
|
15173
15249
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-manifest-section__groups", children: groups.map((group) => {
|
|
15174
15250
|
const indexOffset = offset;
|
|
@@ -15268,7 +15344,7 @@ function ManifestSearchInput({
|
|
|
15268
15344
|
debounceMs,
|
|
15269
15345
|
onDebouncedChange
|
|
15270
15346
|
}) {
|
|
15271
|
-
const { t } =
|
|
15347
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
15272
15348
|
const [value, setValue] = react.useState("");
|
|
15273
15349
|
react.useEffect(() => {
|
|
15274
15350
|
const timer = setTimeout(() => onDebouncedChange(value.trim()), debounceMs);
|
|
@@ -15295,8 +15371,8 @@ function RemoveTravellerDialog({
|
|
|
15295
15371
|
onClose,
|
|
15296
15372
|
onRemoved
|
|
15297
15373
|
}) {
|
|
15298
|
-
const { t } =
|
|
15299
|
-
const { removeFromManifest } =
|
|
15374
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
15375
|
+
const { removeFromManifest } = chunkXBLAVNP3_cjs.useDirectories();
|
|
15300
15376
|
const titleId = react.useId();
|
|
15301
15377
|
const [pending, setPending] = react.useState(false);
|
|
15302
15378
|
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
@@ -15367,17 +15443,33 @@ var SECTION_LABEL_KEY = {
|
|
|
15367
15443
|
forms: "chrome.tripManifest.section.forms"
|
|
15368
15444
|
};
|
|
15369
15445
|
var TTL_CHOICES = [null, 7, 30, 90];
|
|
15446
|
+
var FULL_DATE_OPTS = {
|
|
15447
|
+
day: "2-digit",
|
|
15448
|
+
month: "short",
|
|
15449
|
+
year: "numeric"
|
|
15450
|
+
};
|
|
15451
|
+
var SHARE_BASE_URL_KEY = "share.baseUrl.default";
|
|
15452
|
+
function shareAddress(baseUrl, token) {
|
|
15453
|
+
if (baseUrl === void 0 || baseUrl.trim().length === 0) {
|
|
15454
|
+
return token;
|
|
15455
|
+
}
|
|
15456
|
+
return `${baseUrl.replace(/\/+$/, "")}/${token}`;
|
|
15457
|
+
}
|
|
15370
15458
|
function ShareLinkDialog({
|
|
15371
15459
|
tripRef,
|
|
15372
15460
|
travellerRef,
|
|
15373
15461
|
travellerName,
|
|
15374
15462
|
onClose
|
|
15375
15463
|
}) {
|
|
15376
|
-
const { t } =
|
|
15464
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
15377
15465
|
const titleId = react.useId();
|
|
15466
|
+
const shareBaseUrl = chunkXBLAVNP3_cjs.useResolvedSetting(SHARE_BASE_URL_KEY);
|
|
15378
15467
|
const isFamily = travellerRef === null;
|
|
15379
|
-
const offerable =
|
|
15380
|
-
const { links, readFailed, mint, revoke, regenerate } =
|
|
15468
|
+
const offerable = chunkXBLAVNP3_cjs.familySafeSections(isFamily);
|
|
15469
|
+
const { links, readFailed, mint, revoke, regenerate, reveal } = chunkXBLAVNP3_cjs.useShareLinks(
|
|
15470
|
+
tripRef,
|
|
15471
|
+
travellerRef
|
|
15472
|
+
);
|
|
15381
15473
|
const [useAgencyDefault, setUseAgencyDefault] = react.useState(true);
|
|
15382
15474
|
const [chosen, setChosen] = react.useState(/* @__PURE__ */ new Set());
|
|
15383
15475
|
const [ttlDays, setTtlDays] = react.useState(null);
|
|
@@ -15385,6 +15477,19 @@ function ShareLinkDialog({
|
|
|
15385
15477
|
const [pending, setPending] = react.useState(false);
|
|
15386
15478
|
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
15387
15479
|
const [copied, setCopied] = react.useState(false);
|
|
15480
|
+
const [confirmingRevokeId, setConfirmingRevokeId] = react.useState(null);
|
|
15481
|
+
const [revealed, setRevealed] = react.useState({});
|
|
15482
|
+
async function showLink(id) {
|
|
15483
|
+
setRevealed((previous) => ({ ...previous, [id]: "pending" }));
|
|
15484
|
+
setErrorCode(void 0);
|
|
15485
|
+
try {
|
|
15486
|
+
const token = await reveal(id);
|
|
15487
|
+
setRevealed((previous) => ({ ...previous, [id]: token ?? "unrecoverable" }));
|
|
15488
|
+
} catch {
|
|
15489
|
+
setRevealed((previous) => ({ ...previous, [id]: void 0 }));
|
|
15490
|
+
setErrorCode("unknown");
|
|
15491
|
+
}
|
|
15492
|
+
}
|
|
15388
15493
|
function toggle(key) {
|
|
15389
15494
|
const next = new Set(chosen);
|
|
15390
15495
|
if (next.has(key)) next.delete(key);
|
|
@@ -15449,7 +15554,11 @@ function ShareLinkDialog({
|
|
|
15449
15554
|
...useAgencyDefault ? {} : { sections: fullSections() },
|
|
15450
15555
|
...ttlDays !== null ? { ttlDays } : {}
|
|
15451
15556
|
});
|
|
15452
|
-
return {
|
|
15557
|
+
return {
|
|
15558
|
+
token: response.token,
|
|
15559
|
+
id: response.id,
|
|
15560
|
+
expiresAt: response.expiresAt
|
|
15561
|
+
};
|
|
15453
15562
|
}),
|
|
15454
15563
|
children: pending ? t("chrome.tripManifest.minting") : t(
|
|
15455
15564
|
hasLiveLink ? "chrome.tripManifest.mintAnotherLink" : "chrome.tripManifest.mintLink"
|
|
@@ -15465,7 +15574,7 @@ function ShareLinkDialog({
|
|
|
15465
15574
|
{
|
|
15466
15575
|
readOnly: true,
|
|
15467
15576
|
className: "kf-trip-manifest-section__minted-token",
|
|
15468
|
-
value: minted.token,
|
|
15577
|
+
value: shareAddress(shareBaseUrl, minted.token),
|
|
15469
15578
|
"aria-label": t("chrome.tripManifest.mintedTokenLabel"),
|
|
15470
15579
|
onFocus: (event) => event.currentTarget.select()
|
|
15471
15580
|
}
|
|
@@ -15475,10 +15584,14 @@ function ShareLinkDialog({
|
|
|
15475
15584
|
{
|
|
15476
15585
|
type: "button",
|
|
15477
15586
|
className: "kf-trip-manifest-section__dialog-secondary",
|
|
15478
|
-
onClick: () => void copy(minted.token),
|
|
15587
|
+
onClick: () => void copy(shareAddress(shareBaseUrl, minted.token)),
|
|
15479
15588
|
children: copied ? t("chrome.tripManifest.copied") : t("chrome.tripManifest.copy")
|
|
15480
15589
|
}
|
|
15481
|
-
)
|
|
15590
|
+
),
|
|
15591
|
+
minted.expiresAt === null ? null : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-manifest-section__dialog-note", children: t("chrome.tripManifest.mintedExpiresAt").replace(
|
|
15592
|
+
"{date}",
|
|
15593
|
+
formatDay(minted.expiresAt, FULL_DATE_OPTS)
|
|
15594
|
+
) })
|
|
15482
15595
|
] }),
|
|
15483
15596
|
/* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "kf-trip-manifest-section__share-fieldset", children: [
|
|
15484
15597
|
/* @__PURE__ */ jsxRuntime.jsx("legend", { className: "kf-trip-manifest-section__share-legend", children: t("chrome.tripManifest.sectionsLegend") }),
|
|
@@ -15535,37 +15648,107 @@ function ShareLinkDialog({
|
|
|
15535
15648
|
/* @__PURE__ */ jsxRuntime.jsx(StatusPill, { tone: link.status === "ACTIVE" ? "pos" : "mute", children: t(
|
|
15536
15649
|
link.status === "ACTIVE" ? "chrome.tripManifest.linkActive" : "chrome.tripManifest.linkDead"
|
|
15537
15650
|
) }),
|
|
15538
|
-
/* @__PURE__ */ jsxRuntime.
|
|
15651
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-trip-manifest-section__link-meta", children: [
|
|
15652
|
+
link.travellerId === null ? t("chrome.tripManifest.linkFamily") : t("chrome.tripManifest.linkTraveller"),
|
|
15653
|
+
link.expiresAt === null ? null : ` \xB7 ${t("chrome.tripManifest.linkExpires").replace(
|
|
15654
|
+
"{date}",
|
|
15655
|
+
formatDay(link.expiresAt, FULL_DATE_OPTS)
|
|
15656
|
+
)}`
|
|
15657
|
+
] })
|
|
15539
15658
|
] }),
|
|
15540
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-trip-manifest-section__link-actions", children: [
|
|
15659
|
+
confirmingRevokeId === link.id ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-trip-manifest-section__link-actions", role: "group", children: [
|
|
15660
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__link-confirm-prompt", children: t("chrome.tripManifest.revokeConfirm") }),
|
|
15541
15661
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15542
15662
|
"button",
|
|
15543
15663
|
{
|
|
15544
15664
|
type: "button",
|
|
15545
|
-
className: "kf-trip-manifest-section__link-action",
|
|
15665
|
+
className: "kf-trip-manifest-section__link-action-button",
|
|
15546
15666
|
disabled: pending,
|
|
15547
|
-
onClick: () =>
|
|
15548
|
-
|
|
15549
|
-
return { token: response.token, id: response.id };
|
|
15550
|
-
}),
|
|
15551
|
-
children: t("chrome.tripManifest.regenerate")
|
|
15667
|
+
onClick: () => setConfirmingRevokeId(null),
|
|
15668
|
+
children: t("chrome.tripManifest.revokeKeep")
|
|
15552
15669
|
}
|
|
15553
15670
|
),
|
|
15554
15671
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15555
15672
|
"button",
|
|
15556
15673
|
{
|
|
15557
15674
|
type: "button",
|
|
15558
|
-
className: "kf-trip-manifest-section__link-action",
|
|
15675
|
+
className: "kf-trip-manifest-section__link-action-button",
|
|
15559
15676
|
"data-tone": "danger",
|
|
15560
15677
|
disabled: pending,
|
|
15561
15678
|
onClick: () => {
|
|
15679
|
+
setConfirmingRevokeId(null);
|
|
15562
15680
|
setErrorCode(void 0);
|
|
15563
15681
|
void revoke(link.id).catch(() => setErrorCode("unknown"));
|
|
15564
15682
|
},
|
|
15683
|
+
children: t("chrome.tripManifest.revokeNow")
|
|
15684
|
+
}
|
|
15685
|
+
)
|
|
15686
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "kf-trip-manifest-section__link-actions", children: [
|
|
15687
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15688
|
+
"button",
|
|
15689
|
+
{
|
|
15690
|
+
type: "button",
|
|
15691
|
+
className: "kf-trip-manifest-section__link-action-button",
|
|
15692
|
+
disabled: pending || revealed[link.id] === "pending",
|
|
15693
|
+
onClick: () => void showLink(link.id),
|
|
15694
|
+
children: revealed[link.id] === "pending" ? t("chrome.tripManifest.revealing") : t("chrome.tripManifest.showLink")
|
|
15695
|
+
}
|
|
15696
|
+
),
|
|
15697
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15698
|
+
"button",
|
|
15699
|
+
{
|
|
15700
|
+
type: "button",
|
|
15701
|
+
className: "kf-trip-manifest-section__link-action-button",
|
|
15702
|
+
disabled: pending,
|
|
15703
|
+
onClick: () => void run(async () => {
|
|
15704
|
+
const response = await regenerate(link.id);
|
|
15705
|
+
return {
|
|
15706
|
+
token: response.token,
|
|
15707
|
+
id: response.id,
|
|
15708
|
+
expiresAt: response.expiresAt
|
|
15709
|
+
};
|
|
15710
|
+
}),
|
|
15711
|
+
children: t("chrome.tripManifest.regenerate")
|
|
15712
|
+
}
|
|
15713
|
+
),
|
|
15714
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15715
|
+
"button",
|
|
15716
|
+
{
|
|
15717
|
+
type: "button",
|
|
15718
|
+
className: "kf-trip-manifest-section__link-action-button",
|
|
15719
|
+
"data-tone": "danger",
|
|
15720
|
+
disabled: pending,
|
|
15721
|
+
onClick: () => setConfirmingRevokeId(link.id),
|
|
15565
15722
|
children: t("chrome.tripManifest.revoke")
|
|
15566
15723
|
}
|
|
15567
15724
|
)
|
|
15568
|
-
] })
|
|
15725
|
+
] }),
|
|
15726
|
+
revealed[link.id] === void 0 || revealed[link.id] === "pending" ? null : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__link-revealed", children: revealed[link.id] === "unrecoverable" ? (
|
|
15727
|
+
// NOT an error. This link works; it simply predates
|
|
15728
|
+
// Kaafil keeping a copy it can read back, so Replace
|
|
15729
|
+
// is the only route to an address they can send.
|
|
15730
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__dialog-note", children: t("chrome.tripManifest.linkNotRecoverable") })
|
|
15731
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15732
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15733
|
+
"input",
|
|
15734
|
+
{
|
|
15735
|
+
readOnly: true,
|
|
15736
|
+
className: "kf-trip-manifest-section__minted-token",
|
|
15737
|
+
value: shareAddress(shareBaseUrl, String(revealed[link.id])),
|
|
15738
|
+
"aria-label": t("chrome.tripManifest.mintedTokenLabel"),
|
|
15739
|
+
onFocus: (event) => event.currentTarget.select()
|
|
15740
|
+
}
|
|
15741
|
+
),
|
|
15742
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15743
|
+
"button",
|
|
15744
|
+
{
|
|
15745
|
+
type: "button",
|
|
15746
|
+
className: "kf-trip-manifest-section__link-action-button",
|
|
15747
|
+
onClick: () => void copy(shareAddress(shareBaseUrl, String(revealed[link.id]))),
|
|
15748
|
+
children: copied ? t("chrome.tripManifest.copied") : t("chrome.tripManifest.copy")
|
|
15749
|
+
}
|
|
15750
|
+
)
|
|
15751
|
+
] }) })
|
|
15569
15752
|
] }, link.id)) })
|
|
15570
15753
|
] })
|
|
15571
15754
|
] }),
|
|
@@ -15616,7 +15799,7 @@ function SideDrawer({
|
|
|
15616
15799
|
"aria-modal": "true",
|
|
15617
15800
|
"aria-labelledby": titleId,
|
|
15618
15801
|
tabIndex: -1,
|
|
15619
|
-
style:
|
|
15802
|
+
style: chunk3N2EQ2KC_cjs.tokenStyle(style),
|
|
15620
15803
|
children: [
|
|
15621
15804
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-admin-side-drawer__header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-side-drawer__header-row", children: [
|
|
15622
15805
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-side-drawer__identity", children: [
|
|
@@ -15684,11 +15867,11 @@ function TravellerDetailDialog({
|
|
|
15684
15867
|
onClose,
|
|
15685
15868
|
onRemove
|
|
15686
15869
|
}) {
|
|
15687
|
-
const { t } =
|
|
15870
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
15688
15871
|
const titleId = react.useId();
|
|
15689
|
-
const { read, readFailed, refresh } =
|
|
15690
|
-
const forms =
|
|
15691
|
-
const { addTravellerNote } =
|
|
15872
|
+
const { read, readFailed, refresh } = chunkA7C74SJT_cjs.useTravellerProfile(tripRef, travellerRef);
|
|
15873
|
+
const forms = chunkXBLAVNP3_cjs.useTravellerFormResponses(tripRef, travellerRef);
|
|
15874
|
+
const { addTravellerNote } = chunkXBLAVNP3_cjs.useDirectories();
|
|
15692
15875
|
const [noteDraft, setNoteDraft] = react.useState("");
|
|
15693
15876
|
const [notePending, setNotePending] = react.useState(false);
|
|
15694
15877
|
const [noteFailed, setNoteFailed] = react.useState(false);
|
|
@@ -15917,7 +16100,7 @@ function DetailRow({
|
|
|
15917
16100
|
absentLabel,
|
|
15918
16101
|
meta
|
|
15919
16102
|
}) {
|
|
15920
|
-
const { t } =
|
|
16103
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
15921
16104
|
const has = value !== null && value !== void 0 && value.length > 0;
|
|
15922
16105
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-manifest-section__detail-row", children: [
|
|
15923
16106
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-manifest-section__detail-label", children: label }),
|
|
@@ -15940,7 +16123,7 @@ function TripManifestSection({
|
|
|
15940
16123
|
components,
|
|
15941
16124
|
style
|
|
15942
16125
|
}) {
|
|
15943
|
-
const { t } =
|
|
16126
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
15944
16127
|
const [q, setQ] = react.useState("");
|
|
15945
16128
|
const [groupBy, setGroupBy] = react.useState("booking_group");
|
|
15946
16129
|
const [filters, setFilters] = react.useState({});
|
|
@@ -15969,7 +16152,7 @@ function TripManifestSection({
|
|
|
15969
16152
|
[groupBy, writeToken, wireFilters]
|
|
15970
16153
|
);
|
|
15971
16154
|
const hasActiveFilter = q.length > 0 || Object.keys(filters).length > 0;
|
|
15972
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-manifest-section", style:
|
|
16155
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-manifest-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
15973
16156
|
facets === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(ManifestFacetTiles, { facets, filtered: hasActiveFilter }),
|
|
15974
16157
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-manifest-section__toolbar", children: [
|
|
15975
16158
|
/* @__PURE__ */ jsxRuntime.jsx(ManifestSearchInput, { debounceMs: DEBOUNCE_MS, onDebouncedChange: setQ }),
|
|
@@ -16196,7 +16379,7 @@ function PaymentsSkeleton() {
|
|
|
16196
16379
|
] }, id)) });
|
|
16197
16380
|
}
|
|
16198
16381
|
function PaymentsEmpty({ onRecord }) {
|
|
16199
|
-
const { t } =
|
|
16382
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16200
16383
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-payments-section__state", children: [
|
|
16201
16384
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-payments-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(ReceiptIcon, {}) }),
|
|
16202
16385
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-payments-section__state-title", children: t("chrome.tripPayments.emptyTitle") }),
|
|
@@ -16205,7 +16388,7 @@ function PaymentsEmpty({ onRecord }) {
|
|
|
16205
16388
|
] });
|
|
16206
16389
|
}
|
|
16207
16390
|
function PaymentsFailed({ onRetry }) {
|
|
16208
|
-
const { t } =
|
|
16391
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16209
16392
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-payments-section__state", role: "alert", children: [
|
|
16210
16393
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-payments-section__state-title", children: t("chrome.tripPayments.failedTitle") }),
|
|
16211
16394
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-payments-section__state-body", children: t("chrome.tripPayments.failedBody") }),
|
|
@@ -16213,7 +16396,7 @@ function PaymentsFailed({ onRetry }) {
|
|
|
16213
16396
|
] });
|
|
16214
16397
|
}
|
|
16215
16398
|
function PaymentsDark({ reason }) {
|
|
16216
|
-
const { t } =
|
|
16399
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16217
16400
|
if (reason === "mode") {
|
|
16218
16401
|
return null;
|
|
16219
16402
|
}
|
|
@@ -16234,7 +16417,7 @@ function PaymentsTable({
|
|
|
16234
16417
|
locked,
|
|
16235
16418
|
onVoid
|
|
16236
16419
|
}) {
|
|
16237
|
-
const { t } =
|
|
16420
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16238
16421
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-payments-section__table-wrap", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "kf-trip-payments-section__table", children: [
|
|
16239
16422
|
/* @__PURE__ */ jsxRuntime.jsx("caption", { className: "kf-visually-hidden", children: t("chrome.tripPayments.tableCaption") }),
|
|
16240
16423
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
@@ -16293,7 +16476,7 @@ function RecordPaymentDialog({
|
|
|
16293
16476
|
onClose,
|
|
16294
16477
|
onSubmit
|
|
16295
16478
|
}) {
|
|
16296
|
-
const { t } =
|
|
16479
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16297
16480
|
const titleId = react.useId();
|
|
16298
16481
|
const [travellerId, setTravellerId] = react.useState(null);
|
|
16299
16482
|
const [amount, setAmount] = react.useState("");
|
|
@@ -16468,7 +16651,7 @@ function VoidPaymentDialog({
|
|
|
16468
16651
|
onClose,
|
|
16469
16652
|
onSubmit
|
|
16470
16653
|
}) {
|
|
16471
|
-
const { t } =
|
|
16654
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16472
16655
|
const titleId = react.useId();
|
|
16473
16656
|
const [reason, setReason] = react.useState("");
|
|
16474
16657
|
const trimmed = reason.trim();
|
|
@@ -16546,9 +16729,9 @@ function TripPaymentsSection({
|
|
|
16546
16729
|
balance,
|
|
16547
16730
|
style
|
|
16548
16731
|
}) {
|
|
16549
|
-
const { t } =
|
|
16550
|
-
const collections =
|
|
16551
|
-
const parties =
|
|
16732
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16733
|
+
const collections = chunkA7C74SJT_cjs.useCollections(tripRef);
|
|
16734
|
+
const parties = chunkA7C74SJT_cjs.useParties(tripRef);
|
|
16552
16735
|
const [overlay, setOverlay] = react.useState({ kind: "none" });
|
|
16553
16736
|
const [pending, setPending] = react.useState(false);
|
|
16554
16737
|
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
@@ -16628,7 +16811,7 @@ function TripPaymentsSection({
|
|
|
16628
16811
|
}
|
|
16629
16812
|
const currency = balance?.currency ?? rows[0]?.currency ?? "INR";
|
|
16630
16813
|
const owingCount = eligibleRows.filter((row) => row.outstandingMinor > 0).length;
|
|
16631
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-payments-section", style:
|
|
16814
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-payments-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
16632
16815
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-payments-section__toolbar", children: [
|
|
16633
16816
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-payments-section__toolbar-title", children: t("chrome.tripPayments.panelLabel") }),
|
|
16634
16817
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-payments-section__toolbar-spacer" }),
|
|
@@ -16769,7 +16952,7 @@ function AssignTravellerDialog({
|
|
|
16769
16952
|
onSubmit,
|
|
16770
16953
|
onClose
|
|
16771
16954
|
}) {
|
|
16772
|
-
const { t } =
|
|
16955
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16773
16956
|
const titleId = react.useId();
|
|
16774
16957
|
const [pointId, setPointId] = react.useState(stops[0]?.id ?? "");
|
|
16775
16958
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -16840,7 +17023,7 @@ function BoardingRoster({
|
|
|
16840
17023
|
onRetry,
|
|
16841
17024
|
stops
|
|
16842
17025
|
}) {
|
|
16843
|
-
const { t } =
|
|
17026
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16844
17027
|
if (failed) {
|
|
16845
17028
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-pickups-section__state", role: "alert", children: [
|
|
16846
17029
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-pickups-section__state-title", children: t("chrome.tripPickups.boardingFailedTitle") }),
|
|
@@ -16900,7 +17083,7 @@ function TravellerBoardRow({
|
|
|
16900
17083
|
busy,
|
|
16901
17084
|
onCorrect
|
|
16902
17085
|
}) {
|
|
16903
|
-
const { t } =
|
|
17086
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16904
17087
|
const correctable = occupant.status !== "PENDING";
|
|
16905
17088
|
const next = occupant.status === "BOARDED" ? "NO_SHOW" : "BOARDED";
|
|
16906
17089
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "kf-trip-pickups-section__roster-row", children: [
|
|
@@ -16938,7 +17121,7 @@ function DeleteStopDialog({
|
|
|
16938
17121
|
onDelete,
|
|
16939
17122
|
onClose
|
|
16940
17123
|
}) {
|
|
16941
|
-
const { t } =
|
|
17124
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
16942
17125
|
const titleId = react.useId();
|
|
16943
17126
|
const [target, setTarget] = react.useState(siblings[0]?.id ?? "");
|
|
16944
17127
|
const occupied = stop.expectedCount > 0;
|
|
@@ -17192,7 +17375,7 @@ function PickupsEmpty({
|
|
|
17192
17375
|
kindLabel,
|
|
17193
17376
|
onAdd
|
|
17194
17377
|
}) {
|
|
17195
|
-
const { t } =
|
|
17378
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
17196
17379
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-pickups-section__state", children: [
|
|
17197
17380
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-pickups-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(BusIcon, {}) }),
|
|
17198
17381
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-pickups-section__state-title", children: t("chrome.tripPickups.emptyTitle").replace("{kind}", kindLabel) }),
|
|
@@ -17201,7 +17384,7 @@ function PickupsEmpty({
|
|
|
17201
17384
|
] });
|
|
17202
17385
|
}
|
|
17203
17386
|
function PickupsFailed({ onRetry }) {
|
|
17204
|
-
const { t } =
|
|
17387
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
17205
17388
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-pickups-section__state", role: "alert", children: [
|
|
17206
17389
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-pickups-section__state-title", children: t("chrome.tripPickups.failedTitle") }),
|
|
17207
17390
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-pickups-section__state-body", children: t("chrome.tripPickups.failedBody") }),
|
|
@@ -17209,7 +17392,7 @@ function PickupsFailed({ onRetry }) {
|
|
|
17209
17392
|
] });
|
|
17210
17393
|
}
|
|
17211
17394
|
function PickupsDark({ reason }) {
|
|
17212
|
-
const { t } =
|
|
17395
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
17213
17396
|
if (reason === "mode") {
|
|
17214
17397
|
return null;
|
|
17215
17398
|
}
|
|
@@ -17243,7 +17426,7 @@ function StopFormDialog({
|
|
|
17243
17426
|
onClose,
|
|
17244
17427
|
onSubmit
|
|
17245
17428
|
}) {
|
|
17246
|
-
const { t } =
|
|
17429
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
17247
17430
|
const titleId = react.useId();
|
|
17248
17431
|
const isEdit = stop !== null;
|
|
17249
17432
|
const [kind, setKind] = react.useState(stop?.kind ?? defaultKind);
|
|
@@ -17390,7 +17573,7 @@ function StopFormDialog({
|
|
|
17390
17573
|
);
|
|
17391
17574
|
}
|
|
17392
17575
|
function StopKebab({ stopName, onEdit, onDelete }) {
|
|
17393
|
-
const { t } =
|
|
17576
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
17394
17577
|
const [open, setOpen] = react.useState(false);
|
|
17395
17578
|
const rootRef = react.useRef(null);
|
|
17396
17579
|
const triggerRef = react.useRef(null);
|
|
@@ -17467,7 +17650,7 @@ function StopCard({
|
|
|
17467
17650
|
onDelete,
|
|
17468
17651
|
onMoveBy
|
|
17469
17652
|
}) {
|
|
17470
|
-
const { t } =
|
|
17653
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
17471
17654
|
const isClosed = stop.status === "CLOSED";
|
|
17472
17655
|
const canReorder = !isClosed;
|
|
17473
17656
|
const percent = boardedPercent(stop);
|
|
@@ -17615,7 +17798,7 @@ function Segment({
|
|
|
17615
17798
|
value,
|
|
17616
17799
|
onChange
|
|
17617
17800
|
}) {
|
|
17618
|
-
const { t } =
|
|
17801
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
17619
17802
|
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "kf-trip-pickups-section__segment", children: [
|
|
17620
17803
|
/* @__PURE__ */ jsxRuntime.jsx("legend", { className: "kf-visually-hidden", children: t(legendKey) }),
|
|
17621
17804
|
options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -17678,8 +17861,8 @@ function TripPickupsSection({
|
|
|
17678
17861
|
tripStartIso,
|
|
17679
17862
|
style
|
|
17680
17863
|
}) {
|
|
17681
|
-
const { t } =
|
|
17682
|
-
const pickups =
|
|
17864
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
17865
|
+
const pickups = chunkA7C74SJT_cjs.usePickups(tripRef);
|
|
17683
17866
|
const [kind, setKind] = react.useState("PICKUP");
|
|
17684
17867
|
const [view, setView] = react.useState("stops");
|
|
17685
17868
|
const [overlay, setOverlay] = react.useState({ kind: "none" });
|
|
@@ -17839,7 +18022,7 @@ function TripPickupsSection({
|
|
|
17839
18022
|
const kindLabel = t(
|
|
17840
18023
|
kind === "PICKUP" ? "chrome.tripPickups.kindPickupOne" : "chrome.tripPickups.kindDropOne"
|
|
17841
18024
|
);
|
|
17842
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-pickups-section", style:
|
|
18025
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-pickups-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
17843
18026
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-pickups-section__toolbar", children: [
|
|
17844
18027
|
/* @__PURE__ */ jsxRuntime.jsx(ViewSwitcher, { value: view, onChange: setView }),
|
|
17845
18028
|
/* @__PURE__ */ jsxRuntime.jsx(KindSwitcher, { value: kind, onChange: setKind }),
|
|
@@ -18062,7 +18245,7 @@ function AutoAssignDialog({
|
|
|
18062
18245
|
onApply,
|
|
18063
18246
|
onClose
|
|
18064
18247
|
}) {
|
|
18065
|
-
const { t } =
|
|
18248
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18066
18249
|
const titleId = react.useId();
|
|
18067
18250
|
const [reassignAll, setReassignAll] = react.useState(false);
|
|
18068
18251
|
const roomCodeById = new Map(group.rooms.map((room) => [room.id, room.code]));
|
|
@@ -18157,7 +18340,7 @@ function AutoAssignDialog({
|
|
|
18157
18340
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-rooming-section__plan", children: [
|
|
18158
18341
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-rooming-section__plan-title", children: t("chrome.tripRooming.rulesTitle") }),
|
|
18159
18342
|
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "kf-trip-rooming-section__rule-list", children: preview.perRule.map((entry) => {
|
|
18160
|
-
const severity =
|
|
18343
|
+
const severity = chunkA7C74SJT_cjs.roomingHeuristicSeverity(entry.rule);
|
|
18161
18344
|
const relaxed = entry.outcome === "relaxed";
|
|
18162
18345
|
const violation = relaxed && severity === "never";
|
|
18163
18346
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -18203,7 +18386,7 @@ function DeleteShell({
|
|
|
18203
18386
|
onConfirm,
|
|
18204
18387
|
onClose
|
|
18205
18388
|
}) {
|
|
18206
|
-
const { t } =
|
|
18389
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18207
18390
|
const titleId = react.useId();
|
|
18208
18391
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18209
18392
|
SheetDialog,
|
|
@@ -18249,7 +18432,7 @@ function DeleteRoomDialog({
|
|
|
18249
18432
|
onConfirm,
|
|
18250
18433
|
onClose
|
|
18251
18434
|
}) {
|
|
18252
|
-
const { t } =
|
|
18435
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18253
18436
|
const occupied = room.beds.filter((bed) => bed.occupant !== null).length;
|
|
18254
18437
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18255
18438
|
DeleteShell,
|
|
@@ -18275,7 +18458,7 @@ function DeleteWindowDialog({
|
|
|
18275
18458
|
onConfirm,
|
|
18276
18459
|
onClose
|
|
18277
18460
|
}) {
|
|
18278
|
-
const { t } =
|
|
18461
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18279
18462
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18280
18463
|
DeleteShell,
|
|
18281
18464
|
{
|
|
@@ -18373,15 +18556,15 @@ function roomTypeLabelKey(roomType) {
|
|
|
18373
18556
|
return ROOM_TYPE_LABEL_KEY[roomType] ?? "chrome.tripRooming.roomType.shared";
|
|
18374
18557
|
}
|
|
18375
18558
|
function toneAttrs(tone) {
|
|
18376
|
-
const parsed =
|
|
18559
|
+
const parsed = chunkA7C74SJT_cjs.parseRoomingTone(tone);
|
|
18377
18560
|
if (parsed === void 0) {
|
|
18378
|
-
return { family:
|
|
18561
|
+
return { family: chunkA7C74SJT_cjs.TONE_FAMILIES.UNKNOWN, shade: 0 };
|
|
18379
18562
|
}
|
|
18380
|
-
const shade = parsed.shade <
|
|
18563
|
+
const shade = parsed.shade < chunkA7C74SJT_cjs.SHADES_PER_FAMILY ? parsed.shade : parsed.shade % chunkA7C74SJT_cjs.SHADES_PER_FAMILY;
|
|
18381
18564
|
return { family: parsed.family, shade };
|
|
18382
18565
|
}
|
|
18383
18566
|
function glyphOf(occupant) {
|
|
18384
|
-
return occupant.glyph === "" ?
|
|
18567
|
+
return occupant.glyph === "" ? chunkA7C74SJT_cjs.FALLBACK_GLYPH : occupant.glyph;
|
|
18385
18568
|
}
|
|
18386
18569
|
function TravellerGlyph({
|
|
18387
18570
|
occupant,
|
|
@@ -18419,7 +18602,7 @@ var COLLAPSED_COUNT = 10;
|
|
|
18419
18602
|
function IdentityLegend({
|
|
18420
18603
|
occupants
|
|
18421
18604
|
}) {
|
|
18422
|
-
const { t } =
|
|
18605
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18423
18606
|
const [open, setOpen] = react.useState(false);
|
|
18424
18607
|
if (occupants.length === 0) {
|
|
18425
18608
|
return null;
|
|
@@ -18546,7 +18729,7 @@ function RoomFormDialog({
|
|
|
18546
18729
|
onClose,
|
|
18547
18730
|
onSubmit
|
|
18548
18731
|
}) {
|
|
18549
|
-
const { t } =
|
|
18732
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18550
18733
|
const titleId = react.useId();
|
|
18551
18734
|
const isEdit = room !== null;
|
|
18552
18735
|
const [code, setCode] = react.useState(room?.code ?? "");
|
|
@@ -18670,7 +18853,7 @@ function RoomingSkeleton() {
|
|
|
18670
18853
|
] }, id)) });
|
|
18671
18854
|
}
|
|
18672
18855
|
function RoomingEmpty({ onAddWindow }) {
|
|
18673
|
-
const { t } =
|
|
18856
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18674
18857
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-rooming-section__state", children: [
|
|
18675
18858
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-rooming-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(BedIcon, {}) }),
|
|
18676
18859
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-rooming-section__state-title", children: t("chrome.tripRooming.emptyTitle") }),
|
|
@@ -18679,7 +18862,7 @@ function RoomingEmpty({ onAddWindow }) {
|
|
|
18679
18862
|
] });
|
|
18680
18863
|
}
|
|
18681
18864
|
function RoomingFailed({ onRetry }) {
|
|
18682
|
-
const { t } =
|
|
18865
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18683
18866
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-rooming-section__state", role: "alert", children: [
|
|
18684
18867
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-rooming-section__state-title", children: t("chrome.tripRooming.failedTitle") }),
|
|
18685
18868
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-rooming-section__state-body", children: t("chrome.tripRooming.failedBody") }),
|
|
@@ -18687,7 +18870,7 @@ function RoomingFailed({ onRetry }) {
|
|
|
18687
18870
|
] });
|
|
18688
18871
|
}
|
|
18689
18872
|
function RoomingDark({ reason }) {
|
|
18690
|
-
const { t } =
|
|
18873
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18691
18874
|
if (reason === "mode") {
|
|
18692
18875
|
return null;
|
|
18693
18876
|
}
|
|
@@ -18702,7 +18885,7 @@ function RoomingDark({ reason }) {
|
|
|
18702
18885
|
] });
|
|
18703
18886
|
}
|
|
18704
18887
|
function RoomKebab({ roomCode, onEdit, onDelete }) {
|
|
18705
|
-
const { t } =
|
|
18888
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18706
18889
|
const [open, setOpen] = react.useState(false);
|
|
18707
18890
|
const rootRef = react.useRef(null);
|
|
18708
18891
|
const triggerRef = react.useRef(null);
|
|
@@ -18767,7 +18950,7 @@ function RoomKebab({ roomCode, onEdit, onDelete }) {
|
|
|
18767
18950
|
] });
|
|
18768
18951
|
}
|
|
18769
18952
|
function RoomCard({ room, drag, busy, onEdit, onDelete }) {
|
|
18770
|
-
const { t } =
|
|
18953
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18771
18954
|
const occupied = room.beds.filter((bed) => bed.occupant !== null).length;
|
|
18772
18955
|
return /* @__PURE__ */ jsxRuntime.jsxs("article", { className: "kf-trip-rooming-section__room", "data-busy": busy ? "true" : void 0, children: [
|
|
18773
18956
|
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "kf-trip-rooming-section__room-head", children: [
|
|
@@ -18817,7 +19000,7 @@ function UnassignedStrip({
|
|
|
18817
19000
|
drag,
|
|
18818
19001
|
busy
|
|
18819
19002
|
}) {
|
|
18820
|
-
const { t } =
|
|
19003
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18821
19004
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18822
19005
|
"div",
|
|
18823
19006
|
{
|
|
@@ -18891,7 +19074,7 @@ function WindowAccordion({
|
|
|
18891
19074
|
onEditRoom,
|
|
18892
19075
|
onDeleteRoom
|
|
18893
19076
|
}) {
|
|
18894
|
-
const { t } =
|
|
19077
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
18895
19078
|
const percent = fillPercent(group);
|
|
18896
19079
|
const bodyId = `kf-rooming-window-${group.window.id}`;
|
|
18897
19080
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -19041,7 +19224,7 @@ function WindowFormDialog({
|
|
|
19041
19224
|
onClose,
|
|
19042
19225
|
onSubmit
|
|
19043
19226
|
}) {
|
|
19044
|
-
const { t } =
|
|
19227
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19045
19228
|
const titleId = react.useId();
|
|
19046
19229
|
const isEdit = window !== null;
|
|
19047
19230
|
const [label, setLabel] = react.useState(window?.label ?? "");
|
|
@@ -19154,8 +19337,8 @@ function TripRoomingSection({
|
|
|
19154
19337
|
tripEndIso,
|
|
19155
19338
|
style
|
|
19156
19339
|
}) {
|
|
19157
|
-
const { t } =
|
|
19158
|
-
const rooming =
|
|
19340
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19341
|
+
const rooming = chunkA7C74SJT_cjs.useRooming(tripRef);
|
|
19159
19342
|
const [openWindowId, setOpenWindowId] = react.useState(null);
|
|
19160
19343
|
const [overlay, setOverlay] = react.useState({ kind: "none" });
|
|
19161
19344
|
const [pending, setPending] = react.useState(false);
|
|
@@ -19293,7 +19476,7 @@ function TripRoomingSection({
|
|
|
19293
19476
|
return /* @__PURE__ */ jsxRuntime.jsx(RoomingDark, { reason: rooming.reason });
|
|
19294
19477
|
}
|
|
19295
19478
|
const pool = ready?.unassignedPool;
|
|
19296
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-rooming-section", style:
|
|
19479
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-rooming-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
19297
19480
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-rooming-section__toolbar", children: [
|
|
19298
19481
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-rooming-section__toolbar-title", children: t("chrome.tripRooming.panelLabel") }),
|
|
19299
19482
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-rooming-section__toolbar-spacer" }),
|
|
@@ -19338,7 +19521,7 @@ function TripRoomingSection({
|
|
|
19338
19521
|
group,
|
|
19339
19522
|
expanded: openWindowId === group.window.id,
|
|
19340
19523
|
unassigned: pool === void 0 ? [] : pool.travellers,
|
|
19341
|
-
unassignedLoaded: pool
|
|
19524
|
+
unassignedLoaded: pool?.loaded === true,
|
|
19342
19525
|
drag,
|
|
19343
19526
|
busy,
|
|
19344
19527
|
onToggle: () => setOpenWindowId((current) => current === group.window.id ? null : group.window.id),
|
|
@@ -19527,7 +19710,7 @@ function isAgencyAuthored(vendor) {
|
|
|
19527
19710
|
return vendor.externalId.startsWith("kf-");
|
|
19528
19711
|
}
|
|
19529
19712
|
function CategoryTabs({ selected, counts, total, onSelect }) {
|
|
19530
|
-
const { t } =
|
|
19713
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19531
19714
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-suppliers-section__chips", children: [
|
|
19532
19715
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19533
19716
|
"button",
|
|
@@ -19570,7 +19753,7 @@ function DeleteSupplierDialog({
|
|
|
19570
19753
|
onConfirm,
|
|
19571
19754
|
onClose
|
|
19572
19755
|
}) {
|
|
19573
|
-
const { t } =
|
|
19756
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19574
19757
|
const titleId = react.useId();
|
|
19575
19758
|
const blockers = deleteBlockers(usage);
|
|
19576
19759
|
const blockedLocally = blockers !== void 0 && blockers.vehicles + blockers.expenses > 0;
|
|
@@ -19723,7 +19906,7 @@ function SupplierFormDialog({
|
|
|
19723
19906
|
onClose,
|
|
19724
19907
|
onSubmit
|
|
19725
19908
|
}) {
|
|
19726
|
-
const { t } =
|
|
19909
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19727
19910
|
const titleId = react.useId();
|
|
19728
19911
|
const isEdit = supplier !== null;
|
|
19729
19912
|
const [name, setName] = react.useState(supplier?.name ?? "");
|
|
@@ -19845,7 +20028,7 @@ function SuppliersSkeleton() {
|
|
|
19845
20028
|
] }, id)) });
|
|
19846
20029
|
}
|
|
19847
20030
|
function SuppliersEmpty({ onAdd }) {
|
|
19848
|
-
const { t } =
|
|
20031
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19849
20032
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-suppliers-section__state", children: [
|
|
19850
20033
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-suppliers-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(StorefrontIcon, {}) }),
|
|
19851
20034
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-suppliers-section__state-title", children: t("chrome.tripSuppliers.emptyTitle") }),
|
|
@@ -19854,7 +20037,7 @@ function SuppliersEmpty({ onAdd }) {
|
|
|
19854
20037
|
] });
|
|
19855
20038
|
}
|
|
19856
20039
|
function SuppliersNoMatch({ onClear }) {
|
|
19857
|
-
const { t } =
|
|
20040
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19858
20041
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-suppliers-section__state", children: [
|
|
19859
20042
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-suppliers-section__state-title", children: t("chrome.tripSuppliers.noMatchTitle") }),
|
|
19860
20043
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-suppliers-section__state-body", children: t("chrome.tripSuppliers.noMatchBody") }),
|
|
@@ -19862,7 +20045,7 @@ function SuppliersNoMatch({ onClear }) {
|
|
|
19862
20045
|
] });
|
|
19863
20046
|
}
|
|
19864
20047
|
function SuppliersFailed({ onRetry }) {
|
|
19865
|
-
const { t } =
|
|
20048
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19866
20049
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-suppliers-section__state", role: "alert", children: [
|
|
19867
20050
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-suppliers-section__state-title", children: t("chrome.tripSuppliers.failedTitle") }),
|
|
19868
20051
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-suppliers-section__state-body", children: t("chrome.tripSuppliers.failedBody") }),
|
|
@@ -19870,7 +20053,7 @@ function SuppliersFailed({ onRetry }) {
|
|
|
19870
20053
|
] });
|
|
19871
20054
|
}
|
|
19872
20055
|
function SuppliersDark({ reason }) {
|
|
19873
|
-
const { t } =
|
|
20056
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19874
20057
|
if (reason === "mode") {
|
|
19875
20058
|
return null;
|
|
19876
20059
|
}
|
|
@@ -19885,7 +20068,7 @@ function SuppliersDark({ reason }) {
|
|
|
19885
20068
|
] });
|
|
19886
20069
|
}
|
|
19887
20070
|
function SupplierKebab({ name, busy, onEdit, onDelete }) {
|
|
19888
|
-
const { t } =
|
|
20071
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19889
20072
|
const [open, setOpen] = react.useState(false);
|
|
19890
20073
|
const rootRef = react.useRef(null);
|
|
19891
20074
|
const triggerRef = react.useRef(null);
|
|
@@ -19952,7 +20135,7 @@ function SupplierKebab({ name, busy, onEdit, onDelete }) {
|
|
|
19952
20135
|
] });
|
|
19953
20136
|
}
|
|
19954
20137
|
function SupplierUsageCell({ usage }) {
|
|
19955
|
-
const { t } =
|
|
20138
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
19956
20139
|
const parts = [];
|
|
19957
20140
|
if (usage.vehicles !== void 0 && usage.vehicles > 0) {
|
|
19958
20141
|
parts.push(
|
|
@@ -19996,7 +20179,7 @@ function SupplierTable({
|
|
|
19996
20179
|
onEdit,
|
|
19997
20180
|
onDelete
|
|
19998
20181
|
}) {
|
|
19999
|
-
const { t } =
|
|
20182
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20000
20183
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-suppliers-section__table-wrap", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "kf-trip-suppliers-section__table", children: [
|
|
20001
20184
|
/* @__PURE__ */ jsxRuntime.jsx("caption", { className: "kf-visually-hidden", children: t("chrome.tripSuppliers.tableCaption") }),
|
|
20002
20185
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
@@ -20064,11 +20247,11 @@ function serverBlockOf(error) {
|
|
|
20064
20247
|
return { vehicles: details.vehicleCount ?? 0, expenses: details.expenseCount ?? 0 };
|
|
20065
20248
|
}
|
|
20066
20249
|
function TripSuppliersSection({ tripRef, style }) {
|
|
20067
|
-
const { t } =
|
|
20068
|
-
const vendors =
|
|
20069
|
-
const seating =
|
|
20070
|
-
const itinerary =
|
|
20071
|
-
const expenses =
|
|
20250
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20251
|
+
const vendors = chunkA7C74SJT_cjs.useVendors(tripRef, "");
|
|
20252
|
+
const seating = chunkA7C74SJT_cjs.useSeating(tripRef);
|
|
20253
|
+
const itinerary = chunkA7C74SJT_cjs.useItinerary(tripRef);
|
|
20254
|
+
const expenses = chunkA7C74SJT_cjs.useExpenses(tripRef);
|
|
20072
20255
|
const [category, setCategory] = react.useState(null);
|
|
20073
20256
|
const [query, setQuery] = react.useState("");
|
|
20074
20257
|
const [sortKey, setSortKey] = react.useState("name");
|
|
@@ -20151,7 +20334,7 @@ function TripSuppliersSection({ tripRef, style }) {
|
|
|
20151
20334
|
return /* @__PURE__ */ jsxRuntime.jsx(SuppliersDark, { reason: vendors.reason });
|
|
20152
20335
|
}
|
|
20153
20336
|
const filtered = category !== null || query.trim() !== "";
|
|
20154
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-suppliers-section", style:
|
|
20337
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-suppliers-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
20155
20338
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-suppliers-section__toolbar", children: [
|
|
20156
20339
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-suppliers-section__toolbar-title", children: t("chrome.tripSuppliers.panelLabel") }),
|
|
20157
20340
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-suppliers-section__toolbar-spacer" }),
|
|
@@ -20290,7 +20473,7 @@ function AutoAssignDialog2({
|
|
|
20290
20473
|
onApply,
|
|
20291
20474
|
onClose
|
|
20292
20475
|
}) {
|
|
20293
|
-
const { t } =
|
|
20476
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20294
20477
|
const titleId = react.useId();
|
|
20295
20478
|
const [reassignAll, setReassignAll] = react.useState(false);
|
|
20296
20479
|
const [genderAdjacency, setGenderAdjacency] = react.useState("AVOID_UNRELATED");
|
|
@@ -20452,7 +20635,7 @@ function DayFilter({
|
|
|
20452
20635
|
countByDay,
|
|
20453
20636
|
onSelect
|
|
20454
20637
|
}) {
|
|
20455
|
-
const { t } =
|
|
20638
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20456
20639
|
const days = Array.from({ length: durationDays }, (_unused, index) => index);
|
|
20457
20640
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-vehicles-section__days", children: [
|
|
20458
20641
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-vehicles-section__days-label", children: t("chrome.tripVehicles.showDay") }),
|
|
@@ -20585,7 +20768,7 @@ function DeleteVehicleDialog({
|
|
|
20585
20768
|
onConfirm,
|
|
20586
20769
|
onClose
|
|
20587
20770
|
}) {
|
|
20588
|
-
const { t } =
|
|
20771
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20589
20772
|
const titleId = react.useId();
|
|
20590
20773
|
const released = occupantsOf(vehicle).length;
|
|
20591
20774
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -20762,7 +20945,7 @@ function ManagerLinkDialog({
|
|
|
20762
20945
|
onClose,
|
|
20763
20946
|
onSubmit
|
|
20764
20947
|
}) {
|
|
20765
|
-
const { t } =
|
|
20948
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20766
20949
|
const titleId = react.useId();
|
|
20767
20950
|
const [chosen, setChosen] = react.useState(null);
|
|
20768
20951
|
const demotedFrom = chosen === null ? void 0 : managerVehicleByRef.get(chosen);
|
|
@@ -20839,7 +21022,7 @@ function UnassignedStrip2({
|
|
|
20839
21022
|
drag,
|
|
20840
21023
|
busy
|
|
20841
21024
|
}) {
|
|
20842
|
-
const { t } =
|
|
21025
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20843
21026
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20844
21027
|
"div",
|
|
20845
21028
|
{
|
|
@@ -20906,7 +21089,7 @@ function OccupantRoster({
|
|
|
20906
21089
|
variant,
|
|
20907
21090
|
emptyKey
|
|
20908
21091
|
}) {
|
|
20909
|
-
const { t } =
|
|
21092
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20910
21093
|
const target = { containerId: vehicleId, slotLabel: "" };
|
|
20911
21094
|
const isOver = drag.overSlot !== null && drag.overSlot.containerId === vehicleId && drag.overSlot.slotLabel === "";
|
|
20912
21095
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -20950,7 +21133,7 @@ function OccupantRoster({
|
|
|
20950
21133
|
);
|
|
20951
21134
|
}
|
|
20952
21135
|
function SeatTile({ seat, vehicleId, drag, busy }) {
|
|
20953
|
-
const { t } =
|
|
21136
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
20954
21137
|
const target = { containerId: vehicleId, slotLabel: seat.seatLabel };
|
|
20955
21138
|
const isOver = drag.overSlot !== null && drag.overSlot.containerId === target.containerId && drag.overSlot.slotLabel === target.slotLabel;
|
|
20956
21139
|
const occupant = seat.occupant;
|
|
@@ -21013,7 +21196,7 @@ function VehicleKebab({
|
|
|
21013
21196
|
onUnlinkManager,
|
|
21014
21197
|
onDelete
|
|
21015
21198
|
}) {
|
|
21016
|
-
const { t } =
|
|
21199
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
21017
21200
|
const [open, setOpen] = react.useState(false);
|
|
21018
21201
|
const rootRef = react.useRef(null);
|
|
21019
21202
|
const triggerRef = react.useRef(null);
|
|
@@ -21123,7 +21306,7 @@ function VehicleCard({
|
|
|
21123
21306
|
onUnlinkManager,
|
|
21124
21307
|
onDelete
|
|
21125
21308
|
}) {
|
|
21126
|
-
const { t } =
|
|
21309
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
21127
21310
|
const percent = fillPercent2(vehicle);
|
|
21128
21311
|
const days = daysLabel(vehicle.days);
|
|
21129
21312
|
const bodyId = `kf-vehicle-${vehicle.id}`;
|
|
@@ -21258,7 +21441,7 @@ function VehicleDaysDialog({
|
|
|
21258
21441
|
onClose,
|
|
21259
21442
|
onSubmit
|
|
21260
21443
|
}) {
|
|
21261
|
-
const { t } =
|
|
21444
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
21262
21445
|
const titleId = react.useId();
|
|
21263
21446
|
const [selected, setSelected] = react.useState(vehicle.days);
|
|
21264
21447
|
const wholeTrip = selected.length === 0;
|
|
@@ -21357,7 +21540,7 @@ function VehicleFormDialog({
|
|
|
21357
21540
|
onClose,
|
|
21358
21541
|
onSubmit
|
|
21359
21542
|
}) {
|
|
21360
|
-
const { t } =
|
|
21543
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
21361
21544
|
const titleId = react.useId();
|
|
21362
21545
|
const isEdit = vehicle !== null;
|
|
21363
21546
|
const [regNo, setRegNo] = react.useState(vehicle?.regNo ?? "");
|
|
@@ -21372,7 +21555,7 @@ function VehicleFormDialog({
|
|
|
21372
21555
|
const capacityValue = Number(capacity);
|
|
21373
21556
|
const capacityOk = Number.isInteger(capacityValue) && capacityValue >= 1 && capacityValue <= MAX_CAPACITY2;
|
|
21374
21557
|
const occupiedBeyond = vehicle === null || !vehicle.seatMapped || !capacityOk ? 0 : vehicle.seats.filter((seat, index) => seat.occupant !== null && index >= capacityValue).length;
|
|
21375
|
-
const dropsSeatMap = vehicle
|
|
21558
|
+
const dropsSeatMap = vehicle?.seatMapped === true && layout === null;
|
|
21376
21559
|
const seatedCount = vehicle === null || !vehicle.seatMapped ? 0 : vehicle.seats.filter((seat) => seat.occupant !== null).length;
|
|
21377
21560
|
const canSubmit = trimmedReg.length >= 1 && capacityOk && !pending;
|
|
21378
21561
|
const emptyToNull = (value) => {
|
|
@@ -21552,7 +21735,7 @@ function VehiclesSkeleton() {
|
|
|
21552
21735
|
] }, id)) });
|
|
21553
21736
|
}
|
|
21554
21737
|
function VehiclesEmpty({ onAddVehicle }) {
|
|
21555
|
-
const { t } =
|
|
21738
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
21556
21739
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-vehicles-section__state", children: [
|
|
21557
21740
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-vehicles-section__state-glyph", children: /* @__PURE__ */ jsxRuntime.jsx(BusIcon2, {}) }),
|
|
21558
21741
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-vehicles-section__state-title", children: t("chrome.tripVehicles.emptyTitle") }),
|
|
@@ -21561,7 +21744,7 @@ function VehiclesEmpty({ onAddVehicle }) {
|
|
|
21561
21744
|
] });
|
|
21562
21745
|
}
|
|
21563
21746
|
function VehiclesFailed({ onRetry }) {
|
|
21564
|
-
const { t } =
|
|
21747
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
21565
21748
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-vehicles-section__state", role: "alert", children: [
|
|
21566
21749
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-vehicles-section__state-title", children: t("chrome.tripVehicles.failedTitle") }),
|
|
21567
21750
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-vehicles-section__state-body", children: t("chrome.tripVehicles.failedBody") }),
|
|
@@ -21569,7 +21752,7 @@ function VehiclesFailed({ onRetry }) {
|
|
|
21569
21752
|
] });
|
|
21570
21753
|
}
|
|
21571
21754
|
function VehiclesDark({ reason }) {
|
|
21572
|
-
const { t } =
|
|
21755
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
21573
21756
|
if (reason === "mode") {
|
|
21574
21757
|
return null;
|
|
21575
21758
|
}
|
|
@@ -21592,9 +21775,9 @@ function TripVehiclesSection({
|
|
|
21592
21775
|
durationDays,
|
|
21593
21776
|
style
|
|
21594
21777
|
}) {
|
|
21595
|
-
const { t } =
|
|
21596
|
-
const seating =
|
|
21597
|
-
const managers =
|
|
21778
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
21779
|
+
const seating = chunkA7C74SJT_cjs.useSeating(tripRef);
|
|
21780
|
+
const managers = chunkA7C74SJT_cjs.useManagers(tripRef);
|
|
21598
21781
|
const [openVehicleId, setOpenVehicleId] = react.useState(null);
|
|
21599
21782
|
const [day, setDay] = react.useState(null);
|
|
21600
21783
|
const [overlay, setOverlay] = react.useState({ kind: "none" });
|
|
@@ -21728,7 +21911,7 @@ function TripVehiclesSection({
|
|
|
21728
21911
|
return /* @__PURE__ */ jsxRuntime.jsx(VehiclesDark, { reason: seating.reason });
|
|
21729
21912
|
}
|
|
21730
21913
|
const pool = ready?.unassignedPool;
|
|
21731
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-vehicles-section", style:
|
|
21914
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-vehicles-section", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
21732
21915
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-vehicles-section__toolbar", children: [
|
|
21733
21916
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-vehicles-section__toolbar-title", children: t("chrome.tripVehicles.panelLabel") }),
|
|
21734
21917
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-vehicles-section__toolbar-spacer" }),
|
|
@@ -22021,7 +22204,7 @@ function WarningIcon13(props) {
|
|
|
22021
22204
|
|
|
22022
22205
|
// src/admin/composite/office/TripWorkspace/internal/panels/deriveCloseout.ts
|
|
22023
22206
|
function tabForBlocker(row) {
|
|
22024
|
-
return
|
|
22207
|
+
return chunkXBLAVNP3_cjs.resolveBlockerDeepLink({ actionKey: row.actionKey })?.tab;
|
|
22025
22208
|
}
|
|
22026
22209
|
function orderedBlockers(rows) {
|
|
22027
22210
|
return [...rows].sort((a, b) => {
|
|
@@ -22061,8 +22244,8 @@ function codeOf11(error) {
|
|
|
22061
22244
|
return classification?.code ?? "unknown";
|
|
22062
22245
|
}
|
|
22063
22246
|
function CloseoutCard({ tripRef, onOpenTab, litTabs }) {
|
|
22064
|
-
const { t } =
|
|
22065
|
-
const closeout =
|
|
22247
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22248
|
+
const closeout = chunkA7C74SJT_cjs.useCloseout(tripRef);
|
|
22066
22249
|
const [note, setNote] = react.useState(null);
|
|
22067
22250
|
const [pending, setPending] = react.useState(void 0);
|
|
22068
22251
|
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
@@ -22269,7 +22452,7 @@ function AssignManagerDialog({
|
|
|
22269
22452
|
onClose,
|
|
22270
22453
|
onAssign
|
|
22271
22454
|
}) {
|
|
22272
|
-
const { t } =
|
|
22455
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22273
22456
|
const titleId = react.useId();
|
|
22274
22457
|
const [query, setQuery] = react.useState("");
|
|
22275
22458
|
const [selected, setSelected] = react.useState(null);
|
|
@@ -22401,8 +22584,8 @@ var ROLE_LABEL_KEY = {
|
|
|
22401
22584
|
COORDINATOR: "chrome.tripWorkspace.managers.roleCoordinator"
|
|
22402
22585
|
};
|
|
22403
22586
|
function OverviewManagersCard({ trip, onChanged }) {
|
|
22404
|
-
const { t } =
|
|
22405
|
-
const { promoteManager, assignManager, unassignManager, makeManagersFetch } =
|
|
22587
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22588
|
+
const { promoteManager, assignManager, unassignManager, makeManagersFetch } = chunkXBLAVNP3_cjs.useDirectories();
|
|
22406
22589
|
const [pendingId, setPendingId] = react.useState(void 0);
|
|
22407
22590
|
const [errorCode, setErrorCode] = react.useState(void 0);
|
|
22408
22591
|
const [assignOpen, setAssignOpen] = react.useState(false);
|
|
@@ -22563,13 +22746,13 @@ function TripOverviewPanel({
|
|
|
22563
22746
|
onOpenTab,
|
|
22564
22747
|
onTripChanged
|
|
22565
22748
|
}) {
|
|
22566
|
-
const { t } =
|
|
22567
|
-
const today =
|
|
22568
|
-
const expenses =
|
|
22749
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22750
|
+
const today = chunkA7C74SJT_cjs.useManagerToday(trip.ref);
|
|
22751
|
+
const expenses = chunkA7C74SJT_cjs.useExpenses(trip.ref);
|
|
22569
22752
|
const spendTotalMinor = expenses.status === "ready" && expenses.totals.loaded && !expenses.totals.lastFetchFailed ? expenses.totals.spendTotalMinor : void 0;
|
|
22570
22753
|
const finance = deriveFinance(trip, spendTotalMinor);
|
|
22571
22754
|
const quickActions = QUICK_ACTION_TABS.filter((key) => litTabs.has(key));
|
|
22572
|
-
const closeoutProbe =
|
|
22755
|
+
const closeoutProbe = chunkA7C74SJT_cjs.useCloseout(trip.ref);
|
|
22573
22756
|
const closeoutStage = closeoutProbe.status === "ready" && hasReturned(closeoutProbe.aggregate) ? closeoutProbe.aggregate?.stage ?? null : null;
|
|
22574
22757
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__overview", children: [
|
|
22575
22758
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__overview-main", children: [
|
|
@@ -22608,7 +22791,7 @@ function TripOverviewPanel({
|
|
|
22608
22791
|
function TodayCard({
|
|
22609
22792
|
today
|
|
22610
22793
|
}) {
|
|
22611
|
-
const { t } =
|
|
22794
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22612
22795
|
if (today.kind === "idle") return null;
|
|
22613
22796
|
const openChecklist = today.checklist ?? [];
|
|
22614
22797
|
const itinerary = today.itinerary ?? [];
|
|
@@ -22632,7 +22815,7 @@ function TodayCard({
|
|
|
22632
22815
|
function FinanceCard({
|
|
22633
22816
|
finance
|
|
22634
22817
|
}) {
|
|
22635
|
-
const { t } =
|
|
22818
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22636
22819
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-workspace__card", children: [
|
|
22637
22820
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-workspace__card-head", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "kf-trip-workspace__card-title", children: t("chrome.tripWorkspace.overview.financeTitle") }) }),
|
|
22638
22821
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__finance-body", children: [
|
|
@@ -22869,14 +23052,13 @@ function resolveTripTabs(eventType, capabilityStatuses) {
|
|
|
22869
23052
|
if (TAB_BLOCKER[key] === "deferred") continue;
|
|
22870
23053
|
const capability = TAB_CAPABILITY[key];
|
|
22871
23054
|
if (capability === null) {
|
|
22872
|
-
tabs.push({ key,
|
|
23055
|
+
tabs.push({ key, blocker: TAB_BLOCKER[key] });
|
|
22873
23056
|
continue;
|
|
22874
23057
|
}
|
|
22875
23058
|
const status = capabilityStatuses.get(capability);
|
|
22876
23059
|
if (status === "mode-dark") continue;
|
|
22877
23060
|
tabs.push({
|
|
22878
23061
|
key,
|
|
22879
|
-
lit: status === "lit",
|
|
22880
23062
|
// A tab that is off for a capability reason reports THAT, not the
|
|
22881
23063
|
// build-state blocker — the capability is the operative truth, and it
|
|
22882
23064
|
// is the one the operator can act on (upgrade the plan, push the rows).
|
|
@@ -22896,7 +23078,7 @@ var BLOCKER_BODY_KEY = {
|
|
|
22896
23078
|
capabilityDark: "chrome.tripWorkspace.blocker.capabilityDarkBody"
|
|
22897
23079
|
};
|
|
22898
23080
|
function TripTabPlaceholder({ tabKey, blocker }) {
|
|
22899
|
-
const { t } =
|
|
23081
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22900
23082
|
const label = t(TAB_LABEL_KEY[tabKey]);
|
|
22901
23083
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__placeholder", children: [
|
|
22902
23084
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-trip-workspace__placeholder-glyph", children: blocker === "deferred" ? /* @__PURE__ */ jsxRuntime.jsx(ClockIcon2, {}) : /* @__PURE__ */ jsxRuntime.jsx(LockIcon11, {}) }),
|
|
@@ -22906,7 +23088,7 @@ function TripTabPlaceholder({ tabKey, blocker }) {
|
|
|
22906
23088
|
] });
|
|
22907
23089
|
}
|
|
22908
23090
|
function TripKpiStrip({ cells }) {
|
|
22909
|
-
const { t } =
|
|
23091
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22910
23092
|
if (cells.length === 0) return null;
|
|
22911
23093
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-workspace__kpi-strip", "data-columns": cells.length, children: cells.map((cell) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__kpi-card", children: [
|
|
22912
23094
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-workspace__kpi-label", children: t(cell.labelKey) }),
|
|
@@ -22915,7 +23097,7 @@ function TripKpiStrip({ cells }) {
|
|
|
22915
23097
|
] }, cell.key)) });
|
|
22916
23098
|
}
|
|
22917
23099
|
function TripTabRail({ tabs, activeKey, onSelect }) {
|
|
22918
|
-
const { t } =
|
|
23100
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22919
23101
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22920
23102
|
"div",
|
|
22921
23103
|
{
|
|
@@ -22924,17 +23106,13 @@ function TripTabRail({ tabs, activeKey, onSelect }) {
|
|
|
22924
23106
|
"aria-label": t("chrome.tripWorkspace.tabRailLegend"),
|
|
22925
23107
|
children: tabs.map((tab) => {
|
|
22926
23108
|
const isActive = tab.key === activeKey;
|
|
22927
|
-
const isDark = !tab.lit;
|
|
22928
23109
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22929
23110
|
"button",
|
|
22930
23111
|
{
|
|
22931
23112
|
type: "button",
|
|
22932
23113
|
role: "tab",
|
|
22933
23114
|
"aria-selected": isActive,
|
|
22934
|
-
disabled: isDark,
|
|
22935
23115
|
"data-active": isActive ? "true" : void 0,
|
|
22936
|
-
"data-dark": isDark ? "true" : void 0,
|
|
22937
|
-
title: isDark ? t("chrome.tripWorkspace.tabUnavailable") : void 0,
|
|
22938
23116
|
onClick: () => onSelect(tab.key),
|
|
22939
23117
|
className: "kf-trip-workspace__tab",
|
|
22940
23118
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t(TAB_LABEL_KEY[tab.key]) })
|
|
@@ -22953,7 +23131,7 @@ var STATUS_LABEL_KEY9 = {
|
|
|
22953
23131
|
CANCELLED: "chrome.tripDirectory.status.cancelled"
|
|
22954
23132
|
};
|
|
22955
23133
|
function TripWorkspaceHead({ trip, onBack, style }) {
|
|
22956
|
-
const { t } =
|
|
23134
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
22957
23135
|
const head = deriveTripHead(trip);
|
|
22958
23136
|
const subLabelParts = [
|
|
22959
23137
|
head.dateRangeLabel,
|
|
@@ -22964,7 +23142,7 @@ function TripWorkspaceHead({ trip, onBack, style }) {
|
|
|
22964
23142
|
trip.manifestCount === 1 ? "chrome.tripWorkspace.travellerCountOne" : "chrome.tripWorkspace.travellerCount"
|
|
22965
23143
|
).replace("{count}", String(trip.manifestCount))
|
|
22966
23144
|
];
|
|
22967
|
-
return /* @__PURE__ */ jsxRuntime.jsx("header", { className: "kf-trip-workspace__head", style:
|
|
23145
|
+
return /* @__PURE__ */ jsxRuntime.jsx("header", { className: "kf-trip-workspace__head", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__head-identity", children: [
|
|
22968
23146
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__eyebrow", children: [
|
|
22969
23147
|
onBack === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
22970
23148
|
"button",
|
|
@@ -23004,10 +23182,10 @@ function TripWorkspace({
|
|
|
23004
23182
|
components,
|
|
23005
23183
|
style
|
|
23006
23184
|
}) {
|
|
23007
|
-
const { t } =
|
|
23008
|
-
const { read, readFailed, refresh } =
|
|
23185
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
23186
|
+
const { read, readFailed, refresh } = chunkXBLAVNP3_cjs.useAgencyTrip(tripRef);
|
|
23009
23187
|
if (readFailed) {
|
|
23010
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-workspace", style:
|
|
23188
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-workspace", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__status-block", role: "alert", children: [
|
|
23011
23189
|
/* @__PURE__ */ jsxRuntime.jsx(WarningIcon13, { className: "kf-trip-workspace__status-icon" }),
|
|
23012
23190
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-workspace__status-title", children: t("chrome.tripWorkspace.errorTitle") }),
|
|
23013
23191
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-workspace__status-body", children: t("chrome.tripWorkspace.errorBody") }),
|
|
@@ -23023,7 +23201,7 @@ function TripWorkspace({
|
|
|
23023
23201
|
] }) });
|
|
23024
23202
|
}
|
|
23025
23203
|
if (read === void 0) {
|
|
23026
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-workspace", style:
|
|
23204
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-workspace", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsx(TripWorkspaceSkeleton, {}) });
|
|
23027
23205
|
}
|
|
23028
23206
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23029
23207
|
TripWorkspaceBody,
|
|
@@ -23051,15 +23229,15 @@ function TripWorkspaceBody({
|
|
|
23051
23229
|
components,
|
|
23052
23230
|
style
|
|
23053
23231
|
}) {
|
|
23054
|
-
const { statuses, loaded } =
|
|
23232
|
+
const { statuses, loaded } = chunkXBLAVNP3_cjs.useCapabilityStatuses(tripRef);
|
|
23055
23233
|
const Head = components?.TripWorkspaceHead ?? TripWorkspaceHead;
|
|
23056
23234
|
const tabs = react.useMemo(() => resolveTripTabs(trip.eventType, statuses), [trip.eventType, statuses]);
|
|
23057
23235
|
const [requestedTab, setRequestedTab] = react.useState(initialTab ?? "overview");
|
|
23058
|
-
const activeTab = tabs.some((tab) => tab.key === requestedTab
|
|
23236
|
+
const activeTab = tabs.some((tab) => tab.key === requestedTab) ? requestedTab : "overview";
|
|
23059
23237
|
const activeResolved = tabs.find((tab) => tab.key === activeTab);
|
|
23060
23238
|
const kpis = react.useMemo(() => deriveTripKpis(trip), [trip]);
|
|
23061
23239
|
const litTabs = react.useMemo(
|
|
23062
|
-
() => new Set(tabs.filter((tab) => tab.
|
|
23240
|
+
() => new Set(tabs.filter((tab) => tab.blocker === null).map((tab) => tab.key)),
|
|
23063
23241
|
[tabs]
|
|
23064
23242
|
);
|
|
23065
23243
|
const panelRegistry = react.useMemo(
|
|
@@ -23135,7 +23313,7 @@ function TripWorkspaceBody({
|
|
|
23135
23313
|
}),
|
|
23136
23314
|
[trip, litTabs, tripRef, onTripChanged, onOpenTravellerProfile]
|
|
23137
23315
|
);
|
|
23138
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace", style:
|
|
23316
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
23139
23317
|
/* @__PURE__ */ jsxRuntime.jsx(Head, { trip, ...onBack !== void 0 ? { onBack } : {} }),
|
|
23140
23318
|
/* @__PURE__ */ jsxRuntime.jsx(TripKpiStrip, { cells: kpis }),
|
|
23141
23319
|
loaded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -23332,7 +23510,7 @@ function AdminShell({
|
|
|
23332
23510
|
function renderNavIcon(iconKey) {
|
|
23333
23511
|
return NavIcon !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(NavIcon, { iconKey }) : navIcon(iconKey);
|
|
23334
23512
|
}
|
|
23335
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-shell", style:
|
|
23513
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-shell", style: chunk3N2EQ2KC_cjs.tokenStyle(style), children: [
|
|
23336
23514
|
/* @__PURE__ */ jsxRuntime.jsxs("aside", { className: "kf-admin-shell__sidebar", children: [
|
|
23337
23515
|
brand !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-admin-shell__brand", children: [
|
|
23338
23516
|
brand.logo !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "kf-admin-shell__brand-logo", children: brand.logo }) : null,
|
|
@@ -23436,7 +23614,7 @@ function AdminShell({
|
|
|
23436
23614
|
] });
|
|
23437
23615
|
}
|
|
23438
23616
|
function KaafilAgencyWorkspace(props) {
|
|
23439
|
-
const session =
|
|
23617
|
+
const session = chunk3N2EQ2KC_cjs.useSession();
|
|
23440
23618
|
if (session.status !== "authenticated") {
|
|
23441
23619
|
return null;
|
|
23442
23620
|
}
|
|
@@ -23461,8 +23639,8 @@ function ReadyKaafilAgencyWorkspace(props) {
|
|
|
23461
23639
|
components,
|
|
23462
23640
|
style
|
|
23463
23641
|
} = props;
|
|
23464
|
-
const { t } =
|
|
23465
|
-
const agencyAdminMe =
|
|
23642
|
+
const { t } = chunk3N2EQ2KC_cjs.useKaafilChrome();
|
|
23643
|
+
const agencyAdminMe = chunkXBLAVNP3_cjs.useAgencyAdminMe();
|
|
23466
23644
|
const [internalPane, setInternalPane] = react.useState(
|
|
23467
23645
|
initialPane ?? "trips"
|
|
23468
23646
|
);
|
|
@@ -23723,27 +23901,27 @@ function ReadyKaafilAgencyWorkspace(props) {
|
|
|
23723
23901
|
|
|
23724
23902
|
Object.defineProperty(exports, "BootErrorScreen", {
|
|
23725
23903
|
enumerable: true,
|
|
23726
|
-
get: function () { return
|
|
23904
|
+
get: function () { return chunk7356B6YS_cjs.BootErrorScreen; }
|
|
23727
23905
|
});
|
|
23728
23906
|
Object.defineProperty(exports, "LockedTripScreen", {
|
|
23729
23907
|
enumerable: true,
|
|
23730
|
-
get: function () { return
|
|
23908
|
+
get: function () { return chunk7356B6YS_cjs.LockedTripScreen; }
|
|
23731
23909
|
});
|
|
23732
23910
|
Object.defineProperty(exports, "NotFoundScreen", {
|
|
23733
23911
|
enumerable: true,
|
|
23734
|
-
get: function () { return
|
|
23912
|
+
get: function () { return chunk7356B6YS_cjs.NotFoundScreen; }
|
|
23735
23913
|
});
|
|
23736
23914
|
Object.defineProperty(exports, "OfflineFallbackScreen", {
|
|
23737
23915
|
enumerable: true,
|
|
23738
|
-
get: function () { return
|
|
23916
|
+
get: function () { return chunk7356B6YS_cjs.OfflineFallbackScreen; }
|
|
23739
23917
|
});
|
|
23740
23918
|
Object.defineProperty(exports, "PlanLockedScreen", {
|
|
23741
23919
|
enumerable: true,
|
|
23742
|
-
get: function () { return
|
|
23920
|
+
get: function () { return chunk7356B6YS_cjs.PlanLockedScreen; }
|
|
23743
23921
|
});
|
|
23744
23922
|
Object.defineProperty(exports, "SessionExpiredScreen", {
|
|
23745
23923
|
enumerable: true,
|
|
23746
|
-
get: function () { return
|
|
23924
|
+
get: function () { return chunk7356B6YS_cjs.SessionExpiredScreen; }
|
|
23747
23925
|
});
|
|
23748
23926
|
exports.AdminShell = AdminShell;
|
|
23749
23927
|
exports.AgencySettingsScreen = AgencySettingsScreen;
|