kaafil-react-uikit 0.11.6 → 0.11.8

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 CHANGED
@@ -6,6 +6,68 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this package uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
  While on `0.x` a minor bump may carry a breaking change; the entry will say so.
8
8
 
9
+ ## [0.11.8] — 2026-09-18
10
+
11
+ ### Fixed
12
+
13
+ - **"Spend logged" read ₹0 with the money already spent.** `ManagerMoneySection`
14
+ summed the snapshot-backed `expenses[]` rows for that tile. `useExpenses`
15
+ deliberately enqueues its writes without an optimistic row — a fabricated
16
+ `ExpenseResponse` would have to guess `floatMovementId`, `receiptRequired`
17
+ and the negative-float guard, none of which a client can compute — so a
18
+ freshly logged expense is absent from that array until a pull brings it down,
19
+ and the tile showed zero until the manager reopened the app.
20
+
21
+ The tile now reads `totals.spendTotalMinor`, the server's own spend rollup,
22
+ which the hook already re-reads on every `sync.drained`. That is also simply
23
+ more correct than summing whichever rows this device happens to hold. The
24
+ local sum stays as the offline fallback, since `spendTotalMinor` is
25
+ documented as `undefined` until a read lands and must never be drawn as zero.
26
+
27
+ ### Known
28
+
29
+ - The **Recent expenses list** on the same screen still fills only on the next
30
+ pull, for the same reason: no optimistic row, and `sync.drained` is emitted
31
+ without a pull following it. The tile above it is now correct either way.
32
+ Closing the gap properly means either fabricating a row with server-assigned
33
+ fields (rejected, above) or pulling after every drain, which is an engine-wide
34
+ change rather than a component one.
35
+
36
+ ## [0.11.7] — 2026-09-18
37
+
38
+ ### Fixed
39
+
40
+ A sweep of every manager surface for the shape 0.11.6 fixed in pickups: a
41
+ live-fetched aggregate that an outbox-queued write invalidates, with nothing
42
+ re-reading it once the queue reaches the server. Most hooks were already
43
+ correct — `useItinerary`, `useRooming`, `useSeating`, `useExpenses`, `useForms`,
44
+ `useChecklists` and `useTravellerProfile` all subscribe to `sync.drained`
45
+ already. Two did not, and both are fixed here.
46
+
47
+ - **`useFloat`'s balance never moved when the float was spent.** `issue`,
48
+ `return` and `adjust` each refresh the summary, which covers every write the
49
+ hook owns — but an expense paid from `FLOAT_CASH` creates a paired float
50
+ movement (`useExpenses`'s own `floatMovementId`), so spending changes this
51
+ balance with no mutation here firing. Out of signal the expense queues, the
52
+ balance sits still, and the two halves of the Money tab contradict each other.
53
+ `summary` is a plain live read, so unlike the cache-first ledger nothing
54
+ re-runs it on `snapshot.updated`.
55
+
56
+ - **`useCollections` re-read its eligible pool too early.** `record()` refreshes
57
+ as soon as `mutate()` resolves, which is right on the desk's direct lane where
58
+ the write is committed by then. On a field device `mutate()` resolving means
59
+ durably ENQUEUED, so that refresh can return the server's pre-write
60
+ eligibility and put a traveller who was just paid up straight back into the
61
+ "due" list. The immediate refresh stays — correct for the direct lane — and a
62
+ drain-edge re-read was added alongside it.
63
+
64
+ ### Changed
65
+
66
+ - `ManagerPickupsSection`'s reconcile (added in 0.11.6) now listens for
67
+ `sync.drained` through `useOfflineEvent` instead of inferring a drain from
68
+ `useOutboxStatus().pending` transitions. Same behaviour, one mechanism
69
+ instead of two, matching every sibling hook.
70
+
9
71
  ## [0.11.6] — 2026-09-18
10
72
 
11
73
  ### Fixed
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkODH3SYYW_cjs = require('../chunk-ODH3SYYW.cjs');
4
- var chunkUSKVWPJD_cjs = require('../chunk-USKVWPJD.cjs');
3
+ var chunkKJSQLVBR_cjs = require('../chunk-KJSQLVBR.cjs');
4
+ var chunkARXY3ZA7_cjs = require('../chunk-ARXY3ZA7.cjs');
5
5
  require('../chunk-VHBGE4BY.cjs');
6
6
  var chunkT5JYKERY_cjs = require('../chunk-T5JYKERY.cjs');
7
7
  var chunk5ORJRFXZ_cjs = require('../chunk-5ORJRFXZ.cjs');
@@ -1013,7 +1013,7 @@ function ReadyAgencySettingsScreen({
1013
1013
  style
1014
1014
  }) {
1015
1015
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
1016
- const { document: document2, loaded, lastFetchFailed, refresh, patchSettings } = chunkODH3SYYW_cjs.useAgencySettings();
1016
+ const { document: document2, loaded, lastFetchFailed, refresh, patchSettings } = chunkKJSQLVBR_cjs.useAgencySettings();
1017
1017
  const [selectedSectionId, setSelectedSectionId] = react.useState(AGENCY_SETTINGS_SECTIONS[0]?.id);
1018
1018
  const [savingSectionId, setSavingSectionId] = react.useState(void 0);
1019
1019
  const [sectionError, setSectionError] = react.useState(void 0);
@@ -1030,7 +1030,7 @@ function ReadyAgencySettingsScreen({
1030
1030
  try {
1031
1031
  await patchSettings({ version: document2.version, [sectionId]: patch });
1032
1032
  } catch (error) {
1033
- const kind = chunkUSKVWPJD_cjs.classifyError(error).code === "CONFLICT_VERSION" ? "conflict" : "failed";
1033
+ const kind = chunkARXY3ZA7_cjs.classifyError(error).code === "CONFLICT_VERSION" ? "conflict" : "failed";
1034
1034
  setSectionError({ sectionId, kind });
1035
1035
  } finally {
1036
1036
  setSavingSectionId(void 0);
@@ -1711,7 +1711,7 @@ function ChecklistTemplateEditor({
1711
1711
  style
1712
1712
  }) {
1713
1713
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
1714
- const { templates, loaded, lastFetchFailed, refresh, patchTemplate, publishTemplate } = chunkODH3SYYW_cjs.useAgencyChecklistTemplates();
1714
+ const { templates, loaded, lastFetchFailed, refresh, patchTemplate, publishTemplate } = chunkKJSQLVBR_cjs.useAgencyChecklistTemplates();
1715
1715
  const template = templates.find((candidate) => candidate.id === templateId);
1716
1716
  const [title, setTitle] = react.useState("");
1717
1717
  const [items, setItems] = react.useState([]);
@@ -2311,7 +2311,7 @@ function ChecklistTemplateLibrary({
2311
2311
  style
2312
2312
  }) {
2313
2313
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
2314
- const { templates, loaded, lastFetchFailed, refresh, createTemplate, removeTemplate } = chunkODH3SYYW_cjs.useAgencyChecklistTemplates();
2314
+ const { templates, loaded, lastFetchFailed, refresh, createTemplate, removeTemplate } = chunkKJSQLVBR_cjs.useAgencyChecklistTemplates();
2315
2315
  const isControlled = controlledCreating !== void 0 && onCreatingChange !== void 0;
2316
2316
  const [internalCreating, setInternalCreating] = react.useState(false);
2317
2317
  const creating = isControlled ? controlledCreating : internalCreating;
@@ -4216,7 +4216,7 @@ function FormBuilder({ formId, onBack, components, style }) {
4216
4216
  deleteField,
4217
4217
  reorderForm,
4218
4218
  listBindings
4219
- } = chunkODH3SYYW_cjs.useAgencyForms();
4219
+ } = chunkKJSQLVBR_cjs.useAgencyForms();
4220
4220
  const [form, setForm] = react.useState(void 0);
4221
4221
  const [loadFailed, setLoadFailed] = react.useState(false);
4222
4222
  const [bindings, setBindings] = react.useState([]);
@@ -4630,7 +4630,7 @@ function CreateFormSheet({ onSubmit, onClose }) {
4630
4630
  });
4631
4631
  onClose();
4632
4632
  } catch (error) {
4633
- setErrorCode(chunkUSKVWPJD_cjs.classifyError(error).code ?? "unknown");
4633
+ setErrorCode(chunkARXY3ZA7_cjs.classifyError(error).code ?? "unknown");
4634
4634
  } finally {
4635
4635
  setPending(false);
4636
4636
  }
@@ -4924,7 +4924,7 @@ function FormsLibrary({
4924
4924
  style
4925
4925
  }) {
4926
4926
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
4927
- const { forms, loaded, lastFetchFailed, refresh, createForm } = chunkODH3SYYW_cjs.useAgencyForms();
4927
+ const { forms, loaded, lastFetchFailed, refresh, createForm } = chunkKJSQLVBR_cjs.useAgencyForms();
4928
4928
  const isControlled = controlledCreating !== void 0 && onCreatingChange !== void 0;
4929
4929
  const [internalCreating, setInternalCreating] = react.useState(false);
4930
4930
  const creating = isControlled ? controlledCreating : internalCreating;
@@ -5302,7 +5302,7 @@ function ManagerResultsListBody({
5302
5302
  onRetry
5303
5303
  }) {
5304
5304
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
5305
- const directories = chunkODH3SYYW_cjs.useDirectories();
5305
+ const directories = chunkKJSQLVBR_cjs.useDirectories();
5306
5306
  const [errorMessage, setErrorMessage] = react.useState(void 0);
5307
5307
  const [hasSettled, setHasSettled] = react.useState(false);
5308
5308
  const ManagerRow = ManagerResultRowComponent ?? ManagerResultRow;
@@ -5313,7 +5313,7 @@ function ManagerResultsListBody({
5313
5313
  setErrorMessage(void 0);
5314
5314
  return page;
5315
5315
  } catch (error) {
5316
- setErrorMessage(chunkUSKVWPJD_cjs.classifyError(error).code ?? "unknown");
5316
+ setErrorMessage(chunkARXY3ZA7_cjs.classifyError(error).code ?? "unknown");
5317
5317
  return { rows: [], nextCursor: void 0 };
5318
5318
  } finally {
5319
5319
  setHasSettled(true);
@@ -5321,7 +5321,7 @@ function ManagerResultsListBody({
5321
5321
  },
5322
5322
  [directories, filters]
5323
5323
  );
5324
- const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkODH3SYYW_cjs.usePaginatedList(fetch);
5324
+ const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkKJSQLVBR_cjs.usePaginatedList(fetch);
5325
5325
  const isLoading = !hasSettled;
5326
5326
  const reportedCount = isLoading || errorMessage !== void 0 ? void 0 : rows.length;
5327
5327
  react.useEffect(() => {
@@ -5691,7 +5691,7 @@ function ManagerProfileSection({
5691
5691
  style
5692
5692
  }) {
5693
5693
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
5694
- const { read, readFailed, refresh } = chunkODH3SYYW_cjs.useAgencyManagerProfile(managerRef);
5694
+ const { read, readFailed, refresh } = chunkKJSQLVBR_cjs.useAgencyManagerProfile(managerRef);
5695
5695
  const Hero = components?.Hero ?? ManagerProfileHero;
5696
5696
  const AssignmentsCard = components?.AssignmentsCard ?? ManagerAssignmentsCard;
5697
5697
  if (readFailed) {
@@ -5763,7 +5763,7 @@ function TemplateAuthoringFlow({
5763
5763
  }
5764
5764
  function AddTravellerModal({ onClose, onCreated }) {
5765
5765
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
5766
- const directories = chunkODH3SYYW_cjs.useDirectories();
5766
+ const directories = chunkKJSQLVBR_cjs.useDirectories();
5767
5767
  const titleId = react.useId();
5768
5768
  const [fullName, setFullName] = react.useState("");
5769
5769
  const [phone, setPhone] = react.useState("");
@@ -5787,7 +5787,7 @@ function AddTravellerModal({ onClose, onCreated }) {
5787
5787
  });
5788
5788
  onCreated(created);
5789
5789
  } catch (error) {
5790
- setErrorMessage(chunkUSKVWPJD_cjs.classifyError(error).code ?? "unknown");
5790
+ setErrorMessage(chunkARXY3ZA7_cjs.classifyError(error).code ?? "unknown");
5791
5791
  } finally {
5792
5792
  setIsSubmitting(false);
5793
5793
  }
@@ -6138,7 +6138,7 @@ function TravellerResultsListBody({
6138
6138
  onRetry
6139
6139
  }) {
6140
6140
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
6141
- const directories = chunkODH3SYYW_cjs.useDirectories();
6141
+ const directories = chunkKJSQLVBR_cjs.useDirectories();
6142
6142
  const [errorMessage, setErrorMessage] = react.useState(void 0);
6143
6143
  const [hasSettled, setHasSettled] = react.useState(false);
6144
6144
  const fetch = react.useCallback(
@@ -6149,7 +6149,7 @@ function TravellerResultsListBody({
6149
6149
  setErrorMessage(void 0);
6150
6150
  return page;
6151
6151
  } catch (error) {
6152
- setErrorMessage(chunkUSKVWPJD_cjs.classifyError(error).code ?? "unknown");
6152
+ setErrorMessage(chunkARXY3ZA7_cjs.classifyError(error).code ?? "unknown");
6153
6153
  return { rows: [], nextCursor: void 0 };
6154
6154
  } finally {
6155
6155
  setHasSettled(true);
@@ -6157,7 +6157,7 @@ function TravellerResultsListBody({
6157
6157
  },
6158
6158
  [directories, query]
6159
6159
  );
6160
- const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkODH3SYYW_cjs.usePaginatedList(fetch);
6160
+ const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkKJSQLVBR_cjs.usePaginatedList(fetch);
6161
6161
  const isLoading = !hasSettled;
6162
6162
  const reportedCount = isLoading || errorMessage !== void 0 ? void 0 : rows.length;
6163
6163
  react.useEffect(() => {
@@ -7428,7 +7428,7 @@ function TriggerTemplateEditor({
7428
7428
  style
7429
7429
  }) {
7430
7430
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
7431
- const { triggers, loaded, lastFetchFailed, refresh, patchTrigger } = chunkODH3SYYW_cjs.useAgencyJourneyTriggers();
7431
+ const { triggers, loaded, lastFetchFailed, refresh, patchTrigger } = chunkKJSQLVBR_cjs.useAgencyJourneyTriggers();
7432
7432
  const [savingId, setSavingId] = react.useState(void 0);
7433
7433
  const [selectedId, setSelectedId] = react.useState(void 0);
7434
7434
  const filtered = tripModeFilter === void 0 ? triggers : triggers.filter((trigger) => trigger.tripMode === tripModeFilter);
@@ -7679,7 +7679,7 @@ function ReadyTripBookingsSection({
7679
7679
  style
7680
7680
  }) {
7681
7681
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
7682
- const bookings = chunkODH3SYYW_cjs.useBookings(tripRef);
7682
+ const bookings = chunkKJSQLVBR_cjs.useBookings(tripRef);
7683
7683
  const ready = bookings.status === "ready" ? bookings : null;
7684
7684
  const groups = react.useMemo(
7685
7685
  () => ready === null ? [] : groupByKind(liveBookings(ready.bookings)),
@@ -8491,7 +8491,7 @@ function ReadyTripChecklistSection({
8491
8491
  style
8492
8492
  }) {
8493
8493
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
8494
- const checklists = chunkUSKVWPJD_cjs.useChecklists(tripRef);
8494
+ const checklists = chunkARXY3ZA7_cjs.useChecklists(tripRef);
8495
8495
  const [overlay, setOverlay] = react.useState({ kind: "none" });
8496
8496
  const [pending, setPending] = react.useState(false);
8497
8497
  const [busyItemId, setBusyItemId] = react.useState(null);
@@ -9175,7 +9175,7 @@ function TripResultsListBody({
9175
9175
  onRetry
9176
9176
  }) {
9177
9177
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
9178
- const { makeTripsFetch } = chunkODH3SYYW_cjs.useAgencyTrips();
9178
+ const { makeTripsFetch } = chunkKJSQLVBR_cjs.useAgencyTrips();
9179
9179
  const [errorCode, setErrorCode] = react.useState(void 0);
9180
9180
  const [hasSettled, setHasSettled] = react.useState(false);
9181
9181
  const Row = TripRowComponent ?? TripRow;
@@ -9186,7 +9186,7 @@ function TripResultsListBody({
9186
9186
  setErrorCode(void 0);
9187
9187
  return page;
9188
9188
  } catch (error) {
9189
- setErrorCode(chunkUSKVWPJD_cjs.classifyError(error).code ?? "unknown");
9189
+ setErrorCode(chunkARXY3ZA7_cjs.classifyError(error).code ?? "unknown");
9190
9190
  return { rows: [], nextCursor: void 0 };
9191
9191
  } finally {
9192
9192
  setHasSettled(true);
@@ -9194,7 +9194,7 @@ function TripResultsListBody({
9194
9194
  },
9195
9195
  [makeTripsFetch, filters]
9196
9196
  );
9197
- const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkODH3SYYW_cjs.usePaginatedList(fetch);
9197
+ const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkKJSQLVBR_cjs.usePaginatedList(fetch);
9198
9198
  const isLoading = !hasSettled;
9199
9199
  const reportedCount = isLoading || errorCode !== void 0 ? void 0 : rows.length;
9200
9200
  react.useEffect(() => {
@@ -10141,11 +10141,11 @@ function TripDocumentsSection(props) {
10141
10141
  }
10142
10142
  function ReadyTripDocumentsSection({ tripRef, style }) {
10143
10143
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
10144
- const files = chunkUSKVWPJD_cjs.useFiles({ tripRef });
10145
- const expenses = chunkUSKVWPJD_cjs.useExpenses(tripRef);
10146
- const bookings = chunkODH3SYYW_cjs.useBookings(tripRef);
10147
- const { listTripManifest } = chunkODH3SYYW_cjs.useDirectories();
10148
- const { statuses, loaded: capabilityLoaded } = chunkODH3SYYW_cjs.useCapabilityStatuses(tripRef);
10144
+ const files = chunkARXY3ZA7_cjs.useFiles({ tripRef });
10145
+ const expenses = chunkARXY3ZA7_cjs.useExpenses(tripRef);
10146
+ const bookings = chunkKJSQLVBR_cjs.useBookings(tripRef);
10147
+ const { listTripManifest } = chunkKJSQLVBR_cjs.useDirectories();
10148
+ const { statuses, loaded: capabilityLoaded } = chunkKJSQLVBR_cjs.useCapabilityStatuses(tripRef);
10149
10149
  const capability = statuses.get("files");
10150
10150
  const [state, setState] = react.useState({ kind: "loading" });
10151
10151
  const [purpose, setPurpose] = react.useState(null);
@@ -10887,7 +10887,7 @@ function ReceiptDialog({
10887
10887
  }) {
10888
10888
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
10889
10889
  const titleId = react.useId();
10890
- const files = chunkUSKVWPJD_cjs.useFiles({ tripRef });
10890
+ const files = chunkARXY3ZA7_cjs.useFiles({ tripRef });
10891
10891
  const [phase, setPhase] = react.useState({ kind: "loading" });
10892
10892
  const [imageBroke, setImageBroke] = react.useState(false);
10893
10893
  const readUrl = files.url;
@@ -11043,8 +11043,8 @@ function TripExpensesSection(props) {
11043
11043
  }
11044
11044
  function ReadyTripExpensesSection({ tripRef, style }) {
11045
11045
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
11046
- const expenses = chunkUSKVWPJD_cjs.useExpenses(tripRef);
11047
- const vendors = chunkUSKVWPJD_cjs.useVendors(tripRef, "");
11046
+ const expenses = chunkARXY3ZA7_cjs.useExpenses(tripRef);
11047
+ const vendors = chunkARXY3ZA7_cjs.useVendors(tripRef, "");
11048
11048
  const [category, setCategory] = react.useState(null);
11049
11049
  const [paymentMode, setPaymentMode] = react.useState(null);
11050
11050
  const [missingReceiptOnly, setMissingReceiptOnly] = react.useState(false);
@@ -11880,8 +11880,8 @@ function TripFloatSection(props) {
11880
11880
  }
11881
11881
  function ReadyTripFloatSection({ tripRef, style }) {
11882
11882
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
11883
- const float = chunkUSKVWPJD_cjs.useFloat(tripRef);
11884
- const managers = chunkUSKVWPJD_cjs.useManagers(tripRef);
11883
+ const float = chunkARXY3ZA7_cjs.useFloat(tripRef);
11884
+ const managers = chunkARXY3ZA7_cjs.useManagers(tripRef);
11885
11885
  const [openManagerId, setOpenManagerId] = react.useState(null);
11886
11886
  const [ledgers, setLedgers] = react.useState({});
11887
11887
  const [overlay, setOverlay] = react.useState({ kind: "none" });
@@ -12618,8 +12618,8 @@ function ReadyTripFormsSection({
12618
12618
  style
12619
12619
  }) {
12620
12620
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
12621
- const forms = chunkUSKVWPJD_cjs.useForms(tripRef);
12622
- const { listTripManifest } = chunkODH3SYYW_cjs.useDirectories();
12621
+ const forms = chunkARXY3ZA7_cjs.useForms(tripRef);
12622
+ const { listTripManifest } = chunkKJSQLVBR_cjs.useDirectories();
12623
12623
  const [openFormId, setOpenFormId] = react.useState(null);
12624
12624
  const [completion, setCompletion] = react.useState(void 0);
12625
12625
  const [manifest, setManifest] = react.useState(void 0);
@@ -14023,7 +14023,7 @@ function ReadyTripItinerarySection({
14023
14023
  style
14024
14024
  }) {
14025
14025
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
14026
- const itinerary = chunkUSKVWPJD_cjs.useItinerary(tripRef);
14026
+ const itinerary = chunkARXY3ZA7_cjs.useItinerary(tripRef);
14027
14027
  const [view, setView] = react.useState("days");
14028
14028
  const [activeIso, setActiveIso] = react.useState(null);
14029
14029
  const [overlay, setOverlay] = react.useState({ kind: "none" });
@@ -14383,7 +14383,7 @@ function AddTravellerDialog({
14383
14383
  }) {
14384
14384
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
14385
14385
  const titleId = react.useId();
14386
- const { makeTravellersFetch, addTraveller, createAgencyTraveller } = chunkODH3SYYW_cjs.useDirectories();
14386
+ const { makeTravellersFetch, addTraveller, createAgencyTraveller } = chunkKJSQLVBR_cjs.useDirectories();
14387
14387
  const [mode, setMode] = react.useState("search");
14388
14388
  const [term, setTerm] = react.useState("");
14389
14389
  const [debounced, setDebounced] = react.useState("");
@@ -14397,7 +14397,7 @@ function AddTravellerDialog({
14397
14397
  return () => clearTimeout(timer);
14398
14398
  }, [term]);
14399
14399
  function reportFailure(error) {
14400
- setErrorCode(chunkUSKVWPJD_cjs.classifyError(error).code ?? "unknown");
14400
+ setErrorCode(chunkARXY3ZA7_cjs.classifyError(error).code ?? "unknown");
14401
14401
  }
14402
14402
  async function addExisting(externalTravellerId, fullName) {
14403
14403
  setPending(true);
@@ -14550,7 +14550,7 @@ function DirectoryResults({
14550
14550
  onPick
14551
14551
  }) {
14552
14552
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
14553
- const { rows, hasNext, loadNext, settled, error } = chunkODH3SYYW_cjs.usePaginatedList(fetch);
14553
+ const { rows, hasNext, loadNext, settled, error } = chunkKJSQLVBR_cjs.usePaginatedList(fetch);
14554
14554
  if (!settled) {
14555
14555
  return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kf-trip-manifest-section__dialog-note", "aria-live": "polite", children: t("chrome.tripManifest.addSearching") });
14556
14556
  }
@@ -14637,7 +14637,7 @@ function ManageGroupsDialog({
14637
14637
  }) {
14638
14638
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
14639
14639
  const titleId = react.useId();
14640
- const { createParty, patchParty, deleteParty } = chunkODH3SYYW_cjs.useDirectories();
14640
+ const { createParty, patchParty, deleteParty } = chunkKJSQLVBR_cjs.useDirectories();
14641
14641
  const groups = deriveManifestGroups(rows).filter(
14642
14642
  (group) => group.id !== SOLO_GROUP_ID && group.party !== null
14643
14643
  );
@@ -15399,7 +15399,7 @@ function ManifestResultsBody({
15399
15399
  onRetry
15400
15400
  }) {
15401
15401
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
15402
- const { makeManifestFetch, facets, groupedPageSize } = chunkODH3SYYW_cjs.useAgencyTripManifest(tripRef);
15402
+ const { makeManifestFetch, facets, groupedPageSize } = chunkKJSQLVBR_cjs.useAgencyTripManifest(tripRef);
15403
15403
  const [errorCode, setErrorCode] = react.useState(void 0);
15404
15404
  const [hasSettled, setHasSettled] = react.useState(false);
15405
15405
  const [serverTime, setServerTime] = react.useState(void 0);
@@ -15416,7 +15416,7 @@ function ManifestResultsBody({
15416
15416
  if (meta?.serverTime !== void 0) setServerTime(meta.serverTime);
15417
15417
  return page;
15418
15418
  } catch (error) {
15419
- setErrorCode(chunkUSKVWPJD_cjs.classifyError(error).code ?? "unknown");
15419
+ setErrorCode(chunkARXY3ZA7_cjs.classifyError(error).code ?? "unknown");
15420
15420
  return { rows: [], nextCursor: void 0 };
15421
15421
  } finally {
15422
15422
  setHasSettled(true);
@@ -15424,7 +15424,7 @@ function ManifestResultsBody({
15424
15424
  },
15425
15425
  [makeManifestFetch, filters, grouped, groupedPageSize]
15426
15426
  );
15427
- const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkODH3SYYW_cjs.usePaginatedList(fetch, {
15427
+ const { rows, hasNext, hasPrev, loadNext, loadPrev } = chunkKJSQLVBR_cjs.usePaginatedList(fetch, {
15428
15428
  accumulate: grouped
15429
15429
  });
15430
15430
  react.useEffect(() => {
@@ -15613,7 +15613,7 @@ function RemoveTravellerDialog({
15613
15613
  onRemoved
15614
15614
  }) {
15615
15615
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
15616
- const { removeFromManifest } = chunkODH3SYYW_cjs.useDirectories();
15616
+ const { removeFromManifest } = chunkKJSQLVBR_cjs.useDirectories();
15617
15617
  const titleId = react.useId();
15618
15618
  const [pending, setPending] = react.useState(false);
15619
15619
  const [errorCode, setErrorCode] = react.useState(void 0);
@@ -15714,12 +15714,12 @@ function ShareLinkDialog({
15714
15714
  }) {
15715
15715
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
15716
15716
  const titleId = react.useId();
15717
- const buildShareUrl = chunkODH3SYYW_cjs.useBuildShareUrl();
15717
+ const buildShareUrl = chunkKJSQLVBR_cjs.useBuildShareUrl();
15718
15718
  const showsBareToken = buildShareUrl === null;
15719
15719
  if (showsBareToken) warnMissingShareUrl();
15720
15720
  const isFamily = travellerRef === null;
15721
- const offerable = chunkODH3SYYW_cjs.familySafeSections(isFamily);
15722
- const { links, readFailed, mint, revoke, regenerate, reveal } = chunkODH3SYYW_cjs.useShareLinks(
15721
+ const offerable = chunkKJSQLVBR_cjs.familySafeSections(isFamily);
15722
+ const { links, readFailed, mint, revoke, regenerate, reveal } = chunkKJSQLVBR_cjs.useShareLinks(
15723
15723
  tripRef,
15724
15724
  travellerRef
15725
15725
  );
@@ -16128,9 +16128,9 @@ function TravellerDetailDialog({
16128
16128
  }) {
16129
16129
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
16130
16130
  const titleId = react.useId();
16131
- const { read, readFailed, refresh } = chunkUSKVWPJD_cjs.useTravellerProfile(tripRef, travellerRef);
16132
- const forms = chunkODH3SYYW_cjs.useTravellerFormResponses(tripRef, travellerRef);
16133
- const { addTravellerNote } = chunkODH3SYYW_cjs.useDirectories();
16131
+ const { read, readFailed, refresh } = chunkARXY3ZA7_cjs.useTravellerProfile(tripRef, travellerRef);
16132
+ const forms = chunkKJSQLVBR_cjs.useTravellerFormResponses(tripRef, travellerRef);
16133
+ const { addTravellerNote } = chunkKJSQLVBR_cjs.useDirectories();
16134
16134
  const [noteDraft, setNoteDraft] = react.useState("");
16135
16135
  const [notePending, setNotePending] = react.useState(false);
16136
16136
  const [noteFailed, setNoteFailed] = react.useState(false);
@@ -16988,8 +16988,8 @@ function ReadyTripPaymentsSection({
16988
16988
  style
16989
16989
  }) {
16990
16990
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
16991
- const collections = chunkUSKVWPJD_cjs.useCollections(tripRef);
16992
- const parties = chunkUSKVWPJD_cjs.useParties(tripRef);
16991
+ const collections = chunkARXY3ZA7_cjs.useCollections(tripRef);
16992
+ const parties = chunkARXY3ZA7_cjs.useParties(tripRef);
16993
16993
  const [overlay, setOverlay] = react.useState({ kind: "none" });
16994
16994
  const [pending, setPending] = react.useState(false);
16995
16995
  const [errorCode, setErrorCode] = react.useState(void 0);
@@ -18127,7 +18127,7 @@ function ReadyTripPickupsSection({
18127
18127
  style
18128
18128
  }) {
18129
18129
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
18130
- const pickups = chunkUSKVWPJD_cjs.usePickups(tripRef);
18130
+ const pickups = chunkARXY3ZA7_cjs.usePickups(tripRef);
18131
18131
  const [kind, setKind] = react.useState("PICKUP");
18132
18132
  const [view, setView] = react.useState("stops");
18133
18133
  const [overlay, setOverlay] = react.useState({ kind: "none" });
@@ -18605,7 +18605,7 @@ function AutoAssignDialog({
18605
18605
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "kf-trip-rooming-section__plan", children: [
18606
18606
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "kf-trip-rooming-section__plan-title", children: t("chrome.tripRooming.rulesTitle") }),
18607
18607
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "kf-trip-rooming-section__rule-list", children: preview.perRule.map((entry) => {
18608
- const severity = chunkUSKVWPJD_cjs.roomingHeuristicSeverity(entry.rule);
18608
+ const severity = chunkARXY3ZA7_cjs.roomingHeuristicSeverity(entry.rule);
18609
18609
  const relaxed = entry.outcome === "relaxed";
18610
18610
  const violation = relaxed && severity === "never";
18611
18611
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -18821,15 +18821,15 @@ function roomTypeLabelKey(roomType) {
18821
18821
  return ROOM_TYPE_LABEL_KEY[roomType] ?? "chrome.tripRooming.roomType.shared";
18822
18822
  }
18823
18823
  function toneAttrs(tone) {
18824
- const parsed = chunkUSKVWPJD_cjs.parseRoomingTone(tone);
18824
+ const parsed = chunkARXY3ZA7_cjs.parseRoomingTone(tone);
18825
18825
  if (parsed === void 0) {
18826
- return { family: chunkUSKVWPJD_cjs.TONE_FAMILIES.UNKNOWN, shade: 0 };
18826
+ return { family: chunkARXY3ZA7_cjs.TONE_FAMILIES.UNKNOWN, shade: 0 };
18827
18827
  }
18828
- const shade = parsed.shade < chunkUSKVWPJD_cjs.SHADES_PER_FAMILY ? parsed.shade : parsed.shade % chunkUSKVWPJD_cjs.SHADES_PER_FAMILY;
18828
+ const shade = parsed.shade < chunkARXY3ZA7_cjs.SHADES_PER_FAMILY ? parsed.shade : parsed.shade % chunkARXY3ZA7_cjs.SHADES_PER_FAMILY;
18829
18829
  return { family: parsed.family, shade };
18830
18830
  }
18831
18831
  function glyphOf(occupant) {
18832
- return occupant.glyph === "" ? chunkUSKVWPJD_cjs.FALLBACK_GLYPH : occupant.glyph;
18832
+ return occupant.glyph === "" ? chunkARXY3ZA7_cjs.FALLBACK_GLYPH : occupant.glyph;
18833
18833
  }
18834
18834
  function TravellerGlyph({
18835
18835
  occupant,
@@ -19610,7 +19610,7 @@ function ReadyTripRoomingSection({
19610
19610
  style
19611
19611
  }) {
19612
19612
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
19613
- const rooming = chunkUSKVWPJD_cjs.useRooming(tripRef);
19613
+ const rooming = chunkARXY3ZA7_cjs.useRooming(tripRef);
19614
19614
  const [openWindowId, setOpenWindowId] = react.useState(null);
19615
19615
  const [overlay, setOverlay] = react.useState({ kind: "none" });
19616
19616
  const [pending, setPending] = react.useState(false);
@@ -20527,10 +20527,10 @@ function TripSuppliersSection(props) {
20527
20527
  }
20528
20528
  function ReadyTripSuppliersSection({ tripRef, style }) {
20529
20529
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
20530
- const vendors = chunkUSKVWPJD_cjs.useVendors(tripRef, "");
20531
- const seating = chunkUSKVWPJD_cjs.useSeating(tripRef);
20532
- const itinerary = chunkUSKVWPJD_cjs.useItinerary(tripRef);
20533
- const expenses = chunkUSKVWPJD_cjs.useExpenses(tripRef);
20530
+ const vendors = chunkARXY3ZA7_cjs.useVendors(tripRef, "");
20531
+ const seating = chunkARXY3ZA7_cjs.useSeating(tripRef);
20532
+ const itinerary = chunkARXY3ZA7_cjs.useItinerary(tripRef);
20533
+ const expenses = chunkARXY3ZA7_cjs.useExpenses(tripRef);
20534
20534
  const [category, setCategory] = react.useState(null);
20535
20535
  const [query, setQuery] = react.useState("");
20536
20536
  const [sortKey, setSortKey] = react.useState("name");
@@ -22062,8 +22062,8 @@ function ReadyTripVehiclesSection({
22062
22062
  style
22063
22063
  }) {
22064
22064
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
22065
- const seating = chunkUSKVWPJD_cjs.useSeating(tripRef);
22066
- const managers = chunkUSKVWPJD_cjs.useManagers(tripRef);
22065
+ const seating = chunkARXY3ZA7_cjs.useSeating(tripRef);
22066
+ const managers = chunkARXY3ZA7_cjs.useManagers(tripRef);
22067
22067
  const [openVehicleId, setOpenVehicleId] = react.useState(null);
22068
22068
  const [day, setDay] = react.useState(null);
22069
22069
  const [overlay, setOverlay] = react.useState({ kind: "none" });
@@ -22490,7 +22490,7 @@ function WarningIcon13(props) {
22490
22490
 
22491
22491
  // src/admin/composite/office/TripWorkspace/internal/panels/deriveCloseout.ts
22492
22492
  function tabForBlocker(row) {
22493
- return chunkODH3SYYW_cjs.resolveBlockerDeepLink({ actionKey: row.actionKey })?.tab;
22493
+ return chunkKJSQLVBR_cjs.resolveBlockerDeepLink({ actionKey: row.actionKey })?.tab;
22494
22494
  }
22495
22495
  function orderedBlockers(rows) {
22496
22496
  return [...rows].sort((a, b) => {
@@ -22531,7 +22531,7 @@ function codeOf11(error) {
22531
22531
  }
22532
22532
  function CloseoutCard({ tripRef, onOpenTab, litTabs }) {
22533
22533
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
22534
- const closeout = chunkUSKVWPJD_cjs.useCloseout(tripRef);
22534
+ const closeout = chunkARXY3ZA7_cjs.useCloseout(tripRef);
22535
22535
  const [note, setNote] = react.useState(null);
22536
22536
  const [pending, setPending] = react.useState(void 0);
22537
22537
  const [errorCode, setErrorCode] = react.useState(void 0);
@@ -22871,7 +22871,7 @@ var ROLE_LABEL_KEY = {
22871
22871
  };
22872
22872
  function OverviewManagersCard({ trip, onChanged }) {
22873
22873
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
22874
- const { promoteManager, assignManager, unassignManager, makeManagersFetch } = chunkODH3SYYW_cjs.useDirectories();
22874
+ const { promoteManager, assignManager, unassignManager, makeManagersFetch } = chunkKJSQLVBR_cjs.useDirectories();
22875
22875
  const [pendingId, setPendingId] = react.useState(void 0);
22876
22876
  const [errorCode, setErrorCode] = react.useState(void 0);
22877
22877
  const [assignOpen, setAssignOpen] = react.useState(false);
@@ -23033,12 +23033,12 @@ function TripOverviewPanel({
23033
23033
  onTripChanged
23034
23034
  }) {
23035
23035
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
23036
- const today = chunkUSKVWPJD_cjs.useManagerToday(trip.ref);
23037
- const expenses = chunkUSKVWPJD_cjs.useExpenses(trip.ref);
23036
+ const today = chunkARXY3ZA7_cjs.useManagerToday(trip.ref);
23037
+ const expenses = chunkARXY3ZA7_cjs.useExpenses(trip.ref);
23038
23038
  const spendTotalMinor = expenses.status === "ready" && expenses.totals.loaded && !expenses.totals.lastFetchFailed ? expenses.totals.spendTotalMinor : void 0;
23039
23039
  const finance = deriveFinance(trip, spendTotalMinor);
23040
23040
  const quickActions = QUICK_ACTION_TABS.filter((key) => litTabs.has(key));
23041
- const closeoutProbe = chunkUSKVWPJD_cjs.useCloseout(trip.ref);
23041
+ const closeoutProbe = chunkARXY3ZA7_cjs.useCloseout(trip.ref);
23042
23042
  const closeoutStage = closeoutProbe.status === "ready" && hasReturned(closeoutProbe.aggregate) ? closeoutProbe.aggregate?.stage ?? null : null;
23043
23043
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__overview", children: [
23044
23044
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__overview-main", children: [
@@ -23476,7 +23476,7 @@ function ReadyTripWorkspace({
23476
23476
  style
23477
23477
  }) {
23478
23478
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
23479
- const { read, readFailed, refresh } = chunkODH3SYYW_cjs.useAgencyTrip(tripRef);
23479
+ const { read, readFailed, refresh } = chunkKJSQLVBR_cjs.useAgencyTrip(tripRef);
23480
23480
  if (readFailed) {
23481
23481
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kf-trip-workspace", style: chunk5ORJRFXZ_cjs.tokenStyle(style), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kf-trip-workspace__status-block", role: "alert", children: [
23482
23482
  /* @__PURE__ */ jsxRuntime.jsx(WarningIcon13, { className: "kf-trip-workspace__status-icon" }),
@@ -23522,7 +23522,7 @@ function TripWorkspaceBody({
23522
23522
  components,
23523
23523
  style
23524
23524
  }) {
23525
- const { statuses, loaded } = chunkODH3SYYW_cjs.useCapabilityStatuses(tripRef);
23525
+ const { statuses, loaded } = chunkKJSQLVBR_cjs.useCapabilityStatuses(tripRef);
23526
23526
  const Head = components?.TripWorkspaceHead ?? TripWorkspaceHead;
23527
23527
  const tabs = react.useMemo(() => resolveTripTabs(trip.eventType, statuses), [trip.eventType, statuses]);
23528
23528
  const [requestedTab, setRequestedTab] = react.useState(initialTab ?? "overview");
@@ -23933,7 +23933,7 @@ function ReadyKaafilAgencyWorkspace(props) {
23933
23933
  style
23934
23934
  } = props;
23935
23935
  const { t } = chunk5ORJRFXZ_cjs.useKaafilChrome();
23936
- const agencyAdminMe = chunkODH3SYYW_cjs.useAgencyAdminMe();
23936
+ const agencyAdminMe = chunkKJSQLVBR_cjs.useAgencyAdminMe();
23937
23937
  const [internalPane, setInternalPane] = react.useState(
23938
23938
  initialPane ?? "trips"
23939
23939
  );
@@ -1,5 +1,5 @@
1
- import { useAgencySettings, useAgencyChecklistTemplates, useAgencyForms, useAgencyManagerProfile, useAgencyJourneyTriggers, useBookings, useDirectories, useCapabilityStatuses, useAgencyTrip, useAgencyAdminMe, useTravellerFormResponses, useBuildShareUrl, familySafeSections, useShareLinks, usePaginatedList, useAgencyTrips, useAgencyTripManifest, resolveBlockerDeepLink } from '../chunk-4U5VHQDT.js';
2
- import { useChecklists, useFiles, useExpenses, useVendors, useFloat, useManagers, useForms, useItinerary, useCollections, useParties, usePickups, useRooming, useSeating, classifyError, useTravellerProfile, roomingHeuristicSeverity, useManagerToday, useCloseout, parseRoomingTone, TONE_FAMILIES, SHADES_PER_FAMILY, FALLBACK_GLYPH } from '../chunk-63JQKLMH.js';
1
+ import { useAgencySettings, useAgencyChecklistTemplates, useAgencyForms, useAgencyManagerProfile, useAgencyJourneyTriggers, useBookings, useDirectories, useCapabilityStatuses, useAgencyTrip, useAgencyAdminMe, useTravellerFormResponses, useBuildShareUrl, familySafeSections, useShareLinks, usePaginatedList, useAgencyTrips, useAgencyTripManifest, resolveBlockerDeepLink } from '../chunk-ZKLX6YRT.js';
2
+ import { useChecklists, useFiles, useExpenses, useVendors, useFloat, useManagers, useForms, useItinerary, useCollections, useParties, usePickups, useRooming, useSeating, classifyError, useTravellerProfile, roomingHeuristicSeverity, useManagerToday, useCloseout, parseRoomingTone, TONE_FAMILIES, SHADES_PER_FAMILY, FALLBACK_GLYPH } from '../chunk-XGPX7TYV.js';
3
3
  import '../chunk-F2ENMVT7.js';
4
4
  export { BootErrorScreen, LockedTripScreen, NotFoundScreen, OfflineFallbackScreen, PlanLockedScreen, SessionExpiredScreen } from '../chunk-LOLQNRIK.js';
5
5
  import { createRegistry, useSession, useKaafilChrome, tokenStyle, useKaafilClient, isDevelopment } from '../chunk-YJJ4DI42.js';
@@ -622,6 +622,9 @@ var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
622
622
  react.useEffect(() => {
623
623
  void refreshEligible(eligibleStatus);
624
624
  }, [refreshEligible, eligibleStatus]);
625
+ chunk5ORJRFXZ_cjs.useOfflineEvent("sync.drained", () => {
626
+ void refreshEligible();
627
+ });
625
628
  const recordMutation = chunk5ORJRFXZ_cjs.useOfflineMutation({
626
629
  tripRef,
627
630
  enqueue: (engine, input) => engine.enqueue({
@@ -949,6 +952,9 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
949
952
  react.useEffect(() => {
950
953
  void refreshSummary();
951
954
  }, [refreshSummary]);
955
+ chunk5ORJRFXZ_cjs.useOfflineEvent("sync.drained", () => {
956
+ void refreshSummary();
957
+ });
952
958
  const issueMutation = chunk5ORJRFXZ_cjs.useOfflineMutation({
953
959
  tripRef,
954
960
  enqueue: (engine, input) => engine.enqueue({
@@ -2422,5 +2428,5 @@ exports.useSeating = useSeating;
2422
2428
  exports.useSnapshotList = useSnapshotList;
2423
2429
  exports.useTravellerProfile = useTravellerProfile;
2424
2430
  exports.useVendors = useVendors;
2425
- //# sourceMappingURL=chunk-USKVWPJD.cjs.map
2426
- //# sourceMappingURL=chunk-USKVWPJD.cjs.map
2431
+ //# sourceMappingURL=chunk-ARXY3ZA7.cjs.map
2432
+ //# sourceMappingURL=chunk-ARXY3ZA7.cjs.map