@flowselections/floriday-afhandeling-module 1.0.73 → 1.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/afhandeling/ControleLijstPrint.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ControleLijstPrint.js +5 -2
- package/dist-lib/components/afhandeling/ControlePage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ControlePage.js +17 -6
- package/dist-lib/components/afhandeling/DeliveryLocationPicker.d.ts +6 -0
- package/dist-lib/components/afhandeling/DeliveryLocationPicker.d.ts.map +1 -0
- package/dist-lib/components/afhandeling/DeliveryLocationPicker.js +29 -0
- package/dist-lib/components/afhandeling/SignupAutoSendBlock.d.ts +5 -0
- package/dist-lib/components/afhandeling/SignupAutoSendBlock.d.ts.map +1 -0
- package/dist-lib/components/afhandeling/SignupAutoSendBlock.js +37 -0
- package/dist-lib/components/afhandeling/VervoerderForm.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VervoerderForm.js +15 -4
- package/dist-lib/components/afhandeling/VervoerdersPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VervoerdersPage.js +24 -4
- package/dist-lib/components/settings/AfhandelingSettingsCard.d.ts.map +1 -1
- package/dist-lib/components/settings/AfhandelingSettingsCard.js +2 -1
- package/dist-lib/components/settings/VervoerdersSettingsCard.js +4 -4
- package/dist-lib/integrations/supabase/previewAuthStorage.d.ts +11 -5
- package/dist-lib/integrations/supabase/previewAuthStorage.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/previewAuthStorage.js +38 -21
- package/dist-lib/integrations/supabase/types.d.ts +1660 -40
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/carrierReadiness.d.ts +26 -0
- package/dist-lib/lib/carrierReadiness.d.ts.map +1 -0
- package/dist-lib/lib/carrierReadiness.js +32 -0
- package/dist-lib/lib/carrierSignup.functions.d.ts +57 -0
- package/dist-lib/lib/carrierSignup.functions.d.ts.map +1 -1
- package/dist-lib/lib/carrierSignup.functions.js +43 -0
- package/dist-lib/lib/carriers.functions.d.ts +43 -1
- package/dist-lib/lib/carriers.functions.d.ts.map +1 -1
- package/dist-lib/lib/carriers.functions.js +80 -21
- package/dist-lib/lib/cartAssignments.functions.d.ts.map +1 -1
- package/dist-lib/lib/cartAssignments.functions.js +12 -11
- package/dist-lib/lib/cartControl.functions.d.ts.map +1 -1
- package/dist-lib/lib/cartControl.functions.js +17 -16
- package/dist-lib/lib/cartSeqFout.d.ts +11 -0
- package/dist-lib/lib/cartSeqFout.d.ts.map +1 -0
- package/dist-lib/lib/cartSeqFout.js +18 -0
- package/dist-lib/lib/controleLijst.functions.d.ts +26 -0
- package/dist-lib/lib/controleLijst.functions.d.ts.map +1 -0
- package/dist-lib/lib/controleLijst.functions.js +55 -0
- package/dist-lib/lib/controleLijstPayload.d.ts +32 -0
- package/dist-lib/lib/controleLijstPayload.d.ts.map +1 -0
- package/dist-lib/lib/controleLijstPayload.js +92 -0
- package/dist-lib/lib/controleLijstPayload.test.d.ts +2 -0
- package/dist-lib/lib/controleLijstPayload.test.d.ts.map +1 -0
- package/dist-lib/lib/controleLijstPayload.test.js +34 -0
- package/dist-lib/lib/floridayFulfilled.d.ts.map +1 -1
- package/dist-lib/lib/floridayFulfilled.js +2 -0
- package/dist-lib/lib/signupMailText.d.ts +2 -0
- package/dist-lib/lib/signupMailText.d.ts.map +1 -1
- package/dist-lib/lib/signupMailText.js +25 -0
- package/package.json +3 -2
- package/schema/90_afhandeling.sql +1591 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControleLijstPrint.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ControleLijstPrint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ControleLijstPrint.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ControleLijstPrint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAInE,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAuCnC;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,WAAW,EAAE,EACpB,IAAI,GAAE,eAAsB,GAC3B,MAAM,CAqGR"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { countryCode } from "../../lib/countries.js";
|
|
2
|
+
import { amsterdamDay } from "../../lib/timezone.js";
|
|
3
|
+
import { controleStatusTekst } from "../../lib/controleLijstPayload.js";
|
|
2
4
|
import { getPrintDict, PICKSTATION_LOCALE, } from "../../lib/pickstationI18n.js";
|
|
3
5
|
const DAY_ABBR_BY_LANG = {
|
|
4
6
|
nl: ["ZO", "MA", "DI", "WO", "DO", "VR", "ZA"],
|
|
@@ -45,10 +47,11 @@ export function renderControleLijstHtml(carts, lang = "nl") {
|
|
|
45
47
|
case "ready": return t.statusReady;
|
|
46
48
|
case "shipped": return t.statusShipped;
|
|
47
49
|
case "delivered": return t.statusDelivered;
|
|
48
|
-
default: return String(status);
|
|
50
|
+
default: return controleStatusTekst(String(status), printedCount);
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
|
-
const today = new Date().toLocaleDateString(locale, {
|
|
53
|
+
const today = new Date(`${amsterdamDay(new Date())}T12:00:00Z`).toLocaleDateString(locale, {
|
|
54
|
+
timeZone: "UTC",
|
|
52
55
|
weekday: "long",
|
|
53
56
|
day: "2-digit",
|
|
54
57
|
month: "long",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlePage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ControlePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlePage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ControlePage.tsx"],"names":[],"mappings":"AAoJA,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAO,+BA++BpE"}
|
|
@@ -10,6 +10,8 @@ import { ScanControleView } from "./ScanControleView.js";
|
|
|
10
10
|
import { renderControleLijstHtml } from "./ControleLijstPrint.js";
|
|
11
11
|
import { printHtmlDocument, printFoutMelding } from "../../lib/printing.js";
|
|
12
12
|
import { callServerFn } from "../../lib/serverFnError.js";
|
|
13
|
+
import { printControleLijstViaLayout } from "../../lib/controleLijst.functions.js";
|
|
14
|
+
import { bouwControleLijstPayload } from "../../lib/controleLijstPayload.js";
|
|
13
15
|
function dayDiffFromToday(iso) {
|
|
14
16
|
const d = new Date(iso);
|
|
15
17
|
if (Number.isNaN(d.getTime()))
|
|
@@ -94,6 +96,7 @@ export function ControlePage({ onExit } = {}) {
|
|
|
94
96
|
const [confirmApproval, setConfirmApproval] = useState(null);
|
|
95
97
|
const fetchToday = useServerFn(getTodaysControlCarts);
|
|
96
98
|
const fetchHistory = useServerFn(listControlHistory);
|
|
99
|
+
const printControleLijstFn = useServerFn(printControleLijstViaLayout);
|
|
97
100
|
const fetchProposals = useServerFn(getControlRescheduleProposals);
|
|
98
101
|
const submit = useServerFn(submitControlSession);
|
|
99
102
|
const fetchDraft = useServerFn(getControlDraft);
|
|
@@ -516,12 +519,20 @@ export function ControlePage({ onExit } = {}) {
|
|
|
516
519
|
return (_jsxs("main", { className: "h-full overflow-y-auto p-6 space-y-6", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-semibold", children: "Controle karren" }), _jsxs("p", { className: "text-sm text-muted-foreground", children: ["Dagelijkse eindcontrole \u2014 vandaag ", new Date().toLocaleDateString("nl-NL")] })] }), _jsxs("div", { className: "flex gap-2", children: [_jsxs(Button, { variant: "outline", disabled: printBezig || carts.length === 0, onClick: async () => {
|
|
517
520
|
setPrintBezig(true);
|
|
518
521
|
try {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
522
|
+
const documentnaam = `CTRL-${new Date().toISOString().slice(0, 10)}`;
|
|
523
|
+
const res = await callServerFn(() => printControleLijstFn({
|
|
524
|
+
data: { payload: bouwControleLijstPayload(carts), documentnaam },
|
|
525
|
+
}), "printControleLijstViaLayout");
|
|
526
|
+
if (res.route === "fout")
|
|
527
|
+
throw new Error(res.melding);
|
|
528
|
+
if (res.route === "terugval") {
|
|
529
|
+
await printHtmlDocument({
|
|
530
|
+
documenttype: "controlelijst",
|
|
531
|
+
documentnaam,
|
|
532
|
+
html: renderControleLijstHtml(carts, "nl"),
|
|
533
|
+
papierformaat: "A4",
|
|
534
|
+
});
|
|
535
|
+
}
|
|
525
536
|
toast.success("Controlelijst naar de printer gestuurd.");
|
|
526
537
|
}
|
|
527
538
|
catch (err) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** "Rijdt naar deze afleverlocaties": kiezen met een zoekveld, opgeslagen op GLN. */
|
|
2
|
+
export declare function DeliveryLocationPicker({ value, onChange }: {
|
|
3
|
+
value: string[];
|
|
4
|
+
onChange: (next: string[]) => void;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=DeliveryLocationPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeliveryLocationPicker.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/DeliveryLocationPicker.tsx"],"names":[],"mappings":"AAOA,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CAAE,+BAuElH"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { Button, Input } from "@flowselections/core";
|
|
6
|
+
import { X } from "lucide-react";
|
|
7
|
+
import { listDeliveryLocations } from "../../lib/carriers.functions.js";
|
|
8
|
+
/** "Rijdt naar deze afleverlocaties": kiezen met een zoekveld, opgeslagen op GLN. */
|
|
9
|
+
export function DeliveryLocationPicker({ value, onChange }) {
|
|
10
|
+
const fetchLocations = useServerFn(listDeliveryLocations);
|
|
11
|
+
const { data, isLoading } = useQuery({ queryKey: ["afh", "delivery-locations"], queryFn: () => fetchLocations() });
|
|
12
|
+
const [query, setQuery] = useState("");
|
|
13
|
+
const locations = data?.locations ?? [];
|
|
14
|
+
const byGln = useMemo(() => new Map(locations.map((l) => [l.gln, l])), [locations]);
|
|
15
|
+
const q = query.trim().toLowerCase();
|
|
16
|
+
const matches = q
|
|
17
|
+
? locations
|
|
18
|
+
.filter((l) => !value.includes(l.gln))
|
|
19
|
+
.filter((l) => l.gln.includes(q) || l.name.toLowerCase().includes(q) || (l.city ?? "").toLowerCase().includes(q))
|
|
20
|
+
.slice(0, 20)
|
|
21
|
+
: [];
|
|
22
|
+
return (_jsxs("div", { className: "space-y-3", children: [_jsx(Input, { value: query, onChange: (e) => setQuery(e.target.value), placeholder: isLoading ? "Afleverlocaties laden…" : "Zoek op naam, plaats of GLN" }), matches.length > 0 && (_jsx("ul", { className: "max-h-60 overflow-auto rounded-md border text-sm", children: matches.map((l) => (_jsx("li", { children: _jsxs("button", { type: "button", className: "w-full px-3 py-2 text-left hover:bg-muted", onClick: () => {
|
|
23
|
+
onChange([...value, l.gln]);
|
|
24
|
+
setQuery("");
|
|
25
|
+
}, children: [_jsx("span", { className: "font-medium", children: l.name }), l.city ? _jsxs("span", { className: "text-muted-foreground", children: [" \u00B7 ", l.city] }) : null, _jsx("span", { className: "ml-2 text-xs text-muted-foreground tabular-nums", children: l.gln })] }) }, l.gln))) })), q && matches.length === 0 && !isLoading && (_jsx("div", { className: "text-xs text-muted-foreground", children: "Geen afleverlocatie gevonden." })), value.length === 0 ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "Nog geen afleverlocaties gekozen." })) : (_jsx("div", { className: "flex flex-wrap gap-2", children: value.map((g) => {
|
|
26
|
+
const l = byGln.get(g);
|
|
27
|
+
return (_jsxs("span", { className: "inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs", children: [l ? l.name : "Onbekende locatie", " ", _jsx("span", { className: "text-muted-foreground tabular-nums", children: g }), _jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "h-5 w-5 p-0", "aria-label": "Verwijder afleverlocatie", onClick: () => onChange(value.filter((x) => x !== g)), children: _jsx(X, { className: "h-3 w-3" }) })] }, g));
|
|
28
|
+
}) }))] }));
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignupAutoSendBlock.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/SignupAutoSendBlock.tsx"],"names":[],"mappings":"AAgBA,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,+BAuF5E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
4
|
+
import { Label, Switch, toast } from "@flowselections/core";
|
|
5
|
+
import { AlertTriangle } from "lucide-react";
|
|
6
|
+
import { getSignupAutoSend, getSignupReadyList, setSignupAutoSend, } from "../../lib/carrierSignup.functions.js";
|
|
7
|
+
import { fmtTime, readyRedenText, readyStatusText } from "../../lib/signupMailText.js";
|
|
8
|
+
function ymd(d) {
|
|
9
|
+
return d.toISOString().slice(0, 10);
|
|
10
|
+
}
|
|
11
|
+
/** Schakelaar "Aanmeldingen automatisch versturen" + lijst "Klaar om aan te melden". */
|
|
12
|
+
export function SignupAutoSendBlock({ timezone }) {
|
|
13
|
+
const qc = useQueryClient();
|
|
14
|
+
const fetchStatus = useServerFn(getSignupAutoSend);
|
|
15
|
+
const fetchList = useServerFn(getSignupReadyList);
|
|
16
|
+
const save = useServerFn(setSignupAutoSend);
|
|
17
|
+
const status = useQuery({ queryKey: ["afhandeling", "signup-auto-send"], queryFn: () => fetchStatus() });
|
|
18
|
+
const today = new Date();
|
|
19
|
+
const from = ymd(new Date(today.getTime() - 86400000));
|
|
20
|
+
const to = ymd(new Date(today.getTime() + 14 * 86400000));
|
|
21
|
+
const list = useQuery({
|
|
22
|
+
queryKey: ["afhandeling", "signup-ready", from, to],
|
|
23
|
+
queryFn: () => fetchList({ data: { from, to } }),
|
|
24
|
+
});
|
|
25
|
+
const mutation = useMutation({
|
|
26
|
+
mutationFn: (on) => save({ data: { on } }),
|
|
27
|
+
onSuccess: async () => {
|
|
28
|
+
await qc.invalidateQueries({ queryKey: ["afhandeling", "signup-auto-send"] });
|
|
29
|
+
await qc.invalidateQueries({ queryKey: ["afhandeling", "signup-ready"] });
|
|
30
|
+
toast.success("Opgeslagen");
|
|
31
|
+
},
|
|
32
|
+
onError: (e) => toast.error(e.message),
|
|
33
|
+
});
|
|
34
|
+
const on = status.data?.on === true;
|
|
35
|
+
const rows = list.data?.rows ?? [];
|
|
36
|
+
return (_jsxs("div", { className: "rounded-md border p-4 space-y-3", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "autoSend", className: "font-semibold", children: "Aanmeldingen automatisch versturen" }), _jsx("p", { className: "text-xs text-muted-foreground max-w-prose", children: "Alleen een beheerder of manager kan dit aan- of uitzetten. Wie het wijzigt en wanneer, wordt vastgelegd." })] }), _jsx(Switch, { id: "autoSend", checked: on, disabled: !status.data?.canChange || mutation.isPending, onCheckedChange: (v) => mutation.mutate(v) })] }), !on && status.data && (_jsxs("div", { className: "flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm", children: [_jsx(AlertTriangle, { className: "h-4 w-4 mt-0.5 text-destructive" }), _jsx("span", { children: "Aanmeldingen gaan nu niet automatisch weg. Bekijk hieronder wat er klaarstaat voordat je dit aanzet. \"Nu versturen\" bij een ophaalmoment werkt wel." })] })), _jsxs("div", { className: "space-y-2", children: [_jsx("div", { className: "text-sm font-medium", children: "Klaar om aan te melden" }), list.isLoading ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "Laden\u2026" })) : list.isError ? (_jsx("div", { className: "text-xs text-destructive", children: "De lijst kon niet worden geladen." })) : rows.length === 0 ? (_jsx("div", { className: "text-xs text-muted-foreground", children: "Er staat niets klaar." })) : (_jsx("ul", { className: "divide-y rounded-md border text-sm", children: rows.map((r, i) => (_jsxs("li", { className: "p-2 space-y-0.5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsx("span", { className: "font-medium", children: r.orders.map((o) => o.orderNumber ?? "—").join(" + ") || "—" }), _jsx("span", { className: r.status === "uitgesloten" ? "text-destructive text-xs" : "text-xs text-muted-foreground", children: readyStatusText(r.status) })] }), _jsxs("div", { className: "text-xs text-muted-foreground", children: [r.carrierName, " \u00B7 ophalen ", r.pickupDate, r.pickupTime ? ` ${r.pickupTime}` : "", r.sentAt ? ` · aangemeld om ${fmtTime(r.sentAt, timezone)}` : ""] }), r.reden && _jsx("div", { className: "text-xs", children: readyRedenText(r.reden) })] }, `${r.carrierId}-${r.pickupDate}-${i}`))) }))] })] }));
|
|
37
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VervoerderForm.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerderForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VervoerderForm.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerderForm.tsx"],"names":[],"mappings":"AAiDA,UAAU,KAAK;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAsQD,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,EAAE,KAAK,+BAkdlD"}
|
|
@@ -10,6 +10,8 @@ import { DEFAULT_PICKUP_MOMENT } from "../../lib/planning.js";
|
|
|
10
10
|
import { COUNTRIES, countryName } from "../../lib/countries.js";
|
|
11
11
|
import { ServiceAreaSelect } from "./ServiceAreaSelect.js";
|
|
12
12
|
import { WeekdayPicker } from "./WeekdayPicker.js";
|
|
13
|
+
import { DeliveryLocationPicker } from "./DeliveryLocationPicker.js";
|
|
14
|
+
import { CARRIER_KIND_LABEL, MELDING_GEEN_EMAIL } from "../../lib/carrierReadiness.js";
|
|
13
15
|
const EMPTY = {
|
|
14
16
|
name: "",
|
|
15
17
|
contact_person: "",
|
|
@@ -17,7 +19,8 @@ const EMPTY = {
|
|
|
17
19
|
phone: "",
|
|
18
20
|
address: "",
|
|
19
21
|
notes: "",
|
|
20
|
-
|
|
22
|
+
carrier_kind: null,
|
|
23
|
+
delivery_location_glns: [],
|
|
21
24
|
pickup_moments: [{ ...DEFAULT_PICKUP_MOMENT }],
|
|
22
25
|
service_countries: [],
|
|
23
26
|
service_provinces: [],
|
|
@@ -108,7 +111,8 @@ export function VervoerderForm({ carrierId }) {
|
|
|
108
111
|
phone: c.phone ?? "",
|
|
109
112
|
address: c.address ?? "",
|
|
110
113
|
notes: c.notes ?? "",
|
|
111
|
-
|
|
114
|
+
carrier_kind: c.carrier_kind ?? null,
|
|
115
|
+
delivery_location_glns: c.delivery_location_glns ?? [],
|
|
112
116
|
pickup_moments: c.pickup_moments && c.pickup_moments.length > 0
|
|
113
117
|
? c.pickup_moments
|
|
114
118
|
: [{ ...DEFAULT_PICKUP_MOMENT }],
|
|
@@ -174,6 +178,13 @@ export function VervoerderForm({ carrierId }) {
|
|
|
174
178
|
toast.error("Bedrijfsnaam is verplicht");
|
|
175
179
|
return;
|
|
176
180
|
}
|
|
181
|
+
if (!isEdit && !form.carrier_kind) {
|
|
182
|
+
toast.error("Kies de soort vervoerder.");
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (form.carrier_kind === "extern" && !(form.email ?? "").trim()) {
|
|
186
|
+
toast.warning(MELDING_GEEN_EMAIL);
|
|
187
|
+
}
|
|
177
188
|
// Tijden zijn verplicht: er wordt nooit stil een tijd ingevuld.
|
|
178
189
|
if (form.pickup_moments.some((m) => !m.signup_time || !m.pickup_time || !m.delivery_time)) {
|
|
179
190
|
setShowTimeErrors(true);
|
|
@@ -197,7 +208,7 @@ export function VervoerderForm({ carrierId }) {
|
|
|
197
208
|
} }, idx))) }), _jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setForm({
|
|
198
209
|
...form,
|
|
199
210
|
pickup_moments: [...form.pickup_moments, { ...DEFAULT_PICKUP_MOMENT }],
|
|
200
|
-
}), children: [_jsx(Plus, { className: "w-4 h-4 mr-1" }), "Ophaalmoment toevoegen"] })] }), _jsxs("div", { className: "rounded-md border p-4 space-y-4", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "w-4 h-4 text-primary" }), _jsx(Label, { className: "font-semibold", children: "Ophaaldagen" })] }), _jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Dagen waarop deze vervoerder karren bij ons komt ophalen." }), _jsx("div", { className: "mt-3", children: _jsx(WeekdayPicker, { value: form.pickup_weekdays ?? [1, 2, 3, 4, 5], onChange: (next) => setForm({ ...form, pickup_weekdays: next }), idPrefix: "carrier-pu-wd" }) })] }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Truck, { className: "w-4 h-4 text-primary" }), _jsx(Label, { className: "font-semibold", children: "Bezorgdagen" })] }), _jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Dagen waarop deze vervoerder bij de klant aflevert." }), _jsx("div", { className: "mt-3", children: _jsx(WeekdayPicker, { value: form.delivery_weekdays ?? [1, 2, 3, 4, 5], onChange: (next) => setForm({ ...form, delivery_weekdays: next }), idPrefix: "carrier-dl-wd" }) })] })] }), _jsxs("
|
|
211
|
+
}), children: [_jsx(Plus, { className: "w-4 h-4 mr-1" }), "Ophaalmoment toevoegen"] })] }), _jsxs("div", { className: "rounded-md border p-4 space-y-4", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "w-4 h-4 text-primary" }), _jsx(Label, { className: "font-semibold", children: "Ophaaldagen" })] }), _jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Dagen waarop deze vervoerder karren bij ons komt ophalen." }), _jsx("div", { className: "mt-3", children: _jsx(WeekdayPicker, { value: form.pickup_weekdays ?? [1, 2, 3, 4, 5], onChange: (next) => setForm({ ...form, pickup_weekdays: next }), idPrefix: "carrier-pu-wd" }) })] }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Truck, { className: "w-4 h-4 text-primary" }), _jsx(Label, { className: "font-semibold", children: "Bezorgdagen" })] }), _jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Dagen waarop deze vervoerder bij de klant aflevert." }), _jsx("div", { className: "mt-3", children: _jsx(WeekdayPicker, { value: form.delivery_weekdays ?? [1, 2, 3, 4, 5], onChange: (next) => setForm({ ...form, delivery_weekdays: next }), idPrefix: "carrier-dl-wd" }) })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { htmlFor: "carrierKind", children: ["Soort vervoerder ", !isEdit && _jsx("span", { className: "text-destructive", children: "*" })] }), _jsxs("select", { id: "carrierKind", value: form.carrier_kind ?? "", onChange: (e) => setForm({ ...form, carrier_kind: (e.target.value || null) }), className: "flex h-9 w-full rounded-md border border-input bg-background px-3 text-sm", children: [_jsx("option", { value: "", disabled: !isEdit || !!form.carrier_kind, children: "Kies de soort\u2026" }), Object.keys(CARRIER_KIND_LABEL).map((k) => (_jsx("option", { value: k, children: CARRIER_KIND_LABEL[k] }, k)))] }), !form.carrier_kind && (_jsx("p", { className: "text-xs text-destructive", children: "Soort nog niet gekozen; wordt niet automatisch gekozen." })), _jsx("p", { className: "text-xs text-muted-foreground", children: "De favoriete vervoerder kies je in de lijst met \"Maak favoriet\"." })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { children: "Opmerkingen" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(FieldIcon, { icon: FileText }), _jsx(Textarea, { value: form.notes ?? "", onChange: (e) => setForm({ ...form, notes: e.target.value }), placeholder: "Extra informatie over deze vervoerder...", rows: 3, className: "flex-1" })] })] })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: "Bedieningsgebied" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Selecteer de landen, provincies en/of plaatsen waar deze vervoerder actief is. Een land dekt automatisch al zijn provincies en plaatsen." })] }), _jsx(CardContent, { children: _jsx(ServiceAreaSelect, { value: {
|
|
201
212
|
countries: form.service_countries ?? [],
|
|
202
213
|
provinces: form.service_provinces ?? [],
|
|
203
214
|
cities: form.service_cities ?? [],
|
|
@@ -206,7 +217,7 @@ export function VervoerderForm({ carrierId }) {
|
|
|
206
217
|
service_countries: next.countries,
|
|
207
218
|
service_provinces: next.provinces,
|
|
208
219
|
service_cities: next.cities,
|
|
209
|
-
}) }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: "Verzendtarieven" }), _jsxs("p", { className: "text-sm text-muted-foreground", children: ["Stel de verzendkosten ", _jsx("strong", { children: "per kwekerskar" }), " in voor elk land waar deze vervoerder naartoe verzendt."] })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-[1fr,160px,auto] gap-3", children: [_jsx(CountryPicker, { value: pendingCountry, onChange: setPendingCountry, excluded: rates.map((r) => r.country_code) }), _jsxs("div", { className: "flex items-stretch gap-2 rounded-md border bg-background h-10", children: [_jsx("div", { className: "flex items-center justify-center w-10 bg-primary/10 text-primary rounded-l-md text-sm font-medium", children: "\u20AC" }), _jsx("input", { type: "number", step: "0.01", min: 0, value: pendingPrice, onChange: (e) => setPendingPrice(e.target.value), placeholder: "Prijs", className: "flex-1 bg-transparent text-sm outline-none pr-3" })] }), _jsxs(Button, { type: "button", onClick: addRate, children: [_jsx(Plus, { className: "w-4 h-4 mr-1" }), "Toevoegen"] })] }), rates.length === 0 ? (_jsxs("div", { className: "border rounded-md py-10 text-center space-y-2", children: [_jsx(Globe, { className: "w-8 h-8 mx-auto text-muted-foreground" }), _jsx("div", { className: "font-medium", children: "Nog geen landen toegevoegd" }), _jsx("div", { className: "text-sm text-muted-foreground", children: "Voeg een land toe om verzendtarieven in te stellen." })] })) : (_jsx("div", { className: "border rounded-md divide-y", children: rates
|
|
220
|
+
}) }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: "Rijdt naar deze afleverlocaties" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Kies de afleverlocaties waar deze vervoerder naartoe rijdt." })] }), _jsx(CardContent, { children: _jsx(DeliveryLocationPicker, { value: form.delivery_location_glns ?? [], onChange: (next) => setForm({ ...form, delivery_location_glns: next }) }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-base", children: "Verzendtarieven" }), _jsxs("p", { className: "text-sm text-muted-foreground", children: ["Stel de verzendkosten ", _jsx("strong", { children: "per kwekerskar" }), " in voor elk land waar deze vervoerder naartoe verzendt."] })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-[1fr,160px,auto] gap-3", children: [_jsx(CountryPicker, { value: pendingCountry, onChange: setPendingCountry, excluded: rates.map((r) => r.country_code) }), _jsxs("div", { className: "flex items-stretch gap-2 rounded-md border bg-background h-10", children: [_jsx("div", { className: "flex items-center justify-center w-10 bg-primary/10 text-primary rounded-l-md text-sm font-medium", children: "\u20AC" }), _jsx("input", { type: "number", step: "0.01", min: 0, value: pendingPrice, onChange: (e) => setPendingPrice(e.target.value), placeholder: "Prijs", className: "flex-1 bg-transparent text-sm outline-none pr-3" })] }), _jsxs(Button, { type: "button", onClick: addRate, children: [_jsx(Plus, { className: "w-4 h-4 mr-1" }), "Toevoegen"] })] }), rates.length === 0 ? (_jsxs("div", { className: "border rounded-md py-10 text-center space-y-2", children: [_jsx(Globe, { className: "w-8 h-8 mx-auto text-muted-foreground" }), _jsx("div", { className: "font-medium", children: "Nog geen landen toegevoegd" }), _jsx("div", { className: "text-sm text-muted-foreground", children: "Voeg een land toe om verzendtarieven in te stellen." })] })) : (_jsx("div", { className: "border rounded-md divide-y", children: rates
|
|
210
221
|
.slice()
|
|
211
222
|
.sort((a, b) => countryName(a.country_code).localeCompare(countryName(b.country_code), "nl"))
|
|
212
223
|
.map((r) => (_jsxs("div", { className: "flex items-center gap-3 px-3 py-2", children: [_jsx(Globe, { className: "w-4 h-4 text-muted-foreground" }), _jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "text-sm font-medium", children: countryName(r.country_code) }), _jsx("div", { className: "text-xs text-muted-foreground", children: r.country_code })] }), _jsxs("div", { className: "text-sm font-medium", children: ["\u20AC ", r.price_per_trolley.toFixed(2), " ", _jsx("span", { className: "text-muted-foreground font-normal", children: "/ kar" })] }), _jsx("button", { type: "button", onClick: () => removeRate(r.country_code), className: "text-muted-foreground hover:text-destructive", "aria-label": "Verwijderen", children: _jsx(Trash2, { className: "w-4 h-4" }) })] }, r.country_code))) })), _jsxs("p", { className: "text-sm text-muted-foreground", children: ["De prijs per kwekerskar wordt automatisch berekend", " ", _jsx("strong", { children: "bij het aanmaken van een bestelling" }), "."] })] })] }), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsxs(Button, { type: "button", variant: "outline", onClick: goBack, children: [_jsx(X, { className: "w-4 h-4 mr-1" }), "Annuleren"] }), _jsx(Button, { type: "submit", disabled: mutation.isPending, children: mutation.isPending ? "Opslaan..." : "Opslaan" })] })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VervoerdersPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerdersPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VervoerdersPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerdersPage.tsx"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAAO,+BAK3G"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { Button, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogDescription, AlertDialogTitle, toast, } from "@flowselections/core";
|
|
4
|
-
import { Plus, Pencil,
|
|
4
|
+
import { Plus, Pencil, Archive, Truck, ArrowUp, ArrowDown, Star, AlertTriangle, Check, X } from "lucide-react";
|
|
5
5
|
import { ResponsiveAlertDialogBody, ResponsiveAlertDialogContent, ResponsiveAlertDialogFooter, ResponsiveAlertDialogHeader, } from "../ui/responsive-dialog.js";
|
|
6
6
|
import { Link } from "@tanstack/react-router";
|
|
7
7
|
import { useServerFn } from "@tanstack/react-start";
|
|
8
8
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
9
9
|
import { toServerFnError } from "../../lib/serverFnError.js";
|
|
10
|
-
import { listCarriers, deleteCarrier, reorderCarriers } from "../../lib/carriers.functions.js";
|
|
10
|
+
import { listCarriers, deleteCarrier, reorderCarriers, setFavoriteCarrier, getCarrierAccess } from "../../lib/carriers.functions.js";
|
|
11
|
+
import { carrierReadiness, CARRIER_KIND_LABEL } from "../../lib/carrierReadiness.js";
|
|
11
12
|
import { carrierLeadDaysFromMoments } from "../../lib/carrierPlanning.js";
|
|
12
13
|
import { VervoerderForm } from "./VervoerderForm.js";
|
|
13
14
|
import { resolveCarrierId } from "./VervoerderBewerkenPage.js";
|
|
@@ -27,6 +28,10 @@ function VervoerdersLijst() {
|
|
|
27
28
|
const fetchList = useServerFn(listCarriers);
|
|
28
29
|
const removeCarrier = useServerFn(deleteCarrier);
|
|
29
30
|
const reorder = useServerFn(reorderCarriers);
|
|
31
|
+
const makeFavorite = useServerFn(setFavoriteCarrier);
|
|
32
|
+
const fetchAccess = useServerFn(getCarrierAccess);
|
|
33
|
+
const access = useQuery({ queryKey: ["carriers", "access"], queryFn: () => fetchAccess() });
|
|
34
|
+
const canManage = access.data?.canManage === true;
|
|
30
35
|
const [deletingId, setDeletingId] = useState(null);
|
|
31
36
|
const { data, isLoading, error, refetch } = useQuery({
|
|
32
37
|
queryKey: ["carriers"],
|
|
@@ -43,7 +48,7 @@ function VervoerdersLijst() {
|
|
|
43
48
|
const deleteMutation = useMutation({
|
|
44
49
|
mutationFn: (id) => removeCarrier({ data: { id } }),
|
|
45
50
|
onSuccess: async () => {
|
|
46
|
-
toast.success("Vervoerder
|
|
51
|
+
toast.success("Vervoerder gearchiveerd");
|
|
47
52
|
const { invalidatePlanning } = await import("../../lib/invalidatePlanning.js");
|
|
48
53
|
await invalidatePlanning(queryClient);
|
|
49
54
|
setDeletingId(null);
|
|
@@ -58,7 +63,17 @@ function VervoerdersLijst() {
|
|
|
58
63
|
},
|
|
59
64
|
onError: (err) => toast.error(err.message),
|
|
60
65
|
});
|
|
66
|
+
const favoriteMutation = useMutation({
|
|
67
|
+
mutationFn: (id) => makeFavorite({ data: { id } }),
|
|
68
|
+
onSuccess: async () => {
|
|
69
|
+
toast.success("Favoriete vervoerder gekozen");
|
|
70
|
+
const { invalidatePlanning } = await import("../../lib/invalidatePlanning.js");
|
|
71
|
+
await invalidatePlanning(queryClient);
|
|
72
|
+
},
|
|
73
|
+
onError: (err) => toast.error(err.message),
|
|
74
|
+
});
|
|
61
75
|
const carriers = data?.carriers ?? [];
|
|
76
|
+
const hasFavorite = carriers.some((c) => c.is_favorite);
|
|
62
77
|
const move = (index, direction) => {
|
|
63
78
|
const target = index + direction;
|
|
64
79
|
if (target < 0 || target >= carriers.length)
|
|
@@ -67,5 +82,10 @@ function VervoerdersLijst() {
|
|
|
67
82
|
[ids[index], ids[target]] = [ids[target], ids[index]];
|
|
68
83
|
reorderMutation.mutate(ids);
|
|
69
84
|
};
|
|
70
|
-
return (_jsxs("div", { className: "p-6 space-y-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-semibold", children: "Vervoerders" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Beheer vervoerders en hun verzendtarieven per land." })] }), _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "w-4 h-4 mr-1" }), "Vervoerder toevoegen"] }) })] }), _jsx("div", { className: "border rounded-md bg-card", children: isLoading ? (_jsx("div", { className: "p-12 text-center text-muted-foreground", children: "Laden..." })) : error ? (_jsxs("div", { className: "p-12 text-center space-y-3", children: [_jsxs("div", { className: "text-destructive", children: ["Fout bij laden: ", error.message] }), _jsx(Button, { variant: "outline", onClick: () => refetch(), children: "Opnieuw proberen" })] })) : carriers.length === 0 ? (_jsxs("div", { className: "p-12 text-center space-y-3", children: [_jsx(Truck, { className: "w-10 h-10 mx-auto text-muted-foreground" }), _jsx("div", { className: "font-medium", children: "Nog geen vervoerders" }), _jsx("div", { className: "text-sm text-muted-foreground", children: "Voeg een vervoerder toe om verzendtarieven in te stellen." }), _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "w-4 h-4 mr-1" }), "Vervoerder toevoegen"] }) })] })) : (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-32", children: "Prioriteit" }), _jsx(TableHead, { children: "Bedrijfsnaam" }), _jsx(TableHead, { children: "
|
|
85
|
+
return (_jsxs("div", { className: "p-6 space-y-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-semibold", children: "Vervoerders" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Beheer vervoerders en hun verzendtarieven per land." })] }), _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "w-4 h-4 mr-1" }), "Vervoerder toevoegen"] }) })] }), access.data && access.data.managersCount === 0 && (_jsxs("div", { className: "flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm", children: [_jsx(AlertTriangle, { className: "h-4 w-4 mt-0.5 text-destructive" }), _jsx("span", { children: "Niemand mag vervoerders beheren; vraag een beheerder om een rol." })] })), access.data && access.data.managersCount > 0 && !canManage && (_jsx("div", { className: "rounded-md border p-3 text-sm text-muted-foreground", children: "Je kunt de vervoerders bekijken. Wijzigen kan alleen met de rol beheerder, manager of planner." })), !isLoading && !error && !hasFavorite && (_jsxs("div", { className: "flex items-center gap-2 rounded-md bg-destructive p-3 text-sm font-medium text-destructive-foreground", children: [_jsx(AlertTriangle, { className: "h-4 w-4" }), "Kies een favoriete vervoerder"] })), _jsx("div", { className: "border rounded-md bg-card", children: isLoading ? (_jsx("div", { className: "p-12 text-center text-muted-foreground", children: "Laden..." })) : error ? (_jsxs("div", { className: "p-12 text-center space-y-3", children: [_jsxs("div", { className: "text-destructive", children: ["Fout bij laden: ", error.message] }), _jsx(Button, { variant: "outline", onClick: () => refetch(), children: "Opnieuw proberen" })] })) : carriers.length === 0 ? (_jsxs("div", { className: "p-12 text-center space-y-3", children: [_jsx(Truck, { className: "w-10 h-10 mx-auto text-muted-foreground" }), _jsx("div", { className: "font-medium", children: "Nog geen vervoerders" }), _jsx("div", { className: "text-sm text-muted-foreground", children: "Voeg een vervoerder toe om verzendtarieven in te stellen." }), _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "w-4 h-4 mr-1" }), "Vervoerder toevoegen"] }) })] })) : (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-32", children: "Prioriteit" }), _jsx(TableHead, { children: "Bedrijfsnaam" }), _jsx(TableHead, { children: "Soort" }), _jsx(TableHead, { children: "Gereed" }), _jsx(TableHead, { children: "Levertijd" }), _jsx(TableHead, { className: "text-right", children: "Acties" })] }) }), _jsx(TableBody, { children: carriers.map((c, index) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "w-6 text-sm font-medium tabular-nums text-muted-foreground", children: index + 1 }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => move(index, -1), disabled: index === 0 || reorderMutation.isPending, "aria-label": "Hoger", children: _jsx(ArrowUp, { className: "w-4 h-4" }) }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => move(index, 1), disabled: index === carriers.length - 1 || reorderMutation.isPending, "aria-label": "Lager", children: _jsx(ArrowDown, { className: "w-4 h-4" }) })] }) }), _jsxs(TableCell, { className: "font-medium", children: [_jsxs("div", { className: "flex items-center gap-1", children: [c.is_favorite && _jsx(Star, { className: "h-4 w-4 fill-primary text-primary", "aria-label": "Favoriet" }), c.name] }), _jsx("div", { className: "text-xs font-normal text-muted-foreground", children: c.email ?? "geen e-mail" })] }), _jsx(TableCell, { className: "text-sm", children: c.carrier_kind ? CARRIER_KIND_LABEL[c.carrier_kind] : _jsx("span", { className: "text-destructive", children: "Nog niet gekozen" }) }), _jsx(TableCell, { children: _jsx(ReadinessCell, { carrier: c }) }), _jsxs(TableCell, { children: [carrierLeadDaysFromMoments(c.pickup_moments), " werkdagen"] }), _jsx(TableCell, { className: "text-right", children: _jsxs("div", { className: "flex justify-end gap-1", children: [!c.is_favorite && canManage && carrierReadiness(c).canBeFavorite && (_jsxs(Button, { variant: "ghost", size: "sm", onClick: () => favoriteMutation.mutate(c.id), disabled: favoriteMutation.isPending, children: [_jsx(Star, { className: "w-4 h-4 mr-1" }), "Maak favoriet"] })), _jsx(Button, { asChild: true, variant: "ghost", size: "sm", children: _jsx(Link, { to: "/afhandeling/vervoerders/$carrierId", params: { carrierId: c.id }, children: _jsx(Pencil, { className: "w-4 h-4" }) }) }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setDeletingId(c.id), disabled: !canManage || c.is_favorite, title: c.is_favorite ? "Kies eerst een andere favoriet" : "Archiveren", className: "text-destructive hover:text-destructive", children: _jsx(Archive, { className: "w-4 h-4" }) })] }) })] }, c.id))) })] })) }), _jsx(AlertDialog, { open: !!deletingId, onOpenChange: (o) => !o && setDeletingId(null), children: _jsxs(ResponsiveAlertDialogContent, { size: "sm", children: [_jsx(ResponsiveAlertDialogHeader, { children: _jsx(AlertDialogTitle, { children: "Vervoerder archiveren?" }) }), _jsx(ResponsiveAlertDialogBody, { children: _jsx(AlertDialogDescription, { children: "De vervoerder verdwijnt uit de lijst en wordt niet meer gekozen. Er wordt niets verwijderd." }) }), _jsxs(ResponsiveAlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { onClick: () => deletingId && deleteMutation.mutate(deletingId), className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: "Archiveren" })] })] }) })] }));
|
|
86
|
+
}
|
|
87
|
+
function ReadinessCell({ carrier }) {
|
|
88
|
+
const r = carrierReadiness(carrier);
|
|
89
|
+
const item = (ok, label) => (_jsxs("span", { className: "inline-flex items-center gap-0.5", children: [ok ? _jsx(Check, { className: "h-3 w-3 text-primary" }) : _jsx(X, { className: "h-3 w-3 text-destructive" }), label] }));
|
|
90
|
+
return (_jsxs("div", { className: "space-y-1 text-xs", children: [_jsxs("div", { className: "flex flex-wrap gap-2", children: [item(r.hasEmail, "e-mail"), item(r.hasArea, "werkgebied"), item(r.hasLocations, "afleverlocaties"), item(r.hasMoment, "ophaalmoment")] }), r.warnings.map((w) => (_jsx("div", { className: "text-destructive", children: w }, w)))] }));
|
|
71
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AfhandelingSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/AfhandelingSettingsCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AfhandelingSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/AfhandelingSettingsCard.tsx"],"names":[],"mappings":"AAwBA,wBAAgB,uBAAuB,gCAoKtC"}
|
|
@@ -6,6 +6,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Inpu
|
|
|
6
6
|
import { CalendarClock, Mail } from "lucide-react";
|
|
7
7
|
import { getAfhandelingSettings, updateAfhandelingSettings, } from "../../lib/afhandelingSettings.functions.js";
|
|
8
8
|
import { getSignupCronStatus } from "../../lib/carrierSignup.functions.js";
|
|
9
|
+
import { SignupAutoSendBlock } from "../afhandeling/SignupAutoSendBlock.js";
|
|
9
10
|
import { fmtTime, signupReasonText } from "../../lib/signupMailText.js";
|
|
10
11
|
export function AfhandelingSettingsCard() {
|
|
11
12
|
const qc = useQueryClient();
|
|
@@ -79,7 +80,7 @@ export function AfhandelingSettingsCard() {
|
|
|
79
80
|
toast.error(e instanceof Error ? e.message : "Opslaan mislukt");
|
|
80
81
|
},
|
|
81
82
|
});
|
|
82
|
-
return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CalendarClock, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { children: "Afhandeling \u2014 Planning" })] }), _jsx(CardDescription, { children: "De pickplanning (pickdagen, picktijd en verdeling over de week) wordt volledig bepaald door de planning. Hieronder staan alleen de instellingen van deze module zelf. Printen: het document wordt automatisch bepaald uit de order." })] }), _jsxs(CardContent, { className: "space-y-5", children: [_jsxs("div", { className: "rounded-md border p-4 space-y-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Mail, { className: "h-4 w-4 text-primary" }), _jsx(Label, { htmlFor: "mailEnabled", className: "font-semibold", children: "Aanmeldmail vervoerders" })] }), _jsx("p", { className: "text-xs text-muted-foreground max-w-prose", children: "Verstuurt automatisch een mail met de te verwachten karren naar de vervoerder v\u00F3\u00F3r de aanmelddeadline van het ophaalmoment. E\u00E9n mail per ophaaldag/-moment per vervoerder." })] }), _jsx(Switch, { id: "mailEnabled", checked: mailEnabled, onCheckedChange: setMailEnabled })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "mailLead", children: "Minuten v\u00F3\u00F3r aanmelddeadline versturen" }), _jsx(Input, { id: "mailLead", type: "number", min: 0, max: 1440, value: mailLead, disabled: !mailEnabled, onChange: (e) => setMailLead(Math.max(0, Math.min(1440, Math.floor(Number(e.target.value)) || 0))) })] }), _jsx("div", { className: "space-y-1 text-sm", children: _jsxs("div", { children: [_jsx("strong", { children: "Verzendadres:" }), " ", cron.data?.senderEmail ? cron.data.senderEmail : _jsx("span", { className: "text-muted-foreground", children: "nog geen verbonden adres" }), " ", _jsx("span", { className: "text-xs text-muted-foreground", children: "(instellen bij E-mailkoppeling)" })] }) }), _jsxs("details", { className: "text-xs text-muted-foreground", children: [_jsx("summary", { className: "cursor-pointer", children: "Details voor beheer" }), _jsxs("div", { className: "mt-2 space-y-2", children: [_jsx(Label, { htmlFor: "mailPurpose", children: "Doeleinde in E-mailkoppeling" }), _jsx(Input, { id: "mailPurpose", value: mailPurpose, disabled: !mailEnabled, onChange: (e) => setMailPurpose(e.target.value) }), _jsxs("p", { children: ["Standaard: ", _jsx("code", { children: "afhandeling_carrier_signup" }), "."] })] })] })] }), _jsx(SignupStatusBlock, { status: cron.data ?? null, loading: cron.isLoading, failed: cron.isError }), _jsxs("div", { className: "rounded-md bg-muted/50 p-3 text-xs text-muted-foreground", children: [_jsx("strong", { children: "Ophaaltijd" }), " en ", _jsx("strong", { children: "Aanmeldtijd" }), " stel je per vervoerder in (werkdagen v\u00F3\u00F3r bezorgdag). De
|
|
83
|
+
return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CalendarClock, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { children: "Afhandeling \u2014 Planning" })] }), _jsx(CardDescription, { children: "De pickplanning (pickdagen, picktijd en verdeling over de week) wordt volledig bepaald door de planning. Hieronder staan alleen de instellingen van deze module zelf. Printen: het document wordt automatisch bepaald uit de order." })] }), _jsxs(CardContent, { className: "space-y-5", children: [_jsxs("div", { className: "rounded-md border p-4 space-y-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Mail, { className: "h-4 w-4 text-primary" }), _jsx(Label, { htmlFor: "mailEnabled", className: "font-semibold", children: "Aanmeldmail vervoerders" })] }), _jsx("p", { className: "text-xs text-muted-foreground max-w-prose", children: "Verstuurt automatisch een mail met de te verwachten karren naar de vervoerder v\u00F3\u00F3r de aanmelddeadline van het ophaalmoment. E\u00E9n mail per ophaaldag/-moment per vervoerder." })] }), _jsx(Switch, { id: "mailEnabled", checked: mailEnabled, onCheckedChange: setMailEnabled })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "mailLead", children: "Minuten v\u00F3\u00F3r aanmelddeadline versturen" }), _jsx(Input, { id: "mailLead", type: "number", min: 0, max: 1440, value: mailLead, disabled: !mailEnabled, onChange: (e) => setMailLead(Math.max(0, Math.min(1440, Math.floor(Number(e.target.value)) || 0))) })] }), _jsx("div", { className: "space-y-1 text-sm", children: _jsxs("div", { children: [_jsx("strong", { children: "Verzendadres:" }), " ", cron.data?.senderEmail ? cron.data.senderEmail : _jsx("span", { className: "text-muted-foreground", children: "nog geen verbonden adres" }), " ", _jsx("span", { className: "text-xs text-muted-foreground", children: "(instellen bij E-mailkoppeling)" })] }) }), _jsxs("details", { className: "text-xs text-muted-foreground", children: [_jsx("summary", { className: "cursor-pointer", children: "Details voor beheer" }), _jsxs("div", { className: "mt-2 space-y-2", children: [_jsx(Label, { htmlFor: "mailPurpose", children: "Doeleinde in E-mailkoppeling" }), _jsx(Input, { id: "mailPurpose", value: mailPurpose, disabled: !mailEnabled, onChange: (e) => setMailPurpose(e.target.value) }), _jsxs("p", { children: ["Standaard: ", _jsx("code", { children: "afhandeling_carrier_signup" }), "."] })] })] })] }), _jsx(SignupStatusBlock, { status: cron.data ?? null, loading: cron.isLoading, failed: cron.isError }), _jsx(SignupAutoSendBlock, { timezone: cron.data?.timezone ?? null }), _jsxs("div", { className: "rounded-md bg-muted/50 p-3 text-xs text-muted-foreground", children: [_jsx("strong", { children: "Ophaaltijd" }), " en ", _jsx("strong", { children: "Aanmeldtijd" }), " stel je per vervoerder in (werkdagen v\u00F3\u00F3r bezorgdag). De ", _jsx("strong", { children: "favoriete" }), " vervoerder kies je bij Vervoerders; opslaan van een vervoerder verstuurt nooit een mail."] }), _jsx(Button, { onClick: () => mutation.mutate(), disabled: mutation.isPending, children: mutation.isPending ? "Opslaan…" : "Opslaan" })] })] }));
|
|
83
84
|
}
|
|
84
85
|
function SignupStatusBlock({ status, loading, failed, }) {
|
|
85
86
|
if (loading)
|
|
@@ -20,8 +20,8 @@ export function VervoerdersSettingsCard() {
|
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
const carriers = data?.carriers ?? [];
|
|
23
|
-
const defaultCarrier = carriers.find((c) => c.
|
|
24
|
-
return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Truck, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { children: "Vervoerders" })] }), _jsx(CardDescription, { children: "Beheer vervoerders en hun verzendtarieven per land. De
|
|
25
|
-
? `
|
|
26
|
-
: "
|
|
23
|
+
const defaultCarrier = carriers.find((c) => c.is_favorite);
|
|
24
|
+
return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Truck, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { children: "Vervoerders" })] }), _jsx(CardDescription, { children: "Beheer vervoerders en hun verzendtarieven per land. De favoriete vervoerder wordt gekozen als niets anders past." })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center gap-4 rounded-md bg-muted/50 p-4", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-primary/10", children: _jsx(Building2, { className: "h-5 w-5 text-primary" }) }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-medium", children: isLoading ? "Laden..." : `${carriers.length} vervoerder${carriers.length === 1 ? "" : "s"}` }), _jsx("div", { className: "text-xs text-muted-foreground", children: defaultCarrier
|
|
25
|
+
? `Favoriet: ${defaultCarrier.name}`
|
|
26
|
+
: "Kies een favoriete vervoerder" })] })] }), _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders", children: ["Beheer vervoerders", _jsx(ArrowRight, { className: "ml-2 h-4 w-4" })] }) })] })] }));
|
|
27
27
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/** Storage accepted by Supabase's `auth.storage` option; `localStorage` and the editor broker both satisfy it. */
|
|
2
|
+
export interface PreviewAuthStorage {
|
|
3
|
+
getItem: (key: string) => string | null | Promise<string | null>;
|
|
4
|
+
setItem: (key: string, value: string) => void | Promise<void>;
|
|
5
|
+
removeItem: (key: string) => void | Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* On a Lovable preview surface, broker the auth session to the editor over
|
|
9
|
+
* postMessage so the project's preview surfaces share one login; else localStorage.
|
|
10
|
+
*/
|
|
11
|
+
export declare function brokeredPreviewStorage(): PreviewAuthStorage | undefined;
|
|
6
12
|
//# sourceMappingURL=previewAuthStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"previewAuthStorage.d.ts","sourceRoot":"","sources":["../../../src/integrations/supabase/previewAuthStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"previewAuthStorage.d.ts","sourceRoot":"","sources":["../../../src/integrations/supabase/previewAuthStorage.ts"],"names":[],"mappings":"AAEA,kHAAkH;AAClH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AA6BD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,kBAAkB,GAAG,SAAS,CAsGvE"}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
// This file is automatically generated. Do not edit it directly.
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
const RESULT = 'lovable-preview-auth:result';
|
|
3
|
+
function readBrokerReply(data, requestId) {
|
|
4
|
+
if (typeof data !== 'object' || data === null)
|
|
5
|
+
return null;
|
|
6
|
+
if (!('type' in data) || data.type !== RESULT)
|
|
7
|
+
return null;
|
|
8
|
+
if (!('requestId' in data) || data.requestId !== requestId)
|
|
9
|
+
return null;
|
|
10
|
+
return {
|
|
11
|
+
ok: 'ok' in data && Boolean(data.ok),
|
|
12
|
+
value: 'value' in data && typeof data.value === 'string' ? data.value : null,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* On a Lovable preview surface, broker the auth session to the editor over
|
|
17
|
+
* postMessage so the project's preview surfaces share one login; else localStorage.
|
|
18
|
+
*/
|
|
4
19
|
export function brokeredPreviewStorage() {
|
|
5
20
|
if (typeof window === 'undefined')
|
|
6
21
|
return undefined;
|
|
@@ -11,10 +26,13 @@ export function brokeredPreviewStorage() {
|
|
|
11
26
|
// preview--<name> host can't smuggle another project's id.
|
|
12
27
|
const UUID = '[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}';
|
|
13
28
|
const projectId = onPreviewZone
|
|
14
|
-
? (
|
|
15
|
-
??
|
|
29
|
+
? (new RegExp('^(?:id-preview(?:-[a-z0-9]+)?|project)--(' + UUID + ')(?:-dev)?(?=\\.|$)', 'i').exec(host)?.[1]
|
|
30
|
+
?? new RegExp('^(' + UUID + ')(?=[.-])', 'i').exec(host)?.[1])
|
|
16
31
|
: undefined;
|
|
17
|
-
|
|
32
|
+
// lib.dom types window.parent and location.ancestorOrigins as always set, but a
|
|
33
|
+
// detached frame has no parent and not every browser implements ancestorOrigins.
|
|
34
|
+
const parentWindow = window.parent;
|
|
35
|
+
const framed = parentWindow !== null && parentWindow !== window;
|
|
18
36
|
if (!projectId || !framed)
|
|
19
37
|
return localStorage;
|
|
20
38
|
// Post only to the real editor ancestor, validated as a Lovable origin, so the
|
|
@@ -23,40 +41,39 @@ export function brokeredPreviewStorage() {
|
|
|
23
41
|
const EDITOR = dev
|
|
24
42
|
? /^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/
|
|
25
43
|
: /^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/;
|
|
26
|
-
const
|
|
44
|
+
const ancestorOrigins = location.ancestorOrigins;
|
|
45
|
+
const ancestor = ancestorOrigins?.[0] ?? (document.referrer ? new URL(document.referrer).origin : '');
|
|
27
46
|
const editorOrigins = ancestor && EDITOR.test(ancestor)
|
|
28
47
|
? [ancestor]
|
|
29
48
|
: (dev ? ['https://lovable.dev', 'http://localhost:3000'] : ['https://lovable.dev']);
|
|
30
|
-
const RESULT = 'lovable-preview-auth:result';
|
|
31
49
|
const TIMEOUT = 2000;
|
|
32
50
|
const newId = () => Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
33
51
|
const request = (type, key, value) => new Promise((resolve) => {
|
|
34
52
|
const requestId = newId();
|
|
35
53
|
let done = false;
|
|
36
|
-
|
|
37
|
-
const finish = (r) => {
|
|
54
|
+
const finish = (reply) => {
|
|
38
55
|
if (done)
|
|
39
56
|
return;
|
|
40
57
|
done = true;
|
|
41
58
|
clearTimeout(timer);
|
|
42
59
|
window.removeEventListener('message', onMessage);
|
|
43
|
-
resolve(
|
|
60
|
+
resolve(reply);
|
|
44
61
|
};
|
|
45
62
|
const onMessage = (e) => {
|
|
46
|
-
if (editorOrigins.
|
|
63
|
+
if (!editorOrigins.includes(e.origin))
|
|
47
64
|
return;
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
finish(
|
|
65
|
+
const reply = readBrokerReply(e.data, requestId);
|
|
66
|
+
if (reply)
|
|
67
|
+
finish(reply);
|
|
51
68
|
};
|
|
52
69
|
window.addEventListener('message', onMessage);
|
|
70
|
+
const timer = setTimeout(() => { finish(null); }, TIMEOUT);
|
|
53
71
|
const msg = { type, requestId, projectId, key };
|
|
54
72
|
if (value !== undefined)
|
|
55
|
-
msg
|
|
73
|
+
msg.value = value;
|
|
56
74
|
// targetOrigin per trusted editor origin, so a session token never reaches an arbitrary embedder.
|
|
57
75
|
for (const origin of editorOrigins)
|
|
58
76
|
window.parent.postMessage(msg, origin);
|
|
59
|
-
timer = setTimeout(() => finish(null), TIMEOUT);
|
|
60
77
|
});
|
|
61
78
|
// The editor may not be listening yet at the first getItem, so retry once.
|
|
62
79
|
let firstGet = true;
|
|
@@ -74,13 +91,13 @@ export function brokeredPreviewStorage() {
|
|
|
74
91
|
const local = readLocal(key);
|
|
75
92
|
let res = await request('lovable-preview-auth:get', key, local ?? undefined);
|
|
76
93
|
if (!res && firstGet) {
|
|
77
|
-
await new Promise((
|
|
94
|
+
await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY));
|
|
78
95
|
res = await request('lovable-preview-auth:get', key, local ?? undefined);
|
|
79
96
|
}
|
|
80
97
|
firstGet = false;
|
|
81
98
|
// '' is the logout tombstone: clear the local copy too so it can't resurrect if
|
|
82
|
-
// the broker later goes silent. A null
|
|
83
|
-
if (res
|
|
99
|
+
// the broker later goes silent. A null value means never-synced -> keep local.
|
|
100
|
+
if (res?.ok && res.value !== null) {
|
|
84
101
|
if (res.value === '') {
|
|
85
102
|
if (local !== undefined && readLocal(key) === local)
|
|
86
103
|
localStorage.removeItem(key);
|
|
@@ -100,7 +117,7 @@ export function brokeredPreviewStorage() {
|
|
|
100
117
|
setItem: (key, value) => {
|
|
101
118
|
localStorage.setItem(key, value);
|
|
102
119
|
return request('lovable-preview-auth:set', key, value).then((res) => {
|
|
103
|
-
if (res
|
|
120
|
+
if (res?.ok && res.value !== null && localStorage.getItem(key) === value) {
|
|
104
121
|
if (res.value === '')
|
|
105
122
|
localStorage.removeItem(key);
|
|
106
123
|
else
|
|
@@ -111,7 +128,7 @@ export function brokeredPreviewStorage() {
|
|
|
111
128
|
removeItem: (key) => {
|
|
112
129
|
const local = readLocal(key);
|
|
113
130
|
localStorage.removeItem(key);
|
|
114
|
-
return request('lovable-preview-auth:remove', key, local ?? undefined).then(() =>
|
|
131
|
+
return request('lovable-preview-auth:remove', key, local ?? undefined).then(() => { });
|
|
115
132
|
},
|
|
116
133
|
};
|
|
117
134
|
}
|