kaafil-react-uikit 0.7.1 → 0.9.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 +26 -0
- package/dist/admin/index.cjs +364 -348
- package/dist/admin/index.cjs.map +1 -1
- package/dist/admin/index.js +24 -8
- package/dist/admin/index.js.map +1 -1
- package/dist/{chunk-7O3TPYK4.cjs → chunk-2WPNGUX5.cjs} +17 -17
- package/dist/{chunk-7O3TPYK4.cjs.map → chunk-2WPNGUX5.cjs.map} +1 -1
- package/dist/{chunk-DYOAKTGJ.js → chunk-6PQWLUBA.js} +5 -5
- package/dist/{chunk-DYOAKTGJ.js.map → chunk-6PQWLUBA.js.map} +1 -1
- package/dist/{chunk-GKR52SVU.js → chunk-CCK3WPMF.js} +3 -3
- package/dist/{chunk-GKR52SVU.js.map → chunk-CCK3WPMF.js.map} +1 -1
- package/dist/{chunk-7COMKJTM.cjs → chunk-ELJPQSXY.cjs} +9 -9
- package/dist/{chunk-7COMKJTM.cjs.map → chunk-ELJPQSXY.cjs.map} +1 -1
- package/dist/{chunk-TDFM563X.cjs → chunk-FO5VJJUO.cjs} +12 -12
- package/dist/{chunk-TDFM563X.cjs.map → chunk-FO5VJJUO.cjs.map} +1 -1
- package/dist/{chunk-VU5BCK2P.js → chunk-FSSB6J3X.js} +3 -3
- package/dist/{chunk-VU5BCK2P.js.map → chunk-FSSB6J3X.js.map} +1 -1
- package/dist/{chunk-YHGAFRN6.js → chunk-GOSSRXBN.js} +3 -3
- package/dist/{chunk-YHGAFRN6.js.map → chunk-GOSSRXBN.js.map} +1 -1
- package/dist/{chunk-MP4IMAPF.cjs → chunk-IAXVUR7H.cjs} +55 -55
- package/dist/{chunk-MP4IMAPF.cjs.map → chunk-IAXVUR7H.cjs.map} +1 -1
- package/dist/{chunk-4R7QBTNL.cjs → chunk-PFTWPEVV.cjs} +4 -4
- package/dist/{chunk-4R7QBTNL.cjs.map → chunk-PFTWPEVV.cjs.map} +1 -1
- package/dist/chunk-PG7HNBTO.cjs +12 -0
- package/dist/{chunk-LBTAK5JA.cjs.map → chunk-PG7HNBTO.cjs.map} +1 -1
- package/dist/{chunk-ASFUY3IE.cjs → chunk-SMGXVEN3.cjs} +8 -4
- package/dist/chunk-SMGXVEN3.cjs.map +1 -0
- package/dist/{chunk-57DYMIWS.js → chunk-SO4F5LTH.js} +5 -5
- package/dist/{chunk-57DYMIWS.js.map → chunk-SO4F5LTH.js.map} +1 -1
- package/dist/{chunk-ZURCZQQ7.js → chunk-TESIDLJ6.js} +8 -4
- package/dist/chunk-TESIDLJ6.js.map +1 -0
- package/dist/{chunk-Q4B25EZO.js → chunk-TJGE4ZSX.js} +3 -3
- package/dist/{chunk-Q4B25EZO.js.map → chunk-TJGE4ZSX.js.map} +1 -1
- package/dist/{chunk-PQJGV3RE.cjs → chunk-TYBIAPPT.cjs} +83 -83
- package/dist/{chunk-PQJGV3RE.cjs.map → chunk-TYBIAPPT.cjs.map} +1 -1
- package/dist/{chunk-E3KOQYY2.js → chunk-YWMDBY43.js} +3 -3
- package/dist/{chunk-E3KOQYY2.js.map → chunk-YWMDBY43.js.map} +1 -1
- package/dist/core/index.cjs +107 -107
- package/dist/core/index.js +10 -10
- package/dist/index.css +1 -1
- package/dist/manager/index.cjs +240 -240
- package/dist/manager/index.cjs.map +1 -1
- package/dist/manager/index.d.cts +16 -3
- package/dist/manager/index.d.ts +16 -3
- package/dist/manager/index.js +7 -7
- package/dist/manager/index.js.map +1 -1
- package/dist/offline/index.cjs +112 -0
- package/dist/offline/index.cjs.map +1 -0
- package/dist/offline/index.d.cts +129 -0
- package/dist/offline/index.d.ts +129 -0
- package/dist/offline/index.js +108 -0
- package/dist/offline/index.js.map +1 -0
- package/dist/tokens.json +7 -1
- package/dist/traveller/index.cjs +35 -35
- package/dist/traveller/index.js +5 -5
- package/package.json +6 -1
- package/dist/chunk-ASFUY3IE.cjs.map +0 -1
- package/dist/chunk-LBTAK5JA.cjs +0 -12
- package/dist/chunk-ZURCZQQ7.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRequiredContext, OfflineEngineContext } from './chunk-
|
|
1
|
+
import { useRequiredContext, OfflineEngineContext } from './chunk-TESIDLJ6.js';
|
|
2
2
|
|
|
3
3
|
// src/core/hooks/useOfflineEngine.ts
|
|
4
4
|
function useOfflineEngine() {
|
|
@@ -6,5 +6,5 @@ function useOfflineEngine() {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export { useOfflineEngine };
|
|
9
|
-
//# sourceMappingURL=chunk-
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
9
|
+
//# sourceMappingURL=chunk-TJGE4ZSX.js.map
|
|
10
|
+
//# sourceMappingURL=chunk-TJGE4ZSX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/hooks/useOfflineEngine.ts"],"names":[],"mappings":";;;AAgBO,SAAS,gBAAA,GAAkC;AAChD,EAAA,OAAO,kBAAA,CAAmB,oBAAA,EAAsB,kBAAA,EAAoB,cAAc,CAAA;AACpF","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/core/hooks/useOfflineEngine.ts"],"names":[],"mappings":";;;AAgBO,SAAS,gBAAA,GAAkC;AAChD,EAAA,OAAO,kBAAA,CAAmB,oBAAA,EAAsB,kBAAA,EAAoB,cAAc,CAAA;AACpF","file":"chunk-TJGE4ZSX.js","sourcesContent":["'use client';\n\n// `08-core-hooks.md §2.1`. The escape hatch underneath every hook in §2 — a\n// composite should reach for a narrower hook before this one.\n\nimport type { OfflineEngine, OutboxOp } from 'kaafil-js/client';\nimport { OfflineEngineContext } from '../internal/contexts';\nimport { useRequiredContext } from '../internal/useRequiredContext';\n\n// Re-exported so a composite (`ManagerSyncCenterSection.types.ts`) can name\n// one outbox op's shape without importing `kaafil-js/client` directly —\n// hard rule #1.\nexport type { OutboxOp };\n\n/** Returns the engine instance `OfflineShell` opened via\n * `client.openOffline(options)`. Throws outside the provider tree. */\nexport function useOfflineEngine(): OfflineEngine {\n return useRequiredContext(OfflineEngineContext, 'useOfflineEngine', 'OfflineShell');\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSMGXVEN3_cjs = require('./chunk-SMGXVEN3.cjs');
|
|
4
4
|
var client = require('kaafil-js/client');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
|
|
@@ -99,8 +99,8 @@ function ensureTripPulled(engine, tripRef) {
|
|
|
99
99
|
|
|
100
100
|
// src/core/hooks/useSnapshotList.ts
|
|
101
101
|
function useSnapshotList(tripRef, listName, options) {
|
|
102
|
-
const engine = react.useContext(
|
|
103
|
-
const client = react.useContext(
|
|
102
|
+
const engine = react.useContext(chunkSMGXVEN3_cjs.OfflineEngineContext);
|
|
103
|
+
const client = react.useContext(chunkSMGXVEN3_cjs.KaafilClientContext);
|
|
104
104
|
const [rows, setRows] = react.useState(
|
|
105
105
|
() => engine === null ? [] : engine.snapshot.list(tripRef, listName)
|
|
106
106
|
);
|
|
@@ -161,15 +161,15 @@ function useSnapshotList(tripRef, listName, options) {
|
|
|
161
161
|
// src/core/internal/createDomainHook.ts
|
|
162
162
|
function createDomainHook(moduleKey, build) {
|
|
163
163
|
return function useDomainHook(tripRef) {
|
|
164
|
-
const { rows, loaded } =
|
|
164
|
+
const { rows, loaded } = chunkSMGXVEN3_cjs.useCapabilityRows(tripRef);
|
|
165
165
|
const ready = build(tripRef);
|
|
166
166
|
if (!loaded) {
|
|
167
167
|
return { status: "loading" };
|
|
168
168
|
}
|
|
169
169
|
const row = rows.find((candidate) => candidate.capability === moduleKey);
|
|
170
|
-
const triple = row === void 0 ?
|
|
170
|
+
const triple = row === void 0 ? chunkSMGXVEN3_cjs.UNKNOWN_CAPABILITY_TRIPLE : chunkSMGXVEN3_cjs.deriveCapabilityTriple(row);
|
|
171
171
|
if (triple.status !== "lit") {
|
|
172
|
-
const reason =
|
|
172
|
+
const reason = chunkSMGXVEN3_cjs.darkReasonFor(triple);
|
|
173
173
|
return { status: "dark", reason };
|
|
174
174
|
}
|
|
175
175
|
return { status: "ready", ...ready };
|
|
@@ -223,8 +223,8 @@ function appendPendingRows(fromAggregate, fromSnapshot) {
|
|
|
223
223
|
return pending.length === 0 ? fromAggregate : [...fromAggregate, ...pending];
|
|
224
224
|
}
|
|
225
225
|
var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
226
|
-
const client$1 =
|
|
227
|
-
const engine = react.useContext(
|
|
226
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
227
|
+
const engine = react.useContext(chunkSMGXVEN3_cjs.OfflineEngineContext);
|
|
228
228
|
const { rows: snapshotItems, syncedAt } = useSnapshotList(
|
|
229
229
|
tripRef,
|
|
230
230
|
"checklist"
|
|
@@ -288,7 +288,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
288
288
|
void refreshAggregate();
|
|
289
289
|
});
|
|
290
290
|
}, [engine, refreshAggregate]);
|
|
291
|
-
const addItemMutation =
|
|
291
|
+
const addItemMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
292
292
|
tripRef,
|
|
293
293
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
294
294
|
tripRef,
|
|
@@ -333,7 +333,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
333
333
|
// lane for exactly that reason.
|
|
334
334
|
direct: (liveClient, input) => liveClient.checklists.items.add({ tripRef, ...input })
|
|
335
335
|
});
|
|
336
|
-
const patchItemMutation =
|
|
336
|
+
const patchItemMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
337
337
|
tripRef,
|
|
338
338
|
enqueue: (engine2, input) => {
|
|
339
339
|
const { itemId, version, ...body } = input;
|
|
@@ -348,7 +348,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
348
348
|
},
|
|
349
349
|
direct: (liveClient, input) => liveClient.checklists.items.patch({ tripRef, ...input })
|
|
350
350
|
});
|
|
351
|
-
const removeItemMutation =
|
|
351
|
+
const removeItemMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
352
352
|
tripRef,
|
|
353
353
|
enqueue: (engine2, input) => {
|
|
354
354
|
const { itemId, version } = input;
|
|
@@ -362,7 +362,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
362
362
|
},
|
|
363
363
|
direct: (liveClient, input) => liveClient.checklists.items.remove({ tripRef, ...input })
|
|
364
364
|
});
|
|
365
|
-
const toggleItemMutation =
|
|
365
|
+
const toggleItemMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
366
366
|
tripRef,
|
|
367
367
|
enqueue: (engine2, input) => {
|
|
368
368
|
const { itemId, ...body } = input;
|
|
@@ -378,7 +378,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
378
378
|
},
|
|
379
379
|
direct: (liveClient, input) => liveClient.checklists.items.toggle({ tripRef, ...input })
|
|
380
380
|
});
|
|
381
|
-
const pullTemplateMutation =
|
|
381
|
+
const pullTemplateMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
382
382
|
tripRef,
|
|
383
383
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
384
384
|
tripRef,
|
|
@@ -485,7 +485,7 @@ function useChecklists(tripRef) {
|
|
|
485
485
|
return useChecklistsInternal(tripRef);
|
|
486
486
|
}
|
|
487
487
|
var useCloseoutInternal = createDomainHook("closing-day", (tripRef) => {
|
|
488
|
-
const client =
|
|
488
|
+
const client = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
489
489
|
const [aggregate, setAggregate] = react.useState(void 0);
|
|
490
490
|
const [loaded, setLoaded] = react.useState(false);
|
|
491
491
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -585,7 +585,7 @@ function optimisticCollection(input, syncedAt) {
|
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
587
|
var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
588
|
-
const client$1 =
|
|
588
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
589
589
|
const {
|
|
590
590
|
rows: collections,
|
|
591
591
|
syncedAt,
|
|
@@ -622,7 +622,7 @@ var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
|
622
622
|
react.useEffect(() => {
|
|
623
623
|
void refreshEligible(eligibleStatus);
|
|
624
624
|
}, [refreshEligible, eligibleStatus]);
|
|
625
|
-
const recordMutation =
|
|
625
|
+
const recordMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
626
626
|
tripRef,
|
|
627
627
|
enqueue: (engine, input) => engine.enqueue({
|
|
628
628
|
tripRef,
|
|
@@ -654,7 +654,7 @@ var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
|
654
654
|
},
|
|
655
655
|
[recordMutate, refreshEligible]
|
|
656
656
|
);
|
|
657
|
-
const voidMutation =
|
|
657
|
+
const voidMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
658
658
|
tripRef,
|
|
659
659
|
enqueue: (engine, input) => {
|
|
660
660
|
const { collectionId, version, ...body } = input;
|
|
@@ -698,7 +698,7 @@ function useCollections(tripRef) {
|
|
|
698
698
|
return useCollectionsInternal(tripRef);
|
|
699
699
|
}
|
|
700
700
|
var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
701
|
-
const client$1 =
|
|
701
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
702
702
|
const {
|
|
703
703
|
rows: expenses,
|
|
704
704
|
syncedAt,
|
|
@@ -727,7 +727,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
727
727
|
react.useEffect(() => {
|
|
728
728
|
void refreshTotals();
|
|
729
729
|
}, [refreshTotals]);
|
|
730
|
-
const engine = react.useContext(
|
|
730
|
+
const engine = react.useContext(chunkSMGXVEN3_cjs.OfflineEngineContext);
|
|
731
731
|
react.useEffect(() => {
|
|
732
732
|
if (engine === null) {
|
|
733
733
|
return;
|
|
@@ -737,7 +737,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
737
737
|
});
|
|
738
738
|
return unsubscribe;
|
|
739
739
|
}, [engine, refreshTotals]);
|
|
740
|
-
const logMutation =
|
|
740
|
+
const logMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
741
741
|
tripRef,
|
|
742
742
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
743
743
|
tripRef,
|
|
@@ -758,7 +758,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
758
758
|
// reimbursement, and an admin has no business standing in for them.
|
|
759
759
|
direct: (liveClient, input) => liveClient.expenses.log({ tripRef, ...input })
|
|
760
760
|
});
|
|
761
|
-
const linkReceiptMutation =
|
|
761
|
+
const linkReceiptMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
762
762
|
tripRef,
|
|
763
763
|
enqueue: (engine2, input) => {
|
|
764
764
|
const { expenseId, ...body } = input;
|
|
@@ -781,7 +781,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
781
781
|
// Widening it would mean either breaking rule #4 or making the key
|
|
782
782
|
// optional on the wire, neither of which belongs in a UIKit pass.
|
|
783
783
|
});
|
|
784
|
-
const voidMutation =
|
|
784
|
+
const voidMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
785
785
|
tripRef,
|
|
786
786
|
enqueue: (engine2, input) => {
|
|
787
787
|
const { expenseId, version, ...body } = input;
|
|
@@ -796,7 +796,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
796
796
|
},
|
|
797
797
|
direct: (liveClient, input) => liveClient.expenses.void({ tripRef, ...input })
|
|
798
798
|
});
|
|
799
|
-
const submitClaimMutation =
|
|
799
|
+
const submitClaimMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
800
800
|
tripRef,
|
|
801
801
|
enqueue: (engine2, input) => {
|
|
802
802
|
const { expenseId } = input;
|
|
@@ -809,7 +809,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
809
809
|
});
|
|
810
810
|
}
|
|
811
811
|
});
|
|
812
|
-
const withdrawClaimMutation =
|
|
812
|
+
const withdrawClaimMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
813
813
|
tripRef,
|
|
814
814
|
enqueue: (engine2, input) => {
|
|
815
815
|
const { expenseId, version } = input;
|
|
@@ -851,7 +851,7 @@ function useExpenses(tripRef) {
|
|
|
851
851
|
}
|
|
852
852
|
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
853
853
|
function useFiles(context) {
|
|
854
|
-
const client =
|
|
854
|
+
const client = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
855
855
|
const { tripRef } = context;
|
|
856
856
|
const request = react.useCallback(
|
|
857
857
|
(input) => client.files.request({ ...input, tripRef }),
|
|
@@ -923,7 +923,7 @@ function useFiles(context) {
|
|
|
923
923
|
return { request, confirm, meta, url, list, managerView, upload };
|
|
924
924
|
}
|
|
925
925
|
var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
926
|
-
const client$1 =
|
|
926
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
927
927
|
const { rows: movements, syncedAt } = useSnapshotList(tripRef, "float");
|
|
928
928
|
const [summaryRows, setSummaryRows] = react.useState([]);
|
|
929
929
|
const [summaryLoaded, setSummaryLoaded] = react.useState(false);
|
|
@@ -943,7 +943,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
943
943
|
react.useEffect(() => {
|
|
944
944
|
void refreshSummary();
|
|
945
945
|
}, [refreshSummary]);
|
|
946
|
-
const issueMutation =
|
|
946
|
+
const issueMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
947
947
|
tripRef,
|
|
948
948
|
enqueue: (engine, input) => engine.enqueue({
|
|
949
949
|
tripRef,
|
|
@@ -961,7 +961,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
961
961
|
// transport at all.
|
|
962
962
|
direct: (liveClient, input) => liveClient.float.issue({ tripRef, ...input })
|
|
963
963
|
});
|
|
964
|
-
const returnMutation =
|
|
964
|
+
const returnMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
965
965
|
tripRef,
|
|
966
966
|
enqueue: (engine, input) => engine.enqueue({
|
|
967
967
|
tripRef,
|
|
@@ -972,7 +972,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
972
972
|
}),
|
|
973
973
|
direct: (liveClient, input) => liveClient.float.return({ tripRef, ...input })
|
|
974
974
|
});
|
|
975
|
-
const adjustMutation =
|
|
975
|
+
const adjustMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
976
976
|
tripRef,
|
|
977
977
|
enqueue: (engine, input) => engine.enqueue({
|
|
978
978
|
tripRef,
|
|
@@ -1035,8 +1035,8 @@ function useFloat(tripRef) {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
var FORM_FIELD_KIND_SINGLE_BOOLEAN = "CHECKBOX";
|
|
1037
1037
|
var useFormsInternal = createDomainHook("forms", (tripRef) => {
|
|
1038
|
-
const client$1 =
|
|
1039
|
-
const engine = react.useContext(
|
|
1038
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
1039
|
+
const engine = react.useContext(chunkSMGXVEN3_cjs.OfflineEngineContext);
|
|
1040
1040
|
const [forms, setForms] = react.useState([]);
|
|
1041
1041
|
const [syncedAt, setSyncedAt] = react.useState(void 0);
|
|
1042
1042
|
const refreshForms = react.useCallback(async () => {
|
|
@@ -1081,7 +1081,7 @@ var useFormsInternal = createDomainHook("forms", (tripRef) => {
|
|
|
1081
1081
|
},
|
|
1082
1082
|
[client$1, tripRef]
|
|
1083
1083
|
);
|
|
1084
|
-
const submitMutation =
|
|
1084
|
+
const submitMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1085
1085
|
tripRef,
|
|
1086
1086
|
enqueue: (engine2, input) => {
|
|
1087
1087
|
const { formId, ...body } = input;
|
|
@@ -1251,7 +1251,7 @@ function isLiveItineraryItem(row) {
|
|
|
1251
1251
|
return !("_tombstone" in row);
|
|
1252
1252
|
}
|
|
1253
1253
|
function useItinerary(tripRef) {
|
|
1254
|
-
const client$1 =
|
|
1254
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
1255
1255
|
const [trip, setTrip] = react.useState(void 0);
|
|
1256
1256
|
const [initialDayIso, setInitialDayIso] = react.useState(void 0);
|
|
1257
1257
|
const [canAddItems, setCanAddItems] = react.useState(false);
|
|
@@ -1280,7 +1280,7 @@ function useItinerary(tripRef) {
|
|
|
1280
1280
|
react.useEffect(() => {
|
|
1281
1281
|
void refresh();
|
|
1282
1282
|
}, [refresh]);
|
|
1283
|
-
const engine = react.useContext(
|
|
1283
|
+
const engine = react.useContext(chunkSMGXVEN3_cjs.OfflineEngineContext);
|
|
1284
1284
|
const refreshAfterDrain = react.useCallback(() => {
|
|
1285
1285
|
if (engine === null) {
|
|
1286
1286
|
return;
|
|
@@ -1306,7 +1306,7 @@ function useItinerary(tripRef) {
|
|
|
1306
1306
|
},
|
|
1307
1307
|
[client$1, tripRef]
|
|
1308
1308
|
);
|
|
1309
|
-
const patchDayMutation =
|
|
1309
|
+
const patchDayMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1310
1310
|
tripRef,
|
|
1311
1311
|
enqueue: (engine2, input) => {
|
|
1312
1312
|
const { dayIndex, version, ...body } = input;
|
|
@@ -1331,7 +1331,7 @@ function useItinerary(tripRef) {
|
|
|
1331
1331
|
},
|
|
1332
1332
|
[patchDayMutate, refresh, refreshAfterDrain]
|
|
1333
1333
|
);
|
|
1334
|
-
const addItemMutation =
|
|
1334
|
+
const addItemMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1335
1335
|
tripRef,
|
|
1336
1336
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
1337
1337
|
tripRef,
|
|
@@ -1352,7 +1352,7 @@ function useItinerary(tripRef) {
|
|
|
1352
1352
|
},
|
|
1353
1353
|
[addItemMutate, refresh, refreshAfterDrain]
|
|
1354
1354
|
);
|
|
1355
|
-
const patchItemMutation =
|
|
1355
|
+
const patchItemMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1356
1356
|
tripRef,
|
|
1357
1357
|
enqueue: (engine2, input) => {
|
|
1358
1358
|
const { itemId, version, ...body } = input;
|
|
@@ -1377,7 +1377,7 @@ function useItinerary(tripRef) {
|
|
|
1377
1377
|
},
|
|
1378
1378
|
[patchItemMutate, refresh, refreshAfterDrain]
|
|
1379
1379
|
);
|
|
1380
|
-
const removeItemMutation =
|
|
1380
|
+
const removeItemMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1381
1381
|
tripRef,
|
|
1382
1382
|
enqueue: (engine2, input) => {
|
|
1383
1383
|
const { itemId, version } = input;
|
|
@@ -1401,7 +1401,7 @@ function useItinerary(tripRef) {
|
|
|
1401
1401
|
},
|
|
1402
1402
|
[removeItemMutate, refresh, refreshAfterDrain]
|
|
1403
1403
|
);
|
|
1404
|
-
const reorderItemMutation =
|
|
1404
|
+
const reorderItemMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1405
1405
|
tripRef,
|
|
1406
1406
|
enqueue: (engine2, input) => {
|
|
1407
1407
|
const { itemId, ...body } = input;
|
|
@@ -1455,12 +1455,12 @@ function useItinerary(tripRef) {
|
|
|
1455
1455
|
};
|
|
1456
1456
|
}
|
|
1457
1457
|
function useManagers(tripRef) {
|
|
1458
|
-
const client =
|
|
1459
|
-
const persona =
|
|
1458
|
+
const client = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
1459
|
+
const persona = chunkSMGXVEN3_cjs.usePersona();
|
|
1460
1460
|
const [result, setResult] = react.useState({ status: "loading" });
|
|
1461
1461
|
react.useEffect(() => {
|
|
1462
1462
|
if (persona === "share") {
|
|
1463
|
-
if (
|
|
1463
|
+
if (chunkSMGXVEN3_cjs.isDevelopment()) {
|
|
1464
1464
|
throw new Error(
|
|
1465
1465
|
"useManagers() was called from a share session \u2014 it is manager/agencyAdmin only."
|
|
1466
1466
|
);
|
|
@@ -1485,7 +1485,7 @@ function useManagers(tripRef) {
|
|
|
1485
1485
|
return result;
|
|
1486
1486
|
}
|
|
1487
1487
|
function useManagerToday(tripRef) {
|
|
1488
|
-
const client =
|
|
1488
|
+
const client = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
1489
1489
|
const [result, setResult] = react.useState({ status: "loading" });
|
|
1490
1490
|
react.useEffect(() => {
|
|
1491
1491
|
let cancelled = false;
|
|
@@ -1511,7 +1511,7 @@ function isLiveParty(row) {
|
|
|
1511
1511
|
return !("_tombstone" in row);
|
|
1512
1512
|
}
|
|
1513
1513
|
function useParties(tripRef) {
|
|
1514
|
-
const client$1 =
|
|
1514
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
1515
1515
|
const [rows, setRows] = react.useState([]);
|
|
1516
1516
|
const [listLoaded, setListLoaded] = react.useState(false);
|
|
1517
1517
|
const [listFetchFailed, setListFetchFailed] = react.useState(false);
|
|
@@ -1551,7 +1551,7 @@ function useParties(tripRef) {
|
|
|
1551
1551
|
react.useEffect(() => {
|
|
1552
1552
|
void refreshRoster();
|
|
1553
1553
|
}, [refreshRoster]);
|
|
1554
|
-
const addMutation =
|
|
1554
|
+
const addMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1555
1555
|
tripRef,
|
|
1556
1556
|
enqueue: (engine, input) => engine.enqueue({
|
|
1557
1557
|
tripRef,
|
|
@@ -1561,7 +1561,7 @@ function useParties(tripRef) {
|
|
|
1561
1561
|
body: input
|
|
1562
1562
|
})
|
|
1563
1563
|
});
|
|
1564
|
-
const patchMutation =
|
|
1564
|
+
const patchMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1565
1565
|
tripRef,
|
|
1566
1566
|
enqueue: (engine, input) => {
|
|
1567
1567
|
const { partyId, version, ...body } = input;
|
|
@@ -1575,7 +1575,7 @@ function useParties(tripRef) {
|
|
|
1575
1575
|
});
|
|
1576
1576
|
}
|
|
1577
1577
|
});
|
|
1578
|
-
const removeMutation =
|
|
1578
|
+
const removeMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1579
1579
|
tripRef,
|
|
1580
1580
|
enqueue: (engine, input) => {
|
|
1581
1581
|
const { partyId } = input;
|
|
@@ -1680,7 +1680,7 @@ function optimisticPickupStop(input, syncedAt) {
|
|
|
1680
1680
|
};
|
|
1681
1681
|
}
|
|
1682
1682
|
var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
1683
|
-
const client$1 =
|
|
1683
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
1684
1684
|
const {
|
|
1685
1685
|
rows: stops,
|
|
1686
1686
|
syncedAt,
|
|
@@ -1691,7 +1691,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1691
1691
|
return { rows: response, syncedAt: response.meta.serverTime };
|
|
1692
1692
|
}
|
|
1693
1693
|
});
|
|
1694
|
-
const createMutation =
|
|
1694
|
+
const createMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1695
1695
|
tripRef,
|
|
1696
1696
|
enqueue: (engine, input) => engine.enqueue({
|
|
1697
1697
|
tripRef,
|
|
@@ -1717,7 +1717,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1717
1717
|
// before it left the process. See this file's own persona note.
|
|
1718
1718
|
direct: (liveClient, input) => liveClient.pickups.create({ tripRef, ...input })
|
|
1719
1719
|
});
|
|
1720
|
-
const patchMutation =
|
|
1720
|
+
const patchMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1721
1721
|
tripRef,
|
|
1722
1722
|
enqueue: (engine, input) => {
|
|
1723
1723
|
const { pointId, version, ...body } = input;
|
|
@@ -1732,7 +1732,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1732
1732
|
},
|
|
1733
1733
|
direct: (liveClient, input) => liveClient.pickups.patch({ tripRef, ...input })
|
|
1734
1734
|
});
|
|
1735
|
-
const removeMutation =
|
|
1735
|
+
const removeMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1736
1736
|
tripRef,
|
|
1737
1737
|
enqueue: (engine, input) => {
|
|
1738
1738
|
const { pointId, version, force } = input;
|
|
@@ -1747,7 +1747,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1747
1747
|
},
|
|
1748
1748
|
direct: (liveClient, input) => liveClient.pickups.remove({ tripRef, ...input })
|
|
1749
1749
|
});
|
|
1750
|
-
const reorderMutation =
|
|
1750
|
+
const reorderMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1751
1751
|
tripRef,
|
|
1752
1752
|
enqueue: (engine, input) => engine.enqueue({
|
|
1753
1753
|
tripRef,
|
|
@@ -1758,7 +1758,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1758
1758
|
}),
|
|
1759
1759
|
direct: (liveClient, input) => liveClient.pickups.reorder({ tripRef, ...input })
|
|
1760
1760
|
});
|
|
1761
|
-
const assignMutation =
|
|
1761
|
+
const assignMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1762
1762
|
tripRef,
|
|
1763
1763
|
enqueue: (engine, input) => {
|
|
1764
1764
|
const { pointId, ...body } = input;
|
|
@@ -1772,7 +1772,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1772
1772
|
},
|
|
1773
1773
|
direct: (liveClient, input) => liveClient.pickups.assign({ tripRef, ...input })
|
|
1774
1774
|
});
|
|
1775
|
-
const boardMutation =
|
|
1775
|
+
const boardMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1776
1776
|
tripRef,
|
|
1777
1777
|
enqueue: (engine, input) => {
|
|
1778
1778
|
const { pointId, ...body } = input;
|
|
@@ -1785,7 +1785,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1785
1785
|
});
|
|
1786
1786
|
}
|
|
1787
1787
|
});
|
|
1788
|
-
const correctBoardStatusMutation =
|
|
1788
|
+
const correctBoardStatusMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1789
1789
|
tripRef,
|
|
1790
1790
|
enqueue: (engine, input) => {
|
|
1791
1791
|
const { pointId, travellerId, ...body } = input;
|
|
@@ -1802,7 +1802,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1802
1802
|
// still get none, because they are `managerAuth`-only.
|
|
1803
1803
|
direct: (liveClient, input) => liveClient.pickups.correctBoardStatus({ tripRef, ...input })
|
|
1804
1804
|
});
|
|
1805
|
-
const closeMutation =
|
|
1805
|
+
const closeMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1806
1806
|
tripRef,
|
|
1807
1807
|
enqueue: (engine, input) => {
|
|
1808
1808
|
const { pointId, ...body } = input;
|
|
@@ -1815,7 +1815,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1815
1815
|
});
|
|
1816
1816
|
}
|
|
1817
1817
|
});
|
|
1818
|
-
const reopenMutation =
|
|
1818
|
+
const reopenMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1819
1819
|
tripRef,
|
|
1820
1820
|
enqueue: (engine, input) => {
|
|
1821
1821
|
const { pointId } = input;
|
|
@@ -1874,7 +1874,7 @@ function optimisticStayWindow(input, syncedAt) {
|
|
|
1874
1874
|
};
|
|
1875
1875
|
}
|
|
1876
1876
|
var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
1877
|
-
const client$1 =
|
|
1877
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
1878
1878
|
const {
|
|
1879
1879
|
rows: rooms,
|
|
1880
1880
|
syncedAt: roomsSyncedAt,
|
|
@@ -1898,7 +1898,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1898
1898
|
const refreshLive = react.useCallback(async () => {
|
|
1899
1899
|
await Promise.all([refreshRoomsLive(), refreshWindowsLive()]);
|
|
1900
1900
|
}, [refreshRoomsLive, refreshWindowsLive]);
|
|
1901
|
-
const assignMutation =
|
|
1901
|
+
const assignMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1902
1902
|
tripRef,
|
|
1903
1903
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
1904
1904
|
tripRef,
|
|
@@ -1944,7 +1944,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1944
1944
|
react.useEffect(() => {
|
|
1945
1945
|
void refreshUnassignedPool();
|
|
1946
1946
|
}, [refreshUnassignedPool]);
|
|
1947
|
-
const engine = react.useContext(
|
|
1947
|
+
const engine = react.useContext(chunkSMGXVEN3_cjs.OfflineEngineContext);
|
|
1948
1948
|
react.useEffect(() => {
|
|
1949
1949
|
if (engine === null) {
|
|
1950
1950
|
return;
|
|
@@ -1963,7 +1963,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1963
1963
|
},
|
|
1964
1964
|
[assignMutate, refreshUnassignedPool]
|
|
1965
1965
|
);
|
|
1966
|
-
const createWindowMutation =
|
|
1966
|
+
const createWindowMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1967
1967
|
tripRef,
|
|
1968
1968
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
1969
1969
|
tripRef,
|
|
@@ -1981,7 +1981,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1981
1981
|
}),
|
|
1982
1982
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.create({ tripRef, ...input })
|
|
1983
1983
|
});
|
|
1984
|
-
const patchWindowMutation =
|
|
1984
|
+
const patchWindowMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
1985
1985
|
tripRef,
|
|
1986
1986
|
enqueue: (engine2, input) => {
|
|
1987
1987
|
const { windowId, version, ...body } = input;
|
|
@@ -1996,7 +1996,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1996
1996
|
},
|
|
1997
1997
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.patch({ tripRef, ...input })
|
|
1998
1998
|
});
|
|
1999
|
-
const removeWindowMutation =
|
|
1999
|
+
const removeWindowMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2000
2000
|
tripRef,
|
|
2001
2001
|
enqueue: (engine2, input) => {
|
|
2002
2002
|
const { windowId, version, force } = input;
|
|
@@ -2011,7 +2011,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
2011
2011
|
},
|
|
2012
2012
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.remove({ tripRef, ...input })
|
|
2013
2013
|
});
|
|
2014
|
-
const createRoomMutation =
|
|
2014
|
+
const createRoomMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2015
2015
|
tripRef,
|
|
2016
2016
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
2017
2017
|
tripRef,
|
|
@@ -2022,7 +2022,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
2022
2022
|
}),
|
|
2023
2023
|
direct: (liveClient, input) => liveClient.rooming.rooms.create({ tripRef, ...input })
|
|
2024
2024
|
});
|
|
2025
|
-
const patchRoomMutation =
|
|
2025
|
+
const patchRoomMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2026
2026
|
tripRef,
|
|
2027
2027
|
enqueue: (engine2, input) => {
|
|
2028
2028
|
const { roomId, version, ...body } = input;
|
|
@@ -2037,7 +2037,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
2037
2037
|
},
|
|
2038
2038
|
direct: (liveClient, input) => liveClient.rooming.rooms.patch({ tripRef, ...input })
|
|
2039
2039
|
});
|
|
2040
|
-
const removeRoomMutation =
|
|
2040
|
+
const removeRoomMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2041
2041
|
tripRef,
|
|
2042
2042
|
enqueue: (engine2, input) => {
|
|
2043
2043
|
const { roomId, version, force } = input;
|
|
@@ -2083,7 +2083,7 @@ function useRooming(tripRef) {
|
|
|
2083
2083
|
return useRoomingInternal(tripRef);
|
|
2084
2084
|
}
|
|
2085
2085
|
var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
2086
|
-
const client$1 =
|
|
2086
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
2087
2087
|
const {
|
|
2088
2088
|
rows: vehicles,
|
|
2089
2089
|
syncedAt,
|
|
@@ -2094,7 +2094,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2094
2094
|
return { rows: response.vehicles, syncedAt: response.meta.serverTime };
|
|
2095
2095
|
}
|
|
2096
2096
|
});
|
|
2097
|
-
const assignMutation =
|
|
2097
|
+
const assignMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2098
2098
|
tripRef,
|
|
2099
2099
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
2100
2100
|
tripRef,
|
|
@@ -2133,7 +2133,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2133
2133
|
react.useEffect(() => {
|
|
2134
2134
|
void refreshUnassignedPool();
|
|
2135
2135
|
}, [refreshUnassignedPool]);
|
|
2136
|
-
const engine = react.useContext(
|
|
2136
|
+
const engine = react.useContext(chunkSMGXVEN3_cjs.OfflineEngineContext);
|
|
2137
2137
|
react.useEffect(() => {
|
|
2138
2138
|
if (engine === null) {
|
|
2139
2139
|
return;
|
|
@@ -2152,7 +2152,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2152
2152
|
},
|
|
2153
2153
|
[assignMutate, refreshUnassignedPool]
|
|
2154
2154
|
);
|
|
2155
|
-
const createVehicleMutation =
|
|
2155
|
+
const createVehicleMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2156
2156
|
tripRef,
|
|
2157
2157
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
2158
2158
|
tripRef,
|
|
@@ -2163,7 +2163,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2163
2163
|
}),
|
|
2164
2164
|
direct: (liveClient, input) => liveClient.seating.vehicles.create({ tripRef, ...input })
|
|
2165
2165
|
});
|
|
2166
|
-
const patchVehicleMutation =
|
|
2166
|
+
const patchVehicleMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2167
2167
|
tripRef,
|
|
2168
2168
|
enqueue: (engine2, input) => {
|
|
2169
2169
|
const { vehicleId, version, ...body } = input;
|
|
@@ -2178,7 +2178,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2178
2178
|
},
|
|
2179
2179
|
direct: (liveClient, input) => liveClient.seating.vehicles.patch({ tripRef, ...input })
|
|
2180
2180
|
});
|
|
2181
|
-
const removeVehicleMutation =
|
|
2181
|
+
const removeVehicleMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2182
2182
|
tripRef,
|
|
2183
2183
|
enqueue: (engine2, input) => {
|
|
2184
2184
|
const { vehicleId, version } = input;
|
|
@@ -2220,7 +2220,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2220
2220
|
},
|
|
2221
2221
|
[patchVehicleMutate, vehicles]
|
|
2222
2222
|
);
|
|
2223
|
-
const linkManagerMutation =
|
|
2223
|
+
const linkManagerMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2224
2224
|
tripRef,
|
|
2225
2225
|
enqueue: (engine2, input) => {
|
|
2226
2226
|
const { vehicleId, ...body } = input;
|
|
@@ -2234,7 +2234,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2234
2234
|
},
|
|
2235
2235
|
direct: (liveClient, input) => liveClient.seating.vehicles.manager.link({ tripRef, ...input })
|
|
2236
2236
|
});
|
|
2237
|
-
const unlinkManagerMutation =
|
|
2237
|
+
const unlinkManagerMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2238
2238
|
tripRef,
|
|
2239
2239
|
enqueue: (engine2, input) => {
|
|
2240
2240
|
const { vehicleId, version } = input;
|
|
@@ -2277,7 +2277,7 @@ function useSeating(tripRef) {
|
|
|
2277
2277
|
return useSeatingInternal(tripRef);
|
|
2278
2278
|
}
|
|
2279
2279
|
function useTravellerProfile(tripRef, travellerRef) {
|
|
2280
|
-
const client$1 =
|
|
2280
|
+
const client$1 = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
2281
2281
|
const [read, setRead] = react.useState(void 0);
|
|
2282
2282
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
2283
2283
|
const refresh = react.useCallback(async () => {
|
|
@@ -2292,8 +2292,8 @@ function useTravellerProfile(tripRef, travellerRef) {
|
|
|
2292
2292
|
react.useEffect(() => {
|
|
2293
2293
|
void refresh();
|
|
2294
2294
|
}, [refresh]);
|
|
2295
|
-
|
|
2296
|
-
const noteMutation =
|
|
2295
|
+
chunkSMGXVEN3_cjs.useOfflineEvent("sync.drained", refresh);
|
|
2296
|
+
const noteMutation = chunkSMGXVEN3_cjs.useOfflineMutation({
|
|
2297
2297
|
tripRef,
|
|
2298
2298
|
enqueue: (engine, input) => engine.enqueue({
|
|
2299
2299
|
tripRef,
|
|
@@ -2315,8 +2315,8 @@ function useTravellerProfile(tripRef, travellerRef) {
|
|
|
2315
2315
|
return { read, readFailed, refresh, addNote };
|
|
2316
2316
|
}
|
|
2317
2317
|
function useVendors(tripRef, agencyRef) {
|
|
2318
|
-
const client =
|
|
2319
|
-
const { rows, loaded: capabilitiesLoaded } =
|
|
2318
|
+
const client = chunkSMGXVEN3_cjs.useKaafilClient();
|
|
2319
|
+
const { rows, loaded: capabilitiesLoaded } = chunkSMGXVEN3_cjs.useCapabilityRows(tripRef);
|
|
2320
2320
|
const [vendors, setVendors] = react.useState([]);
|
|
2321
2321
|
const [listLoaded, setListLoaded] = react.useState(false);
|
|
2322
2322
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -2345,9 +2345,9 @@ function useVendors(tripRef, agencyRef) {
|
|
|
2345
2345
|
return { status: "loading" };
|
|
2346
2346
|
}
|
|
2347
2347
|
const row = rows.find((candidate) => candidate.capability === "vendors");
|
|
2348
|
-
const triple = row === void 0 ?
|
|
2348
|
+
const triple = row === void 0 ? chunkSMGXVEN3_cjs.UNKNOWN_CAPABILITY_TRIPLE : chunkSMGXVEN3_cjs.deriveCapabilityTriple(row);
|
|
2349
2349
|
if (triple.status !== "lit") {
|
|
2350
|
-
const reason =
|
|
2350
|
+
const reason = chunkSMGXVEN3_cjs.darkReasonFor(triple);
|
|
2351
2351
|
return { status: "dark", reason };
|
|
2352
2352
|
}
|
|
2353
2353
|
if (!listLoaded && lastFetchFailed) {
|
|
@@ -2416,5 +2416,5 @@ exports.useSeating = useSeating;
|
|
|
2416
2416
|
exports.useSnapshotList = useSnapshotList;
|
|
2417
2417
|
exports.useTravellerProfile = useTravellerProfile;
|
|
2418
2418
|
exports.useVendors = useVendors;
|
|
2419
|
-
//# sourceMappingURL=chunk-
|
|
2420
|
-
//# sourceMappingURL=chunk-
|
|
2419
|
+
//# sourceMappingURL=chunk-TYBIAPPT.cjs.map
|
|
2420
|
+
//# sourceMappingURL=chunk-TYBIAPPT.cjs.map
|