@patientos/website-kit 0.2.5 → 0.2.7
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/README.md +86 -0
- package/dist/{checkout-block-Cog4H4I4.d.ts → booking-block-D-UOAPx3.d.ts} +1 -49
- package/dist/cart-block-B-ytc9us.d.ts +20 -0
- package/dist/cart-button-BCLFittB.d.ts +24 -0
- package/dist/cart-storage.d.ts +110 -0
- package/dist/cart-storage.js +39 -0
- package/dist/checkout-block-BeXwpqYe.d.ts +24 -0
- package/dist/chunk-2CZFJOKK.js +79 -0
- package/dist/{chunk-FSZ726DM.js → chunk-3T7UWKAH.js} +4 -308
- package/dist/{chunk-75FJ5AJB.js → chunk-4GKSSM5N.js} +578 -1608
- package/dist/chunk-4NF7SSIX.js +367 -0
- package/dist/chunk-673YEXAI.js +164 -0
- package/dist/chunk-7BUDUYXN.js +80 -0
- package/dist/chunk-FZ4WKWIE.js +310 -0
- package/dist/{chunk-7UPUEMXX.js → chunk-HYXTDUP2.js} +20 -5
- package/dist/chunk-IOC6QLB7.js +159 -0
- package/dist/chunk-S3ZQQOQT.js +2057 -0
- package/dist/chunk-WQSJ46TP.js +19 -0
- package/dist/chunk-ZNH6TSYP.js +167 -0
- package/dist/index.d.ts +11 -4
- package/dist/index.js +120 -33
- package/dist/islands-impl/cart-button.d.ts +19 -0
- package/dist/islands-impl/cart-button.js +13 -0
- package/dist/islands-impl/cart.d.ts +31 -0
- package/dist/islands-impl/cart.js +11 -0
- package/dist/islands-impl/checkout.d.ts +6 -0
- package/dist/islands-impl/checkout.js +13 -0
- package/dist/islands-impl/store.d.ts +22 -0
- package/dist/islands-impl/store.js +14 -0
- package/dist/islands-impl.d.ts +14 -10
- package/dist/islands-impl.js +22 -7
- package/dist/islands-registry.js +13 -4
- package/dist/{portal-account-8uQc_Ncx.d.ts → portal-account-DRJyr3nz.d.ts} +1 -82
- package/dist/{portal-account.client-BBe_q9yC.d.ts → portal-account.client-Bke4NsgW.d.ts} +2 -1
- package/dist/portal-booking-client.d.ts +3 -2
- package/dist/portal-booking-client.js +2 -1
- package/dist/portal-client-my3q5GME.d.ts +83 -0
- package/dist/store-block-CFxnsfKU.d.ts +37 -0
- package/dist/store-catalog-p7TFOpfk.d.ts +78 -0
- package/dist/store-catalog.d.ts +3 -0
- package/dist/store-catalog.js +11 -0
- package/dist/website-kit.css +196 -1
- package/package.json +31 -1
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BPOINT_SCRIPT_URL,
|
|
3
|
-
CONSULT_CHUNK_PATH,
|
|
4
|
-
TURNSTILE_SCRIPT_URL
|
|
5
|
-
} from "./chunk-ZOF22TJA.js";
|
|
6
|
-
import {
|
|
7
|
-
visibleQuestions
|
|
8
|
-
} from "./chunk-QDO3SJWR.js";
|
|
9
|
-
import {
|
|
10
|
-
Island
|
|
11
|
-
} from "./chunk-THMT43MV.js";
|
|
12
1
|
import {
|
|
13
2
|
FlowButton,
|
|
14
3
|
FlowError,
|
|
@@ -24,7 +13,6 @@ import {
|
|
|
24
13
|
SlotPicker,
|
|
25
14
|
SummarisedFieldErrors,
|
|
26
15
|
adoptClaimToken,
|
|
27
|
-
createPortalClient,
|
|
28
16
|
describedBy,
|
|
29
17
|
effectiveFee,
|
|
30
18
|
errorCode,
|
|
@@ -65,7 +53,25 @@ import {
|
|
|
65
53
|
signOutOfPortal,
|
|
66
54
|
writePortalSignedInHint,
|
|
67
55
|
zoneAbbr
|
|
68
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-3T7UWKAH.js";
|
|
57
|
+
import {
|
|
58
|
+
visibleQuestions
|
|
59
|
+
} from "./chunk-QDO3SJWR.js";
|
|
60
|
+
import {
|
|
61
|
+
Island
|
|
62
|
+
} from "./chunk-THMT43MV.js";
|
|
63
|
+
import {
|
|
64
|
+
AddressPicker,
|
|
65
|
+
attachCardToAuthKey,
|
|
66
|
+
loadBpointScript
|
|
67
|
+
} from "./chunk-S3ZQQOQT.js";
|
|
68
|
+
import {
|
|
69
|
+
CONSULT_CHUNK_PATH,
|
|
70
|
+
TURNSTILE_SCRIPT_URL
|
|
71
|
+
} from "./chunk-ZOF22TJA.js";
|
|
72
|
+
import {
|
|
73
|
+
createPortalClient
|
|
74
|
+
} from "./chunk-FZ4WKWIE.js";
|
|
69
75
|
import {
|
|
70
76
|
__export
|
|
71
77
|
} from "./chunk-MLKGABMK.js";
|
|
@@ -204,202 +210,6 @@ function bookingStepTitle(step, clinicName) {
|
|
|
204
210
|
// src/identity.tsx
|
|
205
211
|
import * as React2 from "react";
|
|
206
212
|
|
|
207
|
-
// src/address-picker.tsx
|
|
208
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
209
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
210
|
-
var DEBOUNCE_MS = 300;
|
|
211
|
-
var MIN_QUERY = 3;
|
|
212
|
-
function nextActiveIndex(current, count, delta) {
|
|
213
|
-
if (count <= 0) return -1;
|
|
214
|
-
const next = current + delta;
|
|
215
|
-
if (next < 0) return count - 1;
|
|
216
|
-
if (next >= count) return 0;
|
|
217
|
-
return next;
|
|
218
|
-
}
|
|
219
|
-
function AddressPicker({
|
|
220
|
-
value,
|
|
221
|
-
onChange,
|
|
222
|
-
search,
|
|
223
|
-
validate,
|
|
224
|
-
idPrefix,
|
|
225
|
-
disabled,
|
|
226
|
-
error: error2,
|
|
227
|
-
label = "Address"
|
|
228
|
-
}) {
|
|
229
|
-
const [query, setQuery] = useState("");
|
|
230
|
-
const [suggestions, setSuggestions] = useState([]);
|
|
231
|
-
const [active, setActive] = useState(-1);
|
|
232
|
-
const [open, setOpen] = useState(false);
|
|
233
|
-
const [busy, setBusy] = useState(false);
|
|
234
|
-
const [checking, setChecking] = useState(false);
|
|
235
|
-
const [refused, setRefused] = useState(null);
|
|
236
|
-
const live = useRef({ search, validate });
|
|
237
|
-
live.current = { search, validate };
|
|
238
|
-
const seq = useRef(0);
|
|
239
|
-
useEffect(() => {
|
|
240
|
-
const q = query.trim();
|
|
241
|
-
setRefused(null);
|
|
242
|
-
if (q.length < MIN_QUERY) {
|
|
243
|
-
setSuggestions([]);
|
|
244
|
-
setOpen(false);
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
setBusy(true);
|
|
248
|
-
const mine = ++seq.current;
|
|
249
|
-
const timer = setTimeout(() => {
|
|
250
|
-
live.current.search(q).then((next) => {
|
|
251
|
-
if (mine !== seq.current) return;
|
|
252
|
-
setSuggestions(next);
|
|
253
|
-
setActive(-1);
|
|
254
|
-
setOpen(next.length > 0);
|
|
255
|
-
}).catch(() => {
|
|
256
|
-
if (mine !== seq.current) return;
|
|
257
|
-
setSuggestions([]);
|
|
258
|
-
setOpen(false);
|
|
259
|
-
}).finally(() => {
|
|
260
|
-
if (mine === seq.current) setBusy(false);
|
|
261
|
-
});
|
|
262
|
-
}, DEBOUNCE_MS);
|
|
263
|
-
return () => clearTimeout(timer);
|
|
264
|
-
}, [query]);
|
|
265
|
-
const choose = useCallback(
|
|
266
|
-
(s) => {
|
|
267
|
-
onChange({ address: s.label, placeId: s.placeId });
|
|
268
|
-
setQuery("");
|
|
269
|
-
setSuggestions([]);
|
|
270
|
-
setOpen(false);
|
|
271
|
-
},
|
|
272
|
-
[onChange]
|
|
273
|
-
);
|
|
274
|
-
const checkTyped = useCallback(async () => {
|
|
275
|
-
const address = query.trim();
|
|
276
|
-
if (!address || checking) return;
|
|
277
|
-
setChecking(true);
|
|
278
|
-
setRefused(null);
|
|
279
|
-
try {
|
|
280
|
-
const confirmed = await live.current.validate(address);
|
|
281
|
-
if (!confirmed) {
|
|
282
|
-
setRefused("We couldn\u2019t verify that address. Check it and try again.");
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
onChange(confirmed);
|
|
286
|
-
setQuery("");
|
|
287
|
-
setSuggestions([]);
|
|
288
|
-
setOpen(false);
|
|
289
|
-
} catch {
|
|
290
|
-
setRefused("We couldn\u2019t verify that address. Check it and try again.");
|
|
291
|
-
} finally {
|
|
292
|
-
setChecking(false);
|
|
293
|
-
}
|
|
294
|
-
}, [query, checking, onChange]);
|
|
295
|
-
const inputId = `${idPrefix}-address`;
|
|
296
|
-
const errorId = `${idPrefix}-address-error`;
|
|
297
|
-
const listId = `${idPrefix}-address-list`;
|
|
298
|
-
if (value) {
|
|
299
|
-
return /* @__PURE__ */ jsxs("div", { className: "sk-address sk-address--picked", children: [
|
|
300
|
-
/* @__PURE__ */ jsx("span", { className: "sk-address__label", children: label }),
|
|
301
|
-
/* @__PURE__ */ jsx("p", { className: "sk-address__chosen", children: value.address }),
|
|
302
|
-
/* @__PURE__ */ jsx(
|
|
303
|
-
"button",
|
|
304
|
-
{
|
|
305
|
-
type: "button",
|
|
306
|
-
className: "sk-address__change",
|
|
307
|
-
disabled,
|
|
308
|
-
onClick: () => onChange(null),
|
|
309
|
-
children: "Change"
|
|
310
|
-
}
|
|
311
|
-
)
|
|
312
|
-
] });
|
|
313
|
-
}
|
|
314
|
-
function onKeyDown(e) {
|
|
315
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
316
|
-
if (!open || suggestions.length === 0) return;
|
|
317
|
-
e.preventDefault();
|
|
318
|
-
setActive((i) => nextActiveIndex(i, suggestions.length, e.key === "ArrowDown" ? 1 : -1));
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
if (e.key === "Escape" && open) {
|
|
322
|
-
e.preventDefault();
|
|
323
|
-
setOpen(false);
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
if (e.key === "Enter") {
|
|
327
|
-
e.preventDefault();
|
|
328
|
-
const chosen = open && active >= 0 ? suggestions[active] : void 0;
|
|
329
|
-
if (chosen) choose(chosen);
|
|
330
|
-
else if (suggestions.length === 0) void checkTyped();
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
const showNoMatches = query.trim().length >= MIN_QUERY && !busy && suggestions.length === 0;
|
|
334
|
-
const status = checking ? "Checking that address\u2026" : busy ? "Searching\u2026" : open && suggestions.length > 0 ? `${suggestions.length} ${suggestions.length === 1 ? "address" : "addresses"} found. Use the arrow keys to review them.` : showNoMatches ? "No matches for that search." : "";
|
|
335
|
-
return /* @__PURE__ */ jsxs("div", { className: "sk-address", children: [
|
|
336
|
-
/* @__PURE__ */ jsx("label", { className: "sk-address__label", htmlFor: inputId, children: label }),
|
|
337
|
-
/* @__PURE__ */ jsxs("div", { className: "sk-address__box", children: [
|
|
338
|
-
/* @__PURE__ */ jsx(
|
|
339
|
-
"input",
|
|
340
|
-
{
|
|
341
|
-
id: inputId,
|
|
342
|
-
type: "text",
|
|
343
|
-
role: "combobox",
|
|
344
|
-
className: "sk-address__input",
|
|
345
|
-
autoComplete: "off",
|
|
346
|
-
"aria-expanded": open,
|
|
347
|
-
"aria-controls": listId,
|
|
348
|
-
"aria-autocomplete": "list",
|
|
349
|
-
"aria-activedescendant": active >= 0 ? `${listId}-${active}` : void 0,
|
|
350
|
-
"aria-busy": busy || void 0,
|
|
351
|
-
"aria-invalid": error2 || refused ? true : void 0,
|
|
352
|
-
"aria-describedby": error2 || refused ? errorId : void 0,
|
|
353
|
-
placeholder: "Start typing your address\u2026",
|
|
354
|
-
disabled,
|
|
355
|
-
value: query,
|
|
356
|
-
onChange: (e) => setQuery(e.target.value),
|
|
357
|
-
onKeyDown
|
|
358
|
-
}
|
|
359
|
-
),
|
|
360
|
-
open && /* @__PURE__ */ jsx(
|
|
361
|
-
"ul",
|
|
362
|
-
{
|
|
363
|
-
className: "sk-address__list",
|
|
364
|
-
id: listId,
|
|
365
|
-
role: "listbox",
|
|
366
|
-
"aria-label": "Address suggestions",
|
|
367
|
-
children: suggestions.map((s, i) => /* @__PURE__ */ jsx(
|
|
368
|
-
"li",
|
|
369
|
-
{
|
|
370
|
-
id: `${listId}-${i}`,
|
|
371
|
-
role: "option",
|
|
372
|
-
"aria-selected": i === active,
|
|
373
|
-
className: ["sk-address__option", i === active ? "sk-address__option--active" : null].filter(Boolean).join(" "),
|
|
374
|
-
onMouseDown: (e) => {
|
|
375
|
-
e.preventDefault();
|
|
376
|
-
choose(s);
|
|
377
|
-
},
|
|
378
|
-
children: s.label
|
|
379
|
-
},
|
|
380
|
-
s.placeId
|
|
381
|
-
))
|
|
382
|
-
}
|
|
383
|
-
)
|
|
384
|
-
] }),
|
|
385
|
-
showNoMatches && /* @__PURE__ */ jsxs("div", { className: "sk-address__empty", children: [
|
|
386
|
-
/* @__PURE__ */ jsx("p", { children: "No matches for that search." }),
|
|
387
|
-
/* @__PURE__ */ jsx(
|
|
388
|
-
"button",
|
|
389
|
-
{
|
|
390
|
-
type: "button",
|
|
391
|
-
className: "sk-address__check",
|
|
392
|
-
disabled: checking,
|
|
393
|
-
onClick: () => void checkTyped(),
|
|
394
|
-
children: checking ? "Checking\u2026" : "Check this address"
|
|
395
|
-
}
|
|
396
|
-
)
|
|
397
|
-
] }),
|
|
398
|
-
(error2 || refused) && /* @__PURE__ */ jsx("p", { className: "sk-address__error", id: errorId, children: refused ?? error2 }),
|
|
399
|
-
/* @__PURE__ */ jsx("p", { className: "sk-address__status", role: "status", "aria-live": "polite", children: status })
|
|
400
|
-
] });
|
|
401
|
-
}
|
|
402
|
-
|
|
403
213
|
// src/phone-au.ts
|
|
404
214
|
function normalizeAuPhone(input) {
|
|
405
215
|
const cleaned = input.replace(/[\s()-]/g, "");
|
|
@@ -421,10 +231,10 @@ function formatAuPhone(input) {
|
|
|
421
231
|
|
|
422
232
|
// src/portal-context.tsx
|
|
423
233
|
import * as React from "react";
|
|
424
|
-
import { jsx
|
|
234
|
+
import { jsx } from "react/jsx-runtime";
|
|
425
235
|
var PortalContext = React.createContext(void 0);
|
|
426
236
|
function PortalProvider({ client, children }) {
|
|
427
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ jsx(PortalContext.Provider, { value: client, children });
|
|
428
238
|
}
|
|
429
239
|
function usePortalClient() {
|
|
430
240
|
const client = React.useContext(PortalContext);
|
|
@@ -485,7 +295,7 @@ function usePortalSession() {
|
|
|
485
295
|
}
|
|
486
296
|
|
|
487
297
|
// src/identity.tsx
|
|
488
|
-
import { Fragment, jsx as
|
|
298
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
489
299
|
var MAGIC_LINK_UNIFORM_MESSAGE = "If that email is known to this clinic, a sign-in link is on its way.";
|
|
490
300
|
var EMPTY_IDENTITY = {
|
|
491
301
|
givenName: "",
|
|
@@ -537,17 +347,17 @@ function SignInRamp({ redirect, prepareRedirect }) {
|
|
|
537
347
|
const href = portal.portalHref;
|
|
538
348
|
if (!available) {
|
|
539
349
|
if (!href) return null;
|
|
540
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ jsxs("p", { className: "sk-identity__ramp", children: [
|
|
541
351
|
"Been here before?",
|
|
542
352
|
" ",
|
|
543
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ jsx2("a", { href, className: "sk-identity__ramp-link", children: "Sign in to the patient portal" })
|
|
544
354
|
] });
|
|
545
355
|
}
|
|
546
356
|
if (outcome === "sent") {
|
|
547
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ jsx2("p", { className: "sk-identity__ramp sk-identity__ramp--sent", role: "status", "aria-live": "polite", children: MAGIC_LINK_UNIFORM_MESSAGE });
|
|
548
358
|
}
|
|
549
359
|
if (outcome === "failed") {
|
|
550
|
-
return /* @__PURE__ */
|
|
360
|
+
return /* @__PURE__ */ jsxs(
|
|
551
361
|
"p",
|
|
552
362
|
{
|
|
553
363
|
className: "sk-identity__ramp sk-identity__ramp--failed",
|
|
@@ -556,20 +366,20 @@ function SignInRamp({ redirect, prepareRedirect }) {
|
|
|
556
366
|
children: [
|
|
557
367
|
"We couldn\u2019t reach the clinic.",
|
|
558
368
|
" ",
|
|
559
|
-
href ? /* @__PURE__ */
|
|
369
|
+
href ? /* @__PURE__ */ jsx2("a", { href, className: "sk-identity__ramp-link", children: "Try the patient portal directly" }) : "Please try the patient portal directly."
|
|
560
370
|
]
|
|
561
371
|
}
|
|
562
372
|
);
|
|
563
373
|
}
|
|
564
374
|
if (!open) {
|
|
565
|
-
return /* @__PURE__ */
|
|
375
|
+
return /* @__PURE__ */ jsx2("p", { className: "sk-identity__ramp", children: /* @__PURE__ */ jsx2("button", { type: "button", className: "sk-identity__ramp-link", onClick: () => setOpen(true), children: "Been here before? Get a sign-in link" }) });
|
|
566
376
|
}
|
|
567
377
|
return (
|
|
568
378
|
// A nested <form> is illegal HTML, and the identity form is usually a form already —
|
|
569
379
|
// so this is a div with an explicit click handler, not a form element.
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ jsxs("div", { className: "sk-identity__ramp sk-identity__ramp--open", children: [
|
|
381
|
+
/* @__PURE__ */ jsx2("label", { className: "sk-identity__label", htmlFor: "sk-ramp-email", children: "Your email" }),
|
|
382
|
+
/* @__PURE__ */ jsx2(
|
|
573
383
|
"input",
|
|
574
384
|
{
|
|
575
385
|
id: "sk-ramp-email",
|
|
@@ -580,7 +390,7 @@ function SignInRamp({ redirect, prepareRedirect }) {
|
|
|
580
390
|
onChange: (e) => setEmail(e.target.value)
|
|
581
391
|
}
|
|
582
392
|
),
|
|
583
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ jsx2(
|
|
584
394
|
FlowButton,
|
|
585
395
|
{
|
|
586
396
|
type: "button",
|
|
@@ -607,17 +417,17 @@ function ConfirmIdentityCard({
|
|
|
607
417
|
}) {
|
|
608
418
|
const given = prefill.givenName?.trim() || "";
|
|
609
419
|
const name = [given, prefill.familyName?.trim() || ""].filter(Boolean).join(" ");
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
-
name && /* @__PURE__ */
|
|
614
|
-
prefill.dateOfBirth && /* @__PURE__ */
|
|
615
|
-
prefill.email && /* @__PURE__ */
|
|
616
|
-
prefill.phone && /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ jsxs("div", { className: "sk-identity__confirm", children: [
|
|
421
|
+
/* @__PURE__ */ jsx2("p", { className: "sk-identity__confirm-title", children: "Is this you?" }),
|
|
422
|
+
/* @__PURE__ */ jsxs("dl", { className: "sk-identity__confirm-list", children: [
|
|
423
|
+
name && /* @__PURE__ */ jsx2(Row, { label: "Name", value: name }),
|
|
424
|
+
prefill.dateOfBirth && /* @__PURE__ */ jsx2(Row, { label: "Date of birth", value: formatDobAu(prefill.dateOfBirth) }),
|
|
425
|
+
prefill.email && /* @__PURE__ */ jsx2(Row, { label: "Email", value: prefill.email }),
|
|
426
|
+
prefill.phone && /* @__PURE__ */ jsx2(Row, { label: "Phone", value: prefill.phone })
|
|
617
427
|
] }),
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ jsxs("div", { className: "sk-identity__confirm-actions", children: [
|
|
429
|
+
/* @__PURE__ */ jsx2(FlowButton, { type: "button", variant: "primary", busy, onClick: onConfirm, children: given ? `Yes, continue as ${given}` : "Yes, that\u2019s me" }),
|
|
430
|
+
/* @__PURE__ */ jsx2(FlowButton, { type: "button", variant: "quiet", disabled: busy, onClick: onReject, children: "Not you? Start fresh" })
|
|
621
431
|
] })
|
|
622
432
|
] });
|
|
623
433
|
}
|
|
@@ -643,9 +453,9 @@ function formatDobAu(iso) {
|
|
|
643
453
|
return `${Number(m[3])} ${month} ${m[1]}`;
|
|
644
454
|
}
|
|
645
455
|
function Row({ label, value }) {
|
|
646
|
-
return /* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
-
/* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ jsxs("div", { className: "sk-identity__confirm-row", children: [
|
|
457
|
+
/* @__PURE__ */ jsx2("dt", { children: label }),
|
|
458
|
+
/* @__PURE__ */ jsx2("dd", { children: value })
|
|
649
459
|
] });
|
|
650
460
|
}
|
|
651
461
|
function IdentityForm({
|
|
@@ -658,9 +468,9 @@ function IdentityForm({
|
|
|
658
468
|
}) {
|
|
659
469
|
const set2 = (k, v) => onChange({ ...values, [k]: v });
|
|
660
470
|
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
661
|
-
return /* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
471
|
+
return /* @__PURE__ */ jsxs("div", { className: "sk-identity", children: [
|
|
472
|
+
/* @__PURE__ */ jsxs("div", { className: "sk-identity__grid", children: [
|
|
473
|
+
/* @__PURE__ */ jsx2(Field, { id: `${idPrefix}-given`, label: "First name", error: errors2.givenName, children: /* @__PURE__ */ jsx2(
|
|
664
474
|
"input",
|
|
665
475
|
{
|
|
666
476
|
id: `${idPrefix}-given`,
|
|
@@ -673,7 +483,7 @@ function IdentityForm({
|
|
|
673
483
|
onChange: (e) => set2("givenName", e.target.value)
|
|
674
484
|
}
|
|
675
485
|
) }),
|
|
676
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ jsx2(Field, { id: `${idPrefix}-family`, label: "Last name", error: errors2.familyName, children: /* @__PURE__ */ jsx2(
|
|
677
487
|
"input",
|
|
678
488
|
{
|
|
679
489
|
id: `${idPrefix}-family`,
|
|
@@ -686,7 +496,7 @@ function IdentityForm({
|
|
|
686
496
|
onChange: (e) => set2("familyName", e.target.value)
|
|
687
497
|
}
|
|
688
498
|
) }),
|
|
689
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ jsx2(Field, { id: `${idPrefix}-email`, label: "Email", error: errors2.email, wide: true, children: /* @__PURE__ */ jsx2(
|
|
690
500
|
"input",
|
|
691
501
|
{
|
|
692
502
|
id: `${idPrefix}-email`,
|
|
@@ -699,7 +509,7 @@ function IdentityForm({
|
|
|
699
509
|
onChange: (e) => set2("email", e.target.value)
|
|
700
510
|
}
|
|
701
511
|
) }),
|
|
702
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ jsx2(Field, { id: `${idPrefix}-phone`, label: "Phone", error: errors2.phone, children: /* @__PURE__ */ jsx2(
|
|
703
513
|
"input",
|
|
704
514
|
{
|
|
705
515
|
id: `${idPrefix}-phone`,
|
|
@@ -713,14 +523,14 @@ function IdentityForm({
|
|
|
713
523
|
onChange: (e) => set2("phone", e.target.value)
|
|
714
524
|
}
|
|
715
525
|
) }),
|
|
716
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ jsx2(
|
|
717
527
|
Field,
|
|
718
528
|
{
|
|
719
529
|
id: `${idPrefix}-dob`,
|
|
720
530
|
label: "Date of birth",
|
|
721
531
|
error: errors2.dateOfBirth,
|
|
722
532
|
help: "We ask so we match you to the right record.",
|
|
723
|
-
children: /* @__PURE__ */
|
|
533
|
+
children: /* @__PURE__ */ jsx2(
|
|
724
534
|
"input",
|
|
725
535
|
{
|
|
726
536
|
id: `${idPrefix}-dob`,
|
|
@@ -739,17 +549,17 @@ function IdentityForm({
|
|
|
739
549
|
}
|
|
740
550
|
)
|
|
741
551
|
] }),
|
|
742
|
-
address && /* @__PURE__ */
|
|
743
|
-
/* @__PURE__ */
|
|
744
|
-
/* @__PURE__ */
|
|
745
|
-
/* @__PURE__ */
|
|
552
|
+
address && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
553
|
+
/* @__PURE__ */ jsx2("p", { className: "sk-identity__section", id: `${idPrefix}-address-heading`, children: "Residential address" }),
|
|
554
|
+
/* @__PURE__ */ jsx2("p", { className: "sk-identity__section-note", id: `${idPrefix}-address-note`, children: "A practitioner can only issue to a patient they have identified, so your address goes on your patient record." }),
|
|
555
|
+
/* @__PURE__ */ jsx2(
|
|
746
556
|
"div",
|
|
747
557
|
{
|
|
748
558
|
className: "sk-identity__grid",
|
|
749
559
|
role: "group",
|
|
750
560
|
"aria-labelledby": `${idPrefix}-address-heading`,
|
|
751
561
|
"aria-describedby": `${idPrefix}-address-note`,
|
|
752
|
-
children: /* @__PURE__ */
|
|
562
|
+
children: /* @__PURE__ */ jsx2(
|
|
753
563
|
AddressPicker,
|
|
754
564
|
{
|
|
755
565
|
idPrefix,
|
|
@@ -781,11 +591,11 @@ function Field({
|
|
|
781
591
|
"aria-describedby": describedBy(helpId, errorId),
|
|
782
592
|
"aria-invalid": error2 ? true : void 0
|
|
783
593
|
}) : children;
|
|
784
|
-
return /* @__PURE__ */
|
|
785
|
-
/* @__PURE__ */
|
|
594
|
+
return /* @__PURE__ */ jsxs("div", { className: ["sk-identity__field", wide ? "sk-identity__field--wide" : ""].filter(Boolean).join(" "), children: [
|
|
595
|
+
/* @__PURE__ */ jsx2("label", { className: "sk-identity__label", htmlFor: id, children: label }),
|
|
786
596
|
control,
|
|
787
|
-
help && /* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
597
|
+
help && /* @__PURE__ */ jsx2("p", { className: "sk-identity__help", id: helpId, children: help }),
|
|
598
|
+
/* @__PURE__ */ jsx2(FlowError, { id: errorId, children: error2 })
|
|
789
599
|
] });
|
|
790
600
|
}
|
|
791
601
|
async function probeIdentity(portal) {
|
|
@@ -798,7 +608,7 @@ async function probeIdentity(portal) {
|
|
|
798
608
|
|
|
799
609
|
// src/turnstile.tsx
|
|
800
610
|
import * as React3 from "react";
|
|
801
|
-
import { jsx as
|
|
611
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
802
612
|
function loadTurnstileScript() {
|
|
803
613
|
if (typeof window === "undefined") return Promise.resolve();
|
|
804
614
|
if (window.turnstile) return Promise.resolve();
|
|
@@ -852,14 +662,14 @@ function TurnstileWidget({
|
|
|
852
662
|
};
|
|
853
663
|
}, [key]);
|
|
854
664
|
if (!key) return null;
|
|
855
|
-
return /* @__PURE__ */
|
|
665
|
+
return /* @__PURE__ */ jsx3("div", { ref: containerRef, className: "sk-turnstile" });
|
|
856
666
|
}
|
|
857
667
|
function turnstileRequired(siteKey) {
|
|
858
668
|
return (siteKey?.trim().length ?? 0) > 0;
|
|
859
669
|
}
|
|
860
670
|
|
|
861
671
|
// src/booking-block.client.tsx
|
|
862
|
-
import { jsx as
|
|
672
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
863
673
|
function BookingBlockClient(props) {
|
|
864
674
|
const portalClient = React4.useMemo(
|
|
865
675
|
() => createPortalClient({
|
|
@@ -874,15 +684,15 @@ function BookingBlockClient(props) {
|
|
|
874
684
|
]
|
|
875
685
|
);
|
|
876
686
|
if (!props.publicApi?.publishableKey) {
|
|
877
|
-
return /* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
/* @__PURE__ */
|
|
687
|
+
return /* @__PURE__ */ jsxs2("div", { className: "sk-booking__unconfigured", children: [
|
|
688
|
+
/* @__PURE__ */ jsx4("h2", { className: "sk-booking__heading", children: props.heading ?? "Book an appointment" }),
|
|
689
|
+
/* @__PURE__ */ jsxs2("p", { className: "sk-booking__placeholder", children: [
|
|
880
690
|
"Online booking isn\u2019t available right now.",
|
|
881
691
|
props.clinicPhone ? ` Please call the clinic on ${props.clinicPhone}.` : " Please call the clinic."
|
|
882
692
|
] })
|
|
883
693
|
] });
|
|
884
694
|
}
|
|
885
|
-
return /* @__PURE__ */
|
|
695
|
+
return /* @__PURE__ */ jsx4(PortalProvider, { client: portalClient, children: /* @__PURE__ */ jsx4(Booking, { ...props }) });
|
|
886
696
|
}
|
|
887
697
|
function Booking({
|
|
888
698
|
publicApi,
|
|
@@ -1044,24 +854,24 @@ function Booking({
|
|
|
1044
854
|
await commit(claim.contactId);
|
|
1045
855
|
}
|
|
1046
856
|
const back2 = React4.useCallback(() => dispatch({ type: "BACK" }), [dispatch]);
|
|
1047
|
-
if (!state) return /* @__PURE__ */
|
|
857
|
+
if (!state) return /* @__PURE__ */ jsx4(FlowLoading, {});
|
|
1048
858
|
const title = bookingStepTitle(state.step, clinicName);
|
|
1049
859
|
const showBack = canBookingGoBack(state, pinned);
|
|
1050
860
|
const chosenType = appointmentTypes.find((t) => t.id === state.appointmentTypeId) ?? null;
|
|
1051
861
|
switch (state.step) {
|
|
1052
862
|
case "type":
|
|
1053
|
-
return /* @__PURE__ */
|
|
863
|
+
return /* @__PURE__ */ jsx4(FlowShell, { stepKey: "type", eyebrow: "Step 1 of 3", heading: heading2, stepNumber: 1, totalSteps: 3, documentTitle: title, children: appointmentTypes.length === 0 ? /* @__PURE__ */ jsxs2("p", { className: "sk-booking__empty", children: [
|
|
1054
864
|
"Online booking isn\u2019t available right now.",
|
|
1055
865
|
clinicPhone ? ` Please call the clinic on ${clinicPhone}.` : " Please call the clinic."
|
|
1056
|
-
] }) : /* @__PURE__ */
|
|
866
|
+
] }) : /* @__PURE__ */ jsx4("ul", { className: "sk-booking__list", children: appointmentTypes.map((t) => /* @__PURE__ */ jsx4("li", { children: /* @__PURE__ */ jsxs2(
|
|
1057
867
|
"button",
|
|
1058
868
|
{
|
|
1059
869
|
type: "button",
|
|
1060
870
|
className: "sk-booking__option",
|
|
1061
871
|
onClick: () => dispatch({ type: "SELECT_TYPE", appointmentTypeId: t.id }),
|
|
1062
872
|
children: [
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ jsx4("span", { className: "sk-booking__option-label", children: t.label }),
|
|
874
|
+
/* @__PURE__ */ jsxs2("span", { className: "sk-booking__option-meta", children: [
|
|
1065
875
|
t.durationMinutes ? `${t.durationMinutes} min` : "",
|
|
1066
876
|
t.modality === "telehealth" ? " \xB7 Telehealth" : ""
|
|
1067
877
|
] })
|
|
@@ -1069,7 +879,7 @@ function Booking({
|
|
|
1069
879
|
}
|
|
1070
880
|
) }, t.id)) }) });
|
|
1071
881
|
case "slot":
|
|
1072
|
-
return /* @__PURE__ */
|
|
882
|
+
return /* @__PURE__ */ jsxs2(
|
|
1073
883
|
FlowShell,
|
|
1074
884
|
{
|
|
1075
885
|
stepKey: "slot",
|
|
@@ -1081,8 +891,8 @@ function Booking({
|
|
|
1081
891
|
documentTitle: title,
|
|
1082
892
|
onBack: showBack ? back2 : void 0,
|
|
1083
893
|
children: [
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ jsx4(FlowError, { children: error2 }),
|
|
895
|
+
/* @__PURE__ */ jsx4(
|
|
1086
896
|
SlotPicker,
|
|
1087
897
|
{
|
|
1088
898
|
client,
|
|
@@ -1104,7 +914,7 @@ function Booking({
|
|
|
1104
914
|
}
|
|
1105
915
|
);
|
|
1106
916
|
case "identity":
|
|
1107
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ jsxs2(
|
|
1108
918
|
FlowShell,
|
|
1109
919
|
{
|
|
1110
920
|
stepKey: "identity",
|
|
@@ -1115,11 +925,11 @@ function Booking({
|
|
|
1115
925
|
totalSteps: 3,
|
|
1116
926
|
documentTitle: title,
|
|
1117
927
|
onBack: showBack ? back2 : void 0,
|
|
1118
|
-
footer: /* @__PURE__ */
|
|
928
|
+
footer: /* @__PURE__ */ jsx4(FlowButton, { type: "submit", form: "sk-bk-identity", variant: "primary", busy, children: busy ? "Confirming\u2026" : "Confirm booking" }),
|
|
1119
929
|
children: [
|
|
1120
|
-
/* @__PURE__ */
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ jsx4(SignInRamp, {}),
|
|
931
|
+
/* @__PURE__ */ jsxs2("form", { id: "sk-bk-identity", onSubmit: (e) => void handleAnonymousSubmit(e), noValidate: true, children: [
|
|
932
|
+
/* @__PURE__ */ jsx4(
|
|
1123
933
|
IdentityForm,
|
|
1124
934
|
{
|
|
1125
935
|
values: identity,
|
|
@@ -1129,7 +939,7 @@ function Booking({
|
|
|
1129
939
|
idPrefix: "sk-bk"
|
|
1130
940
|
}
|
|
1131
941
|
),
|
|
1132
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ jsx4(
|
|
1133
943
|
TurnstileWidget,
|
|
1134
944
|
{
|
|
1135
945
|
siteKey: api.turnstileSiteKey,
|
|
@@ -1138,12 +948,12 @@ function Booking({
|
|
|
1138
948
|
}
|
|
1139
949
|
)
|
|
1140
950
|
] }),
|
|
1141
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ jsx4(FlowError, { children: error2 })
|
|
1142
952
|
]
|
|
1143
953
|
}
|
|
1144
954
|
);
|
|
1145
955
|
case "review":
|
|
1146
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */ jsxs2(
|
|
1147
957
|
FlowShell,
|
|
1148
958
|
{
|
|
1149
959
|
stepKey: "review",
|
|
@@ -1155,7 +965,7 @@ function Booking({
|
|
|
1155
965
|
documentTitle: title,
|
|
1156
966
|
onBack: showBack ? back2 : void 0,
|
|
1157
967
|
children: [
|
|
1158
|
-
prefill ? /* @__PURE__ */
|
|
968
|
+
prefill ? /* @__PURE__ */ jsx4(
|
|
1159
969
|
ConfirmIdentityCard,
|
|
1160
970
|
{
|
|
1161
971
|
prefill,
|
|
@@ -1163,20 +973,20 @@ function Booking({
|
|
|
1163
973
|
onConfirm: () => void handleSignedInConfirm(),
|
|
1164
974
|
onReject: () => dispatch({ type: "IDENTITY_REJECTED" })
|
|
1165
975
|
}
|
|
1166
|
-
) : /* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
976
|
+
) : /* @__PURE__ */ jsx4(FlowLoading, { message: "Checking your details\u2026" }),
|
|
977
|
+
/* @__PURE__ */ jsx4(FlowError, { children: error2 })
|
|
1168
978
|
]
|
|
1169
979
|
}
|
|
1170
980
|
);
|
|
1171
981
|
case "confirmed":
|
|
1172
|
-
return /* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
982
|
+
return /* @__PURE__ */ jsxs2(FlowShell, { stepKey: "confirmed", heading: "Appointment confirmed", documentTitle: title, children: [
|
|
983
|
+
/* @__PURE__ */ jsxs2("p", { className: "sk-booking__body", children: [
|
|
1174
984
|
state.slot ? `We\u2019ve booked your ${chosenType?.label ?? "appointment"} for ${formatSlotTime(state.slot.start, tz)}.` : "Your appointment is booked.",
|
|
1175
985
|
" ",
|
|
1176
986
|
"We\u2019ve sent you a confirmation."
|
|
1177
987
|
] }),
|
|
1178
|
-
api.portalUrl && /* @__PURE__ */
|
|
1179
|
-
/* @__PURE__ */
|
|
988
|
+
api.portalUrl && /* @__PURE__ */ jsx4("p", { className: "sk-booking__aside", children: /* @__PURE__ */ jsx4("a", { className: "sk-booking__link", href: api.portalUrl, children: "Manage this in the patient portal" }) }),
|
|
989
|
+
/* @__PURE__ */ jsx4("span", { hidden: true, "data-sk-contact-bound": contactId ? "1" : "0" })
|
|
1180
990
|
] });
|
|
1181
991
|
}
|
|
1182
992
|
}
|
|
@@ -1189,19 +999,19 @@ import {
|
|
|
1189
999
|
|
|
1190
1000
|
// src/application-run-command.ts
|
|
1191
1001
|
var inMemoryPromotionKeys = /* @__PURE__ */ new Map();
|
|
1192
|
-
function retainedPromotionCommandKey(applicationRunId,
|
|
1002
|
+
function retainedPromotionCommandKey(applicationRunId, storage, createKey = () => crypto.randomUUID()) {
|
|
1193
1003
|
const memoryKey = inMemoryPromotionKeys.get(applicationRunId);
|
|
1194
1004
|
if (memoryKey) return memoryKey;
|
|
1195
1005
|
const storageKey = `patientos:application-promotion:${applicationRunId}`;
|
|
1196
1006
|
try {
|
|
1197
|
-
const retained =
|
|
1007
|
+
const retained = storage?.getItem(storageKey);
|
|
1198
1008
|
if (retained) {
|
|
1199
1009
|
inMemoryPromotionKeys.set(applicationRunId, retained);
|
|
1200
1010
|
return retained;
|
|
1201
1011
|
}
|
|
1202
1012
|
const created = createKey();
|
|
1203
1013
|
inMemoryPromotionKeys.set(applicationRunId, created);
|
|
1204
|
-
|
|
1014
|
+
storage?.setItem(storageKey, created);
|
|
1205
1015
|
return created;
|
|
1206
1016
|
} catch {
|
|
1207
1017
|
const created = createKey();
|
|
@@ -1571,7 +1381,7 @@ function useStepProgress(step, questionIndex = 0) {
|
|
|
1571
1381
|
}
|
|
1572
1382
|
|
|
1573
1383
|
// src/portal-panel.tsx
|
|
1574
|
-
import { jsx as
|
|
1384
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1575
1385
|
var PORTAL_SURFACE_LABEL = {
|
|
1576
1386
|
appointments: "Your appointments",
|
|
1577
1387
|
documents: "Your documents",
|
|
@@ -1589,15 +1399,15 @@ function PortalPanel({
|
|
|
1589
1399
|
portalApiOrigin,
|
|
1590
1400
|
className
|
|
1591
1401
|
}) {
|
|
1592
|
-
return /* @__PURE__ */
|
|
1402
|
+
return /* @__PURE__ */ jsxs3(
|
|
1593
1403
|
Island,
|
|
1594
1404
|
{
|
|
1595
1405
|
name: "portal-panel",
|
|
1596
1406
|
props: { surface, portalUrl, portalApiOrigin },
|
|
1597
1407
|
className: ["sk-portal-panel", className].filter(Boolean).join(" "),
|
|
1598
1408
|
children: [
|
|
1599
|
-
/* @__PURE__ */
|
|
1600
|
-
/* @__PURE__ */
|
|
1409
|
+
/* @__PURE__ */ jsx5("h2", { className: "sk-portal-panel__heading", children: PORTAL_SURFACE_LABEL[surface] ?? "Your portal" }),
|
|
1410
|
+
/* @__PURE__ */ jsx5("p", { className: "sk-portal-panel__placeholder", children: /* @__PURE__ */ jsx5("a", { className: "sk-portal-panel__link", href: portalUrl ?? "/portal", children: "Sign in to your patient portal" }) })
|
|
1601
1411
|
]
|
|
1602
1412
|
}
|
|
1603
1413
|
);
|
|
@@ -1605,81 +1415,7 @@ function PortalPanel({
|
|
|
1605
1415
|
|
|
1606
1416
|
// src/payment.tsx
|
|
1607
1417
|
import * as React6 from "react";
|
|
1608
|
-
|
|
1609
|
-
// src/bpoint-client.ts
|
|
1610
|
-
function bpoint() {
|
|
1611
|
-
return globalThis.BPOINT;
|
|
1612
|
-
}
|
|
1613
|
-
var loadPromise = null;
|
|
1614
|
-
var SCRIPT_TIMEOUT_MS = 15e3;
|
|
1615
|
-
var CALLBACK_TIMEOUT_MS = 3e4;
|
|
1616
|
-
function loadBpointScript() {
|
|
1617
|
-
if (loadPromise) return loadPromise;
|
|
1618
|
-
loadPromise = new Promise((resolve, reject) => {
|
|
1619
|
-
if (typeof window !== "undefined" && bpoint()) {
|
|
1620
|
-
resolve();
|
|
1621
|
-
return;
|
|
1622
|
-
}
|
|
1623
|
-
const script = document.createElement("script");
|
|
1624
|
-
script.src = BPOINT_SCRIPT_URL;
|
|
1625
|
-
script.type = "text/javascript";
|
|
1626
|
-
const timer = setTimeout(
|
|
1627
|
-
() => reject(new Error("The payment gateway did not load. Please try again.")),
|
|
1628
|
-
SCRIPT_TIMEOUT_MS
|
|
1629
|
-
);
|
|
1630
|
-
script.onload = () => {
|
|
1631
|
-
clearTimeout(timer);
|
|
1632
|
-
resolve();
|
|
1633
|
-
};
|
|
1634
|
-
script.onerror = () => {
|
|
1635
|
-
clearTimeout(timer);
|
|
1636
|
-
reject(new Error("Failed to load BPOINT script"));
|
|
1637
|
-
};
|
|
1638
|
-
document.head.appendChild(script);
|
|
1639
|
-
});
|
|
1640
|
-
loadPromise = loadPromise.catch((err) => {
|
|
1641
|
-
loadPromise = null;
|
|
1642
|
-
throw err;
|
|
1643
|
-
});
|
|
1644
|
-
return loadPromise;
|
|
1645
|
-
}
|
|
1646
|
-
async function attachCardToAuthKey(authKey, card) {
|
|
1647
|
-
await loadBpointScript();
|
|
1648
|
-
const digits = card.number.replace(/\D/g, "");
|
|
1649
|
-
const exp = card.expiry.replace(/\D/g, "");
|
|
1650
|
-
const api = bpoint();
|
|
1651
|
-
if (!api) throw new Error("The payment gateway did not load. Please try again.");
|
|
1652
|
-
return new Promise((resolve, reject) => {
|
|
1653
|
-
const timer = setTimeout(
|
|
1654
|
-
() => reject(new Error("The payment gateway did not respond. Please try again.")),
|
|
1655
|
-
CALLBACK_TIMEOUT_MS
|
|
1656
|
-
);
|
|
1657
|
-
api.txn.authkey.attachPaymentMethod(
|
|
1658
|
-
authKey,
|
|
1659
|
-
{
|
|
1660
|
-
card: {
|
|
1661
|
-
number: digits,
|
|
1662
|
-
expiry: { month: exp.slice(0, 2), year: exp.slice(2, 4) },
|
|
1663
|
-
name: card.name.trim(),
|
|
1664
|
-
cvn: card.cvn
|
|
1665
|
-
}
|
|
1666
|
-
},
|
|
1667
|
-
(code2) => {
|
|
1668
|
-
clearTimeout(timer);
|
|
1669
|
-
if (code2 === "success") resolve();
|
|
1670
|
-
else
|
|
1671
|
-
reject(
|
|
1672
|
-
new Error(
|
|
1673
|
-
"We couldn't validate your card. Check the number, expiry and security code, then try again."
|
|
1674
|
-
)
|
|
1675
|
-
);
|
|
1676
|
-
}
|
|
1677
|
-
);
|
|
1678
|
-
});
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
// src/payment.tsx
|
|
1682
|
-
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1418
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1683
1419
|
var PHASE_MICROCOPY = {
|
|
1684
1420
|
init: "Preparing secure form\u2026",
|
|
1685
1421
|
// Deliberately blank: the `FlowError` already carries the reason, and a second live
|
|
@@ -1906,15 +1642,15 @@ function PaymentStep({
|
|
|
1906
1642
|
const busy = phase !== "ready";
|
|
1907
1643
|
const microcopy = PHASE_MICROCOPY[phase];
|
|
1908
1644
|
const holdLabel = feeText ? `Place ${feeText} hold` : "Place hold";
|
|
1909
|
-
return /* @__PURE__ */
|
|
1910
|
-
isMock ? /* @__PURE__ */
|
|
1645
|
+
return /* @__PURE__ */ jsxs4("div", { className: "sk-pay", children: [
|
|
1646
|
+
isMock ? /* @__PURE__ */ jsx6("p", { className: "sk-pay__mock", children: "Mock payments mode \u2014 card entry is skipped. Continue to simulate an approved pre-authorisation." }) : phase === "init" ? /* @__PURE__ */ jsx6("p", { className: "sk-pay__loading", role: "status", "aria-live": "polite", children: "Preparing the secure card form\u2026" }) : phase === "init_failed" ? (
|
|
1911
1647
|
// Nothing. There is no AuthKey, so four PAN fields and a promise about BPOINT
|
|
1912
1648
|
// would be asking for a card we have no way to tokenise. The `FlowError` below
|
|
1913
1649
|
// says what went wrong; the actions block says what to do about it.
|
|
1914
1650
|
null
|
|
1915
|
-
) : /* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1651
|
+
) : /* @__PURE__ */ jsxs4("form", { id: "sk-pay-form", className: "sk-pay__form", onSubmit: handleCardSubmit, noValidate: true, children: [
|
|
1652
|
+
/* @__PURE__ */ jsx6(PaymentOrderSummary, { serviceLabel, feeText }),
|
|
1653
|
+
/* @__PURE__ */ jsx6(CardField, { id: "sk-cc-number", label: "Card number", error: cardErrors.number, children: /* @__PURE__ */ jsx6(
|
|
1918
1654
|
"input",
|
|
1919
1655
|
{
|
|
1920
1656
|
id: "sk-cc-number",
|
|
@@ -1928,8 +1664,8 @@ function PaymentStep({
|
|
|
1928
1664
|
onChange: (e) => setCard({ ...card, number: formatCardNumber(e.target.value) })
|
|
1929
1665
|
}
|
|
1930
1666
|
) }),
|
|
1931
|
-
/* @__PURE__ */
|
|
1932
|
-
/* @__PURE__ */
|
|
1667
|
+
/* @__PURE__ */ jsxs4("div", { className: "sk-pay__row", children: [
|
|
1668
|
+
/* @__PURE__ */ jsx6(CardField, { id: "sk-cc-expiry", label: "Expiry (MM/YY)", error: cardErrors.expiry, children: /* @__PURE__ */ jsx6(
|
|
1933
1669
|
"input",
|
|
1934
1670
|
{
|
|
1935
1671
|
id: "sk-cc-expiry",
|
|
@@ -1943,7 +1679,7 @@ function PaymentStep({
|
|
|
1943
1679
|
onChange: (e) => setCard({ ...card, expiry: formatExpiry(e.target.value) })
|
|
1944
1680
|
}
|
|
1945
1681
|
) }),
|
|
1946
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ jsx6(CardField, { id: "sk-cc-cvn", label: "Security code", error: cardErrors.cvn, children: /* @__PURE__ */ jsx6(
|
|
1947
1683
|
"input",
|
|
1948
1684
|
{
|
|
1949
1685
|
id: "sk-cc-cvn",
|
|
@@ -1958,7 +1694,7 @@ function PaymentStep({
|
|
|
1958
1694
|
}
|
|
1959
1695
|
) })
|
|
1960
1696
|
] }),
|
|
1961
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsx6(CardField, { id: "sk-cc-name", label: "Name on card", error: cardErrors.name, children: /* @__PURE__ */ jsx6(
|
|
1962
1698
|
"input",
|
|
1963
1699
|
{
|
|
1964
1700
|
id: "sk-cc-name",
|
|
@@ -1970,8 +1706,8 @@ function PaymentStep({
|
|
|
1970
1706
|
onChange: (e) => setCard({ ...card, name: e.target.value })
|
|
1971
1707
|
}
|
|
1972
1708
|
) }),
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ jsxs4("p", { className: "sk-pay__secure", children: [
|
|
1710
|
+
/* @__PURE__ */ jsx6(
|
|
1975
1711
|
"svg",
|
|
1976
1712
|
{
|
|
1977
1713
|
className: "sk-pay__secure-icon",
|
|
@@ -1980,7 +1716,7 @@ function PaymentStep({
|
|
|
1980
1716
|
height: "14",
|
|
1981
1717
|
"aria-hidden": "true",
|
|
1982
1718
|
focusable: "false",
|
|
1983
|
-
children: /* @__PURE__ */
|
|
1719
|
+
children: /* @__PURE__ */ jsx6(
|
|
1984
1720
|
"path",
|
|
1985
1721
|
{
|
|
1986
1722
|
d: "M4.5 7V5a3.5 3.5 0 0 1 7 0v2M3.75 7h8.5a.75.75 0 0 1 .75.75v5.5a.75.75 0 0 1-.75.75h-8.5a.75.75 0 0 1-.75-.75v-5.5A.75.75 0 0 1 3.75 7Z",
|
|
@@ -1996,7 +1732,7 @@ function PaymentStep({
|
|
|
1996
1732
|
"Your card details go straight to BPOINT, our Australian payment gateway, and are never sent to or stored on this clinic\u2019s systems."
|
|
1997
1733
|
] })
|
|
1998
1734
|
] }),
|
|
1999
|
-
phase === "authenticating" && artifacts?.iframeUrl && /* @__PURE__ */
|
|
1735
|
+
phase === "authenticating" && artifacts?.iframeUrl && /* @__PURE__ */ jsx6(
|
|
2000
1736
|
"iframe",
|
|
2001
1737
|
{
|
|
2002
1738
|
ref: iframeRef,
|
|
@@ -2006,22 +1742,22 @@ function PaymentStep({
|
|
|
2006
1742
|
style: { width: "100%", height: "1px", visibility: "hidden", border: "none" }
|
|
2007
1743
|
}
|
|
2008
1744
|
),
|
|
2009
|
-
/* @__PURE__ */
|
|
2010
|
-
microcopy && /* @__PURE__ */
|
|
2011
|
-
phase === "init_failed" && clinicPhone && /* @__PURE__ */
|
|
1745
|
+
/* @__PURE__ */ jsx6(FlowError, { children: error2 }),
|
|
1746
|
+
microcopy && /* @__PURE__ */ jsx6("p", { className: "sk-pay__status", role: "status", "aria-live": "polite", children: microcopy }),
|
|
1747
|
+
phase === "init_failed" && clinicPhone && /* @__PURE__ */ jsxs4("p", { className: "sk-cf__body", children: [
|
|
2012
1748
|
"Still not working?",
|
|
2013
1749
|
" ",
|
|
2014
|
-
/* @__PURE__ */
|
|
1750
|
+
/* @__PURE__ */ jsxs4("a", { className: "sk-cf__link", href: `tel:${normalizeAuPhone(clinicPhone)}`, children: [
|
|
2015
1751
|
"Call the clinic on ",
|
|
2016
1752
|
clinicPhone
|
|
2017
1753
|
] })
|
|
2018
1754
|
] }),
|
|
2019
|
-
/* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ jsx6("div", { className: "sk-pay__actions", children: phase === "init_failed" ? (
|
|
2020
1756
|
// NOT `busy` — `busy` is `phase !== 'ready'`, which would render the one control
|
|
2021
1757
|
// on this screen disabled and reinstate the defect this branch exists to fix.
|
|
2022
1758
|
// NOT `holdLabel` either: no hold exists yet, so naming the amount here would
|
|
2023
1759
|
// promise something this press does not do.
|
|
2024
|
-
/* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ jsx6(
|
|
2025
1761
|
FlowButton,
|
|
2026
1762
|
{
|
|
2027
1763
|
type: "button",
|
|
@@ -2030,16 +1766,16 @@ function PaymentStep({
|
|
|
2030
1766
|
children: "Try again"
|
|
2031
1767
|
}
|
|
2032
1768
|
)
|
|
2033
|
-
) : isMock ? /* @__PURE__ */
|
|
1769
|
+
) : isMock ? /* @__PURE__ */ jsx6(FlowButton, { type: "button", variant: "primary", busy, onClick: () => void runConfirm(), children: busy ? "Securing\u2026" : `${holdLabel} & continue` }) : /* @__PURE__ */ jsx6(FlowButton, { type: "submit", form: "sk-pay-form", variant: "primary", busy, children: busy ? "Securing\u2026" : holdLabel }) })
|
|
2034
1770
|
] });
|
|
2035
1771
|
}
|
|
2036
1772
|
function PaymentOrderSummary({
|
|
2037
1773
|
serviceLabel,
|
|
2038
1774
|
feeText
|
|
2039
1775
|
}) {
|
|
2040
|
-
return /* @__PURE__ */
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
feeText && /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ jsxs4("dl", { className: "sk-pay__summary", children: [
|
|
1777
|
+
/* @__PURE__ */ jsx6("dt", { children: serviceLabel }),
|
|
1778
|
+
feeText && /* @__PURE__ */ jsx6("dd", { children: feeText })
|
|
2043
1779
|
] });
|
|
2044
1780
|
}
|
|
2045
1781
|
function CardField({
|
|
@@ -2048,15 +1784,15 @@ function CardField({
|
|
|
2048
1784
|
error: error2,
|
|
2049
1785
|
children
|
|
2050
1786
|
}) {
|
|
2051
|
-
return /* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */
|
|
1787
|
+
return /* @__PURE__ */ jsxs4("div", { className: "sk-pay__field", children: [
|
|
1788
|
+
/* @__PURE__ */ jsx6("label", { className: "sk-pay__label", htmlFor: id, children: label }),
|
|
2053
1789
|
children,
|
|
2054
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ jsx6(FlowError, { children: error2 })
|
|
2055
1791
|
] });
|
|
2056
1792
|
}
|
|
2057
1793
|
|
|
2058
1794
|
// src/certificate-funnel-steps/service-step.tsx
|
|
2059
|
-
import { jsx as
|
|
1795
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2060
1796
|
var printsPrice = (fee) => !!fee?.requiresPayment && formatFee(fee.amount) !== "";
|
|
2061
1797
|
var HOLD_NOTE = "Where a price is shown, that amount is held on your card at the payment step and charged only if what you asked for is issued.";
|
|
2062
1798
|
var DELIVERY_NOTE = {
|
|
@@ -2075,7 +1811,7 @@ function ServiceStep({
|
|
|
2075
1811
|
documentTitle
|
|
2076
1812
|
}) {
|
|
2077
1813
|
const deliveryPending = services.length > 0 && deliveryModes === null;
|
|
2078
|
-
return /* @__PURE__ */
|
|
1814
|
+
return /* @__PURE__ */ jsxs5(
|
|
2079
1815
|
FlowShell,
|
|
2080
1816
|
{
|
|
2081
1817
|
...useStepProgress("service"),
|
|
@@ -2086,14 +1822,14 @@ function ServiceStep({
|
|
|
2086
1822
|
services.length === 0 ? (
|
|
2087
1823
|
// No configured services is a CLINIC CONFIG state, not an error: say so plainly
|
|
2088
1824
|
// and give the patient the phone number rather than a spinner that never ends.
|
|
2089
|
-
/* @__PURE__ */
|
|
1825
|
+
/* @__PURE__ */ jsxs5("p", { className: "sk-cf__empty", children: [
|
|
2090
1826
|
"Online certificate requests aren\u2019t available right now.",
|
|
2091
1827
|
clinicPhone ? ` Please call the clinic on ${clinicPhone}.` : " Please call the clinic."
|
|
2092
1828
|
] })
|
|
2093
|
-
) : /* @__PURE__ */
|
|
1829
|
+
) : /* @__PURE__ */ jsx7("ul", { className: "sk-cf__services", "aria-busy": deliveryPending || void 0, children: services.map((s) => {
|
|
2094
1830
|
const note = feeRowNote(fees?.[s.key]);
|
|
2095
1831
|
const deliveryNote = deliveryModes?.[s.key] ? DELIVERY_NOTE[deliveryModes[s.key]] : "";
|
|
2096
|
-
return /* @__PURE__ */
|
|
1832
|
+
return /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsxs5(
|
|
2097
1833
|
"button",
|
|
2098
1834
|
{
|
|
2099
1835
|
type: "button",
|
|
@@ -2102,20 +1838,20 @@ function ServiceStep({
|
|
|
2102
1838
|
disabled: deliveryPending,
|
|
2103
1839
|
"data-sk-service": s.key,
|
|
2104
1840
|
children: [
|
|
2105
|
-
/* @__PURE__ */
|
|
2106
|
-
/* @__PURE__ */
|
|
2107
|
-
deliveryNote && /* @__PURE__ */
|
|
2108
|
-
note && /* @__PURE__ */
|
|
1841
|
+
/* @__PURE__ */ jsxs5("span", { className: "sk-cf__service-body", children: [
|
|
1842
|
+
/* @__PURE__ */ jsx7("span", { className: "sk-cf__service-label", children: s.label }),
|
|
1843
|
+
deliveryNote && /* @__PURE__ */ jsx7("span", { className: "sk-cf__service-delivery", children: deliveryNote }),
|
|
1844
|
+
note && /* @__PURE__ */ jsx7("span", { className: "sk-cf__service-fee", children: note })
|
|
2109
1845
|
] }),
|
|
2110
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ jsx7("span", { "aria-hidden": "true", className: "sk-cf__service-chevron", children: "\u2192" })
|
|
2111
1847
|
]
|
|
2112
1848
|
}
|
|
2113
1849
|
) }, s.key);
|
|
2114
1850
|
}) }),
|
|
2115
|
-
deliveryPending && /* @__PURE__ */
|
|
2116
|
-
services.some((s) => printsPrice(fees?.[s.key])) && /* @__PURE__ */
|
|
2117
|
-
!deliveryPending && services.some((s) => !!deliveryModes?.[s.key]) && /* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
1851
|
+
deliveryPending && /* @__PURE__ */ jsx7("p", { className: "sk-cf__services-note", role: "status", "aria-live": "polite", children: "Loading what happens next\u2026" }),
|
|
1852
|
+
services.some((s) => printsPrice(fees?.[s.key])) && /* @__PURE__ */ jsx7("p", { className: "sk-cf__services-note", children: HOLD_NOTE }),
|
|
1853
|
+
!deliveryPending && services.some((s) => !!deliveryModes?.[s.key]) && /* @__PURE__ */ jsx7("p", { className: "sk-cf__services-note", children: "We\u2019ll email you about what happens next. If a document is issued, we\u2019ll email you a secure download link." }),
|
|
1854
|
+
/* @__PURE__ */ jsx7("div", { className: "sk-cf__after", children: /* @__PURE__ */ jsx7(FlowButton, { type: "button", variant: "quiet", onClick: onNeedDifferent, children: "I need a different type of certificate" }) })
|
|
2119
1855
|
]
|
|
2120
1856
|
}
|
|
2121
1857
|
);
|
|
@@ -2123,7 +1859,7 @@ function ServiceStep({
|
|
|
2123
1859
|
|
|
2124
1860
|
// src/certificate-funnel-steps/preflight-step.tsx
|
|
2125
1861
|
import * as React7 from "react";
|
|
2126
|
-
import { Fragment as Fragment2, jsx as
|
|
1862
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2127
1863
|
var EMERGENCY = "000";
|
|
2128
1864
|
var POLICY_LINKS = { terms: "/terms", privacy: "/privacy" };
|
|
2129
1865
|
var PREFLIGHT_STATEMENTS = [
|
|
@@ -2187,7 +1923,7 @@ function PreflightStep({
|
|
|
2187
1923
|
documentTitle
|
|
2188
1924
|
}) {
|
|
2189
1925
|
const [declining, setDeclining] = React7.useState(false);
|
|
2190
|
-
return /* @__PURE__ */
|
|
1926
|
+
return /* @__PURE__ */ jsxs6(
|
|
2191
1927
|
FlowShell,
|
|
2192
1928
|
{
|
|
2193
1929
|
...useStepProgress("preflight"),
|
|
@@ -2215,8 +1951,8 @@ function PreflightStep({
|
|
|
2215
1951
|
// shared component for one step's benefit. The wording below tracks the
|
|
2216
1952
|
// visible subheading ("Please read all five…") and the primary button ("Yes —
|
|
2217
1953
|
// all five are true"), so what AT speaks matches what the screen says.
|
|
2218
|
-
/* @__PURE__ */
|
|
2219
|
-
/* @__PURE__ */
|
|
1954
|
+
/* @__PURE__ */ jsxs6("div", { className: "sk-cf__actions", role: "group", "aria-label": "Are all five statements true?", children: [
|
|
1955
|
+
/* @__PURE__ */ jsx8(
|
|
2220
1956
|
FlowButton,
|
|
2221
1957
|
{
|
|
2222
1958
|
type: "button",
|
|
@@ -2226,7 +1962,7 @@ function PreflightStep({
|
|
|
2226
1962
|
children: "Yes \u2014 all five are true"
|
|
2227
1963
|
}
|
|
2228
1964
|
),
|
|
2229
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ jsx8(
|
|
2230
1966
|
FlowButton,
|
|
2231
1967
|
{
|
|
2232
1968
|
type: "button",
|
|
@@ -2245,7 +1981,7 @@ function PreflightStep({
|
|
|
2245
1981
|
// the list gets the question as its accessible name. `aria-label` on the `<ul>`
|
|
2246
1982
|
// rather than `role="group"`: naming it keeps `role="list"`, so AT still says how
|
|
2247
1983
|
// many options there are — a count the patient wants and a group would swallow.
|
|
2248
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsx8("ul", { className: "sk-pf__declines", "aria-label": "Which one doesn\u2019t apply?", children: PREFLIGHT_DISPLAY_STATEMENTS.map((s) => /* @__PURE__ */ jsx8("li", { children: /* @__PURE__ */ jsxs6(
|
|
2249
1985
|
"button",
|
|
2250
1986
|
{
|
|
2251
1987
|
type: "button",
|
|
@@ -2253,30 +1989,30 @@ function PreflightStep({
|
|
|
2253
1989
|
onClick: () => s.exit.kind === "out-of-scope" ? onOutOfScope() : onExit(s.exit),
|
|
2254
1990
|
"data-sk-preflight-decline": s.id,
|
|
2255
1991
|
children: [
|
|
2256
|
-
/* @__PURE__ */
|
|
2257
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ jsx8("span", { className: "sk-pf__decline-label", children: s.decline }),
|
|
1993
|
+
/* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: "sk-cf__service-chevron", children: "\u2192" })
|
|
2258
1994
|
]
|
|
2259
1995
|
}
|
|
2260
1996
|
) }, s.id)) })
|
|
2261
|
-
) : /* @__PURE__ */
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
-
/* @__PURE__ */
|
|
2264
|
-
/* @__PURE__ */
|
|
2265
|
-
/* @__PURE__ */
|
|
1997
|
+
) : /* @__PURE__ */ jsx8("ol", { className: "sk-pf__statements", children: PREFLIGHT_DISPLAY_STATEMENTS.map((s, i) => /* @__PURE__ */ jsxs6("li", { className: "sk-pf__statement", children: [
|
|
1998
|
+
/* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: "sk-pf__num", children: i + 1 }),
|
|
1999
|
+
/* @__PURE__ */ jsxs6("div", { className: "sk-pf__statement-body", children: [
|
|
2000
|
+
/* @__PURE__ */ jsx8("p", { className: "sk-pf__statement-title", children: s.title }),
|
|
2001
|
+
/* @__PURE__ */ jsxs6("p", { className: "sk-pf__statement-detail", children: [
|
|
2266
2002
|
s.detail,
|
|
2267
|
-
s.id === "terms" && /* @__PURE__ */
|
|
2003
|
+
s.id === "terms" && /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
2268
2004
|
" ",
|
|
2269
|
-
/* @__PURE__ */
|
|
2005
|
+
/* @__PURE__ */ jsx8("a", { className: "sk-cf__link", href: POLICY_LINKS.terms, children: "Read the terms" }),
|
|
2270
2006
|
" ",
|
|
2271
2007
|
"and the",
|
|
2272
2008
|
" ",
|
|
2273
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsx8("a", { className: "sk-cf__link", href: POLICY_LINKS.privacy, children: "privacy policy" }),
|
|
2274
2010
|
"."
|
|
2275
2011
|
] })
|
|
2276
2012
|
] })
|
|
2277
2013
|
] })
|
|
2278
2014
|
] }, s.id)) }),
|
|
2279
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ jsxs6("a", { className: "sk-pf__emergency", href: `tel:${EMERGENCY}`, children: [
|
|
2280
2016
|
"If this is an emergency \u2014 call ",
|
|
2281
2017
|
EMERGENCY
|
|
2282
2018
|
] })
|
|
@@ -2287,7 +2023,7 @@ function PreflightStep({
|
|
|
2287
2023
|
|
|
2288
2024
|
// src/certificate-funnel-steps/identity-step.tsx
|
|
2289
2025
|
import * as React8 from "react";
|
|
2290
|
-
import { Fragment as Fragment3, jsx as
|
|
2026
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2291
2027
|
var IDENTITY_ID_PREFIX = "sk-id";
|
|
2292
2028
|
var IDENTITY_FIELDS = [
|
|
2293
2029
|
{ key: "givenName", id: `${IDENTITY_ID_PREFIX}-given`, label: "First name" },
|
|
@@ -2497,7 +2233,7 @@ function IdentityStep(props) {
|
|
|
2497
2233
|
minute: "2-digit"
|
|
2498
2234
|
}).format(new Date(props.reservationExpiresAt))}.` : "";
|
|
2499
2235
|
if (mode === "confirm-identity") {
|
|
2500
|
-
return /* @__PURE__ */
|
|
2236
|
+
return /* @__PURE__ */ jsxs7(
|
|
2501
2237
|
FlowShell,
|
|
2502
2238
|
{
|
|
2503
2239
|
...progress,
|
|
@@ -2507,7 +2243,7 @@ function IdentityStep(props) {
|
|
|
2507
2243
|
onBack,
|
|
2508
2244
|
documentTitle,
|
|
2509
2245
|
children: [
|
|
2510
|
-
prefill ? /* @__PURE__ */
|
|
2246
|
+
prefill ? /* @__PURE__ */ jsx9(
|
|
2511
2247
|
ConfirmIdentityCard,
|
|
2512
2248
|
{
|
|
2513
2249
|
prefill,
|
|
@@ -2515,14 +2251,14 @@ function IdentityStep(props) {
|
|
|
2515
2251
|
onConfirm: () => void handleConfirmSignedIn(),
|
|
2516
2252
|
onReject: onRejected
|
|
2517
2253
|
}
|
|
2518
|
-
) : /* @__PURE__ */
|
|
2519
|
-
/* @__PURE__ */
|
|
2254
|
+
) : /* @__PURE__ */ jsx9(FlowLoading, { message: "Checking your details\u2026" }),
|
|
2255
|
+
/* @__PURE__ */ jsx9(FlowError, { children: error2 })
|
|
2520
2256
|
]
|
|
2521
2257
|
}
|
|
2522
2258
|
);
|
|
2523
2259
|
}
|
|
2524
2260
|
const invalid = invalidFields(IDENTITY_FIELDS, { ...identityErrors, ...addressErrors });
|
|
2525
|
-
return /* @__PURE__ */
|
|
2261
|
+
return /* @__PURE__ */ jsx9(
|
|
2526
2262
|
FlowShell,
|
|
2527
2263
|
{
|
|
2528
2264
|
...progress,
|
|
@@ -2531,12 +2267,12 @@ function IdentityStep(props) {
|
|
|
2531
2267
|
subheading: `${detailsSubheading(props.serviceLabel)}${reservationNote}`,
|
|
2532
2268
|
onBack,
|
|
2533
2269
|
documentTitle,
|
|
2534
|
-
footer: probing ? void 0 : /* @__PURE__ */
|
|
2535
|
-
children: probing ? /* @__PURE__ */
|
|
2536
|
-
/* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
/* @__PURE__ */
|
|
2270
|
+
footer: probing ? void 0 : /* @__PURE__ */ jsx9(FlowButton, { type: "submit", form: "sk-cf-identity", variant: "primary", busy, children: busy ? "Starting\u2026" : "Continue" }),
|
|
2271
|
+
children: probing ? /* @__PURE__ */ jsx9(FlowLoading, { message: "Checking if you\u2019re signed in\u2026" }) : /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
2272
|
+
/* @__PURE__ */ jsx9(SignInRamp, { redirect: props.returnUrl, prepareRedirect: prepareSignInRedirect }),
|
|
2273
|
+
/* @__PURE__ */ jsx9(FlowErrorSummary, { fields: invalid }),
|
|
2274
|
+
/* @__PURE__ */ jsxs7("form", { id: "sk-cf-identity", onSubmit: (e) => void handleSubmitAnonymous(e), noValidate: true, children: [
|
|
2275
|
+
/* @__PURE__ */ jsx9(SummarisedFieldErrors, { children: /* @__PURE__ */ jsx9(
|
|
2540
2276
|
IdentityForm,
|
|
2541
2277
|
{
|
|
2542
2278
|
idPrefix: IDENTITY_ID_PREFIX,
|
|
@@ -2553,7 +2289,7 @@ function IdentityStep(props) {
|
|
|
2553
2289
|
disabled: busy
|
|
2554
2290
|
}
|
|
2555
2291
|
) }),
|
|
2556
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ jsx9(
|
|
2557
2293
|
TurnstileWidget,
|
|
2558
2294
|
{
|
|
2559
2295
|
siteKey: props.turnstileSiteKey,
|
|
@@ -2562,7 +2298,7 @@ function IdentityStep(props) {
|
|
|
2562
2298
|
}
|
|
2563
2299
|
)
|
|
2564
2300
|
] }),
|
|
2565
|
-
/* @__PURE__ */
|
|
2301
|
+
/* @__PURE__ */ jsx9(FlowError, { children: error2 })
|
|
2566
2302
|
] })
|
|
2567
2303
|
}
|
|
2568
2304
|
);
|
|
@@ -2573,7 +2309,7 @@ import * as React10 from "react";
|
|
|
2573
2309
|
|
|
2574
2310
|
// src/question-render.tsx
|
|
2575
2311
|
import * as React9 from "react";
|
|
2576
|
-
import { jsx as
|
|
2312
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2577
2313
|
var RENDERABLE_KINDS = [
|
|
2578
2314
|
"text",
|
|
2579
2315
|
"boolean",
|
|
@@ -2625,28 +2361,28 @@ function QuestionField({
|
|
|
2625
2361
|
const helpId = question.helpText ? `${id}-help` : void 0;
|
|
2626
2362
|
const errorId = error2 ? `${id}-error` : void 0;
|
|
2627
2363
|
const description = describedBy(helpId, errorId);
|
|
2628
|
-
const help = question.helpText ? /* @__PURE__ */
|
|
2629
|
-
const errorNode = error2 ? /* @__PURE__ */
|
|
2364
|
+
const help = question.helpText ? /* @__PURE__ */ jsx10("p", { className: "sk-q__help", id: helpId, children: question.helpText }) : null;
|
|
2365
|
+
const errorNode = error2 ? /* @__PURE__ */ jsx10("p", { className: "sk-q__error", id: errorId, children: error2 }) : null;
|
|
2630
2366
|
if (question.kind === "boolean" || question.kind === "single_select") {
|
|
2631
2367
|
const options = question.kind === "boolean" ? [
|
|
2632
2368
|
{ value: "true", label: "Yes" },
|
|
2633
2369
|
{ value: "false", label: "No" }
|
|
2634
2370
|
] : question.options ?? [];
|
|
2635
2371
|
const selected = question.kind === "boolean" ? value === true ? "true" : value === false ? "false" : "" : value == null ? "" : String(value);
|
|
2636
|
-
return /* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ jsxs8(
|
|
2637
2373
|
"fieldset",
|
|
2638
2374
|
{
|
|
2639
2375
|
className: "sk-q sk-q--choice",
|
|
2640
2376
|
"aria-describedby": description,
|
|
2641
2377
|
"aria-invalid": error2 ? true : void 0,
|
|
2642
2378
|
children: [
|
|
2643
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ jsxs8("legend", { className: hideLabel ? "sk-q__legend sk-sr-only" : "sk-q__legend", children: [
|
|
2644
2380
|
question.label,
|
|
2645
|
-
question.required && /* @__PURE__ */
|
|
2381
|
+
question.required && /* @__PURE__ */ jsx10(RequiredMark, {})
|
|
2646
2382
|
] }),
|
|
2647
2383
|
help,
|
|
2648
|
-
/* @__PURE__ */
|
|
2649
|
-
/* @__PURE__ */
|
|
2384
|
+
/* @__PURE__ */ jsx10("div", { className: "sk-q__options", children: options.map((opt) => /* @__PURE__ */ jsxs8("label", { className: "sk-q__option", children: [
|
|
2385
|
+
/* @__PURE__ */ jsx10(
|
|
2650
2386
|
"input",
|
|
2651
2387
|
{
|
|
2652
2388
|
type: "radio",
|
|
@@ -2659,7 +2395,7 @@ function QuestionField({
|
|
|
2659
2395
|
)
|
|
2660
2396
|
}
|
|
2661
2397
|
),
|
|
2662
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ jsx10("span", { children: opt.label })
|
|
2663
2399
|
] }, opt.value)) }),
|
|
2664
2400
|
errorNode
|
|
2665
2401
|
]
|
|
@@ -2675,7 +2411,7 @@ function QuestionField({
|
|
|
2675
2411
|
className: "sk-q__input"
|
|
2676
2412
|
};
|
|
2677
2413
|
if (question.kind === "date_recent" || question.kind === "date_range") {
|
|
2678
|
-
return /* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ jsx10(
|
|
2679
2415
|
QuickDateField,
|
|
2680
2416
|
{
|
|
2681
2417
|
question,
|
|
@@ -2691,13 +2427,13 @@ function QuestionField({
|
|
|
2691
2427
|
}
|
|
2692
2428
|
);
|
|
2693
2429
|
}
|
|
2694
|
-
return /* @__PURE__ */
|
|
2695
|
-
/* @__PURE__ */
|
|
2430
|
+
return /* @__PURE__ */ jsxs8("div", { className: "sk-q", children: [
|
|
2431
|
+
/* @__PURE__ */ jsxs8("label", { className: hideLabel ? "sk-q__label sk-sr-only" : "sk-q__label", htmlFor: id, children: [
|
|
2696
2432
|
question.label,
|
|
2697
|
-
question.required && /* @__PURE__ */
|
|
2433
|
+
question.required && /* @__PURE__ */ jsx10(RequiredMark, {})
|
|
2698
2434
|
] }),
|
|
2699
2435
|
help,
|
|
2700
|
-
question.kind === "number" ? /* @__PURE__ */
|
|
2436
|
+
question.kind === "number" ? /* @__PURE__ */ jsx10(
|
|
2701
2437
|
"input",
|
|
2702
2438
|
{
|
|
2703
2439
|
...common,
|
|
@@ -2709,7 +2445,7 @@ function QuestionField({
|
|
|
2709
2445
|
onChange(raw === "" ? null : Number(raw));
|
|
2710
2446
|
}
|
|
2711
2447
|
}
|
|
2712
|
-
) : question.kind === "date" ? /* @__PURE__ */
|
|
2448
|
+
) : question.kind === "date" ? /* @__PURE__ */ jsx10(
|
|
2713
2449
|
"input",
|
|
2714
2450
|
{
|
|
2715
2451
|
...common,
|
|
@@ -2718,7 +2454,7 @@ function QuestionField({
|
|
|
2718
2454
|
value: value == null ? "" : String(value),
|
|
2719
2455
|
onChange: (e) => onChange(e.target.value || null)
|
|
2720
2456
|
}
|
|
2721
|
-
) : /* @__PURE__ */
|
|
2457
|
+
) : /* @__PURE__ */ jsx10(
|
|
2722
2458
|
"input",
|
|
2723
2459
|
{
|
|
2724
2460
|
...common,
|
|
@@ -2768,9 +2504,9 @@ function QuickDateField({
|
|
|
2768
2504
|
pressed: !!today && from === shiftIso(today, -p.daysAgo),
|
|
2769
2505
|
apply: () => emit(shiftIso(todayIso(), -p.daysAgo), "")
|
|
2770
2506
|
}));
|
|
2771
|
-
const dateInput = (which, inputId, label, val, onPick) => /* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2507
|
+
const dateInput = (which, inputId, label, val, onPick) => /* @__PURE__ */ jsxs8("div", { className: "sk-qd__field", children: [
|
|
2508
|
+
/* @__PURE__ */ jsx10("label", { className: "sk-qd__sublabel", htmlFor: inputId, children: label }),
|
|
2509
|
+
/* @__PURE__ */ jsx10(
|
|
2774
2510
|
"input",
|
|
2775
2511
|
{
|
|
2776
2512
|
id: inputId,
|
|
@@ -2784,13 +2520,13 @@ function QuickDateField({
|
|
|
2784
2520
|
}
|
|
2785
2521
|
)
|
|
2786
2522
|
] }, which);
|
|
2787
|
-
return /* @__PURE__ */
|
|
2788
|
-
/* @__PURE__ */
|
|
2523
|
+
return /* @__PURE__ */ jsxs8("fieldset", { className: "sk-q sk-qd", "aria-describedby": description, children: [
|
|
2524
|
+
/* @__PURE__ */ jsxs8("legend", { className: hideLabel ? "sk-q__label sk-sr-only" : "sk-q__label", children: [
|
|
2789
2525
|
question.label,
|
|
2790
|
-
question.required && /* @__PURE__ */
|
|
2526
|
+
question.required && /* @__PURE__ */ jsx10(RequiredMark, {})
|
|
2791
2527
|
] }),
|
|
2792
2528
|
help,
|
|
2793
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ jsx10("div", { className: "sk-qd__chips", children: chips.map((c) => /* @__PURE__ */ jsx10(
|
|
2794
2530
|
"button",
|
|
2795
2531
|
{
|
|
2796
2532
|
type: "button",
|
|
@@ -2802,7 +2538,7 @@ function QuickDateField({
|
|
|
2802
2538
|
},
|
|
2803
2539
|
c.label
|
|
2804
2540
|
)) }),
|
|
2805
|
-
/* @__PURE__ */
|
|
2541
|
+
/* @__PURE__ */ jsx10("div", { className: "sk-qd__fields", children: isRange ? [
|
|
2806
2542
|
dateInput("from", `${id}-from`, "First day", from, (next) => emit(next, to)),
|
|
2807
2543
|
dateInput("to", `${id}-to`, "Last day", to, (next) => emit(from, next))
|
|
2808
2544
|
] : dateInput("single", id, "Or pick a date", from, (next) => emit(next, "")) }),
|
|
@@ -2815,14 +2551,14 @@ function parseRangeValue(raw) {
|
|
|
2815
2551
|
return { from, to };
|
|
2816
2552
|
}
|
|
2817
2553
|
function RequiredMark() {
|
|
2818
|
-
return /* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */
|
|
2554
|
+
return /* @__PURE__ */ jsxs8("span", { className: "sk-q__required", children: [
|
|
2555
|
+
/* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: " *" }),
|
|
2556
|
+
/* @__PURE__ */ jsx10("span", { className: "sk-sr-only", children: " (required)" })
|
|
2821
2557
|
] });
|
|
2822
2558
|
}
|
|
2823
2559
|
|
|
2824
2560
|
// src/certificate-funnel-steps/intake-step.tsx
|
|
2825
|
-
import { jsx as
|
|
2561
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2826
2562
|
var INTAKE_UNAVAILABLE = "We can\u2019t show this clinic\u2019s questions on this page. Please contact the clinic to finish your request.";
|
|
2827
2563
|
function IntakeInterstitial({
|
|
2828
2564
|
progress,
|
|
@@ -2832,7 +2568,7 @@ function IntakeInterstitial({
|
|
|
2832
2568
|
onRetry,
|
|
2833
2569
|
message
|
|
2834
2570
|
}) {
|
|
2835
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsx11(
|
|
2836
2572
|
FlowShell,
|
|
2837
2573
|
{
|
|
2838
2574
|
...progress,
|
|
@@ -2843,9 +2579,9 @@ function IntakeInterstitial({
|
|
|
2843
2579
|
footer: error2 && onRetry ? (
|
|
2844
2580
|
// `primary`, not `secondary`: retry is the only action on this screen, which is
|
|
2845
2581
|
// exactly what the accent is for.
|
|
2846
|
-
/* @__PURE__ */
|
|
2582
|
+
/* @__PURE__ */ jsx11(FlowButton, { type: "button", variant: "primary", onClick: onRetry, children: "Try again" })
|
|
2847
2583
|
) : void 0,
|
|
2848
|
-
children: error2 ? /* @__PURE__ */
|
|
2584
|
+
children: error2 ? /* @__PURE__ */ jsx11(FlowError, { children: error2 }) : /* @__PURE__ */ jsx11(FlowLoading, { message })
|
|
2849
2585
|
}
|
|
2850
2586
|
);
|
|
2851
2587
|
}
|
|
@@ -3046,7 +2782,7 @@ function IntakeStep({
|
|
|
3046
2782
|
onBack?.();
|
|
3047
2783
|
}
|
|
3048
2784
|
if (error2 && !questions) {
|
|
3049
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ jsx11(
|
|
3050
2786
|
IntakeInterstitial,
|
|
3051
2787
|
{
|
|
3052
2788
|
progress,
|
|
@@ -3061,7 +2797,7 @@ function IntakeStep({
|
|
|
3061
2797
|
);
|
|
3062
2798
|
}
|
|
3063
2799
|
if (!questions) {
|
|
3064
|
-
return /* @__PURE__ */
|
|
2800
|
+
return /* @__PURE__ */ jsx11(
|
|
3065
2801
|
IntakeInterstitial,
|
|
3066
2802
|
{
|
|
3067
2803
|
progress,
|
|
@@ -3073,7 +2809,7 @@ function IntakeStep({
|
|
|
3073
2809
|
);
|
|
3074
2810
|
}
|
|
3075
2811
|
if (questions.length === 0) {
|
|
3076
|
-
return /* @__PURE__ */
|
|
2812
|
+
return /* @__PURE__ */ jsx11(
|
|
3077
2813
|
IntakeInterstitial,
|
|
3078
2814
|
{
|
|
3079
2815
|
progress,
|
|
@@ -3090,7 +2826,7 @@ function IntakeStep({
|
|
|
3090
2826
|
);
|
|
3091
2827
|
}
|
|
3092
2828
|
if (!current) {
|
|
3093
|
-
return /* @__PURE__ */
|
|
2829
|
+
return /* @__PURE__ */ jsx11(
|
|
3094
2830
|
IntakeInterstitial,
|
|
3095
2831
|
{
|
|
3096
2832
|
progress,
|
|
@@ -3102,7 +2838,7 @@ function IntakeStep({
|
|
|
3102
2838
|
}
|
|
3103
2839
|
const isChoice = current.kind === "boolean" || current.kind === "single_select";
|
|
3104
2840
|
const canSubmitTyped = draft !== null && draft !== "";
|
|
3105
|
-
return /* @__PURE__ */
|
|
2841
|
+
return /* @__PURE__ */ jsxs9(
|
|
3106
2842
|
FlowShell,
|
|
3107
2843
|
{
|
|
3108
2844
|
...progress,
|
|
@@ -3110,7 +2846,7 @@ function IntakeStep({
|
|
|
3110
2846
|
heading: current.label,
|
|
3111
2847
|
onBack: goBack,
|
|
3112
2848
|
documentTitle,
|
|
3113
|
-
footer: isChoice ? void 0 : /* @__PURE__ */
|
|
2849
|
+
footer: isChoice ? void 0 : /* @__PURE__ */ jsx11(
|
|
3114
2850
|
FlowButton,
|
|
3115
2851
|
{
|
|
3116
2852
|
type: "button",
|
|
@@ -3122,7 +2858,7 @@ function IntakeStep({
|
|
|
3122
2858
|
}
|
|
3123
2859
|
),
|
|
3124
2860
|
children: [
|
|
3125
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ jsx11(
|
|
3126
2862
|
QuestionField,
|
|
3127
2863
|
{
|
|
3128
2864
|
question: current,
|
|
@@ -3136,8 +2872,8 @@ function IntakeStep({
|
|
|
3136
2872
|
idPrefix: `sk-cf-${index}`
|
|
3137
2873
|
}
|
|
3138
2874
|
),
|
|
3139
|
-
/* @__PURE__ */
|
|
3140
|
-
error2 && pendingCompletionRevision.current != null && /* @__PURE__ */
|
|
2875
|
+
/* @__PURE__ */ jsx11(FlowError, { children: error2 }),
|
|
2876
|
+
error2 && pendingCompletionRevision.current != null && /* @__PURE__ */ jsx11(
|
|
3141
2877
|
FlowButton,
|
|
3142
2878
|
{
|
|
3143
2879
|
type: "button",
|
|
@@ -3199,7 +2935,7 @@ function printedExpiry(month, year) {
|
|
|
3199
2935
|
}
|
|
3200
2936
|
|
|
3201
2937
|
// src/certificate-funnel-steps/medicare-step.tsx
|
|
3202
|
-
import { jsx as
|
|
2938
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3203
2939
|
var MEDICARE_FIELDS = [
|
|
3204
2940
|
{ key: "number", id: "sk-mc-number", label: "Medicare number" },
|
|
3205
2941
|
{ key: "irn", id: "sk-mc-irn", label: "Reference number" },
|
|
@@ -3289,7 +3025,7 @@ function MedicareStep(props) {
|
|
|
3289
3025
|
}
|
|
3290
3026
|
}
|
|
3291
3027
|
const invalid = invalidFields(MEDICARE_FIELDS, errors2);
|
|
3292
|
-
return /* @__PURE__ */
|
|
3028
|
+
return /* @__PURE__ */ jsxs10(
|
|
3293
3029
|
FlowShell,
|
|
3294
3030
|
{
|
|
3295
3031
|
...useStepProgress("medicare"),
|
|
@@ -3298,9 +3034,9 @@ function MedicareStep(props) {
|
|
|
3298
3034
|
subheading: "Optional. If you add these details, the clinic can see them with your request. Leaving them out won\u2019t hold it up.",
|
|
3299
3035
|
onBack,
|
|
3300
3036
|
documentTitle,
|
|
3301
|
-
footer: /* @__PURE__ */
|
|
3302
|
-
/* @__PURE__ */
|
|
3303
|
-
/* @__PURE__ */
|
|
3037
|
+
footer: /* @__PURE__ */ jsxs10("div", { className: "sk-cf__actions", children: [
|
|
3038
|
+
/* @__PURE__ */ jsx12(FlowButton, { type: "submit", form: "sk-cf-medicare", variant: "primary", busy, children: busy ? "Saving\u2026" : "Continue" }),
|
|
3039
|
+
/* @__PURE__ */ jsx12(
|
|
3304
3040
|
FlowButton,
|
|
3305
3041
|
{
|
|
3306
3042
|
type: "button",
|
|
@@ -3312,11 +3048,11 @@ function MedicareStep(props) {
|
|
|
3312
3048
|
)
|
|
3313
3049
|
] }),
|
|
3314
3050
|
children: [
|
|
3315
|
-
/* @__PURE__ */
|
|
3316
|
-
/* @__PURE__ */
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3319
|
-
/* @__PURE__ */
|
|
3051
|
+
/* @__PURE__ */ jsx12(FlowErrorSummary, { fields: invalid }),
|
|
3052
|
+
/* @__PURE__ */ jsxs10("form", { id: "sk-cf-medicare", onSubmit: (e) => void handleSubmit(e), noValidate: true, children: [
|
|
3053
|
+
/* @__PURE__ */ jsxs10("div", { className: "sk-cf__field", children: [
|
|
3054
|
+
/* @__PURE__ */ jsx12("label", { className: "sk-cf__label", htmlFor: "sk-mc-number", children: "Medicare number" }),
|
|
3055
|
+
/* @__PURE__ */ jsx12(
|
|
3320
3056
|
"input",
|
|
3321
3057
|
{
|
|
3322
3058
|
id: "sk-mc-number",
|
|
@@ -3330,12 +3066,12 @@ function MedicareStep(props) {
|
|
|
3330
3066
|
onChange: (e) => setNumber(formatMedicareNumber(e.target.value))
|
|
3331
3067
|
}
|
|
3332
3068
|
),
|
|
3333
|
-
/* @__PURE__ */
|
|
3069
|
+
/* @__PURE__ */ jsx12(FlowFieldError, { id: "sk-mc-number-error", children: errors2.number })
|
|
3334
3070
|
] }),
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
3338
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ jsxs10("div", { className: "sk-cf__row", children: [
|
|
3072
|
+
/* @__PURE__ */ jsxs10("div", { className: "sk-cf__field", children: [
|
|
3073
|
+
/* @__PURE__ */ jsx12("label", { className: "sk-cf__label", htmlFor: "sk-mc-irn", children: "Reference number" }),
|
|
3074
|
+
/* @__PURE__ */ jsx12(
|
|
3339
3075
|
"input",
|
|
3340
3076
|
{
|
|
3341
3077
|
id: "sk-mc-irn",
|
|
@@ -3349,14 +3085,14 @@ function MedicareStep(props) {
|
|
|
3349
3085
|
onChange: (e) => setIrn(e.target.value.replace(/\D/g, "").slice(0, 1))
|
|
3350
3086
|
}
|
|
3351
3087
|
),
|
|
3352
|
-
/* @__PURE__ */
|
|
3353
|
-
/* @__PURE__ */
|
|
3088
|
+
/* @__PURE__ */ jsx12("p", { className: "sk-cf__help", id: "sk-mc-irn-help", children: "The digit beside your name on the card." }),
|
|
3089
|
+
/* @__PURE__ */ jsx12(FlowFieldError, { id: "sk-mc-irn-error", children: errors2.irn })
|
|
3354
3090
|
] }),
|
|
3355
|
-
/* @__PURE__ */
|
|
3356
|
-
/* @__PURE__ */
|
|
3357
|
-
/* @__PURE__ */
|
|
3358
|
-
/* @__PURE__ */
|
|
3359
|
-
/* @__PURE__ */
|
|
3091
|
+
/* @__PURE__ */ jsxs10("div", { className: "sk-cf__field", children: [
|
|
3092
|
+
/* @__PURE__ */ jsxs10("fieldset", { className: "sk-cf__expiry", children: [
|
|
3093
|
+
/* @__PURE__ */ jsx12("legend", { className: "sk-cf__label", children: "Expiry" }),
|
|
3094
|
+
/* @__PURE__ */ jsx12("label", { className: "sk-sr-only", htmlFor: "sk-mc-month", children: "Expiry month" }),
|
|
3095
|
+
/* @__PURE__ */ jsx12(
|
|
3360
3096
|
"input",
|
|
3361
3097
|
{
|
|
3362
3098
|
id: "sk-mc-month",
|
|
@@ -3371,8 +3107,8 @@ function MedicareStep(props) {
|
|
|
3371
3107
|
onChange: (e) => setMonth(e.target.value.replace(/\D/g, "").slice(0, 2))
|
|
3372
3108
|
}
|
|
3373
3109
|
),
|
|
3374
|
-
/* @__PURE__ */
|
|
3375
|
-
/* @__PURE__ */
|
|
3110
|
+
/* @__PURE__ */ jsx12("label", { className: "sk-sr-only", htmlFor: "sk-mc-year", children: "Expiry year" }),
|
|
3111
|
+
/* @__PURE__ */ jsx12(
|
|
3376
3112
|
"input",
|
|
3377
3113
|
{
|
|
3378
3114
|
id: "sk-mc-year",
|
|
@@ -3388,11 +3124,11 @@ function MedicareStep(props) {
|
|
|
3388
3124
|
}
|
|
3389
3125
|
)
|
|
3390
3126
|
] }),
|
|
3391
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx12(FlowFieldError, { id: "sk-mc-expiry-error", children: errors2.expiry })
|
|
3392
3128
|
] })
|
|
3393
3129
|
] })
|
|
3394
3130
|
] }),
|
|
3395
|
-
/* @__PURE__ */
|
|
3131
|
+
/* @__PURE__ */ jsx12(FlowError, { children: error2 })
|
|
3396
3132
|
]
|
|
3397
3133
|
}
|
|
3398
3134
|
);
|
|
@@ -3443,7 +3179,7 @@ var CONSENT_SUMMARY_FREE = [
|
|
|
3443
3179
|
];
|
|
3444
3180
|
|
|
3445
3181
|
// src/certificate-funnel-steps/consent-step.tsx
|
|
3446
|
-
import { Fragment as Fragment4, jsx as
|
|
3182
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3447
3183
|
function confirmDetails(input) {
|
|
3448
3184
|
const text2 = (v) => typeof v === "string" ? v : "";
|
|
3449
3185
|
const phone = text2(input.phone);
|
|
@@ -3556,7 +3292,7 @@ function ConsentStep({
|
|
|
3556
3292
|
setError(errorMessage(err, "We could not submit your request. Please try again."));
|
|
3557
3293
|
}
|
|
3558
3294
|
}
|
|
3559
|
-
return /* @__PURE__ */
|
|
3295
|
+
return /* @__PURE__ */ jsx13(
|
|
3560
3296
|
FlowShell,
|
|
3561
3297
|
{
|
|
3562
3298
|
...useStepProgress("consent"),
|
|
@@ -3569,7 +3305,7 @@ function ConsentStep({
|
|
|
3569
3305
|
),
|
|
3570
3306
|
onBack,
|
|
3571
3307
|
documentTitle,
|
|
3572
|
-
footer: feeUnknown ? void 0 : /* @__PURE__ */
|
|
3308
|
+
footer: feeUnknown ? void 0 : /* @__PURE__ */ jsx13(
|
|
3573
3309
|
FlowButton,
|
|
3574
3310
|
{
|
|
3575
3311
|
type: "submit",
|
|
@@ -3582,14 +3318,14 @@ function ConsentStep({
|
|
|
3582
3318
|
),
|
|
3583
3319
|
children: feeUnknown ? (
|
|
3584
3320
|
// No consent is offered until the fee is resolved — see `feeUnknown`.
|
|
3585
|
-
/* @__PURE__ */
|
|
3586
|
-
) : /* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */
|
|
3588
|
-
/* @__PURE__ */
|
|
3589
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ jsx13(FlowLoading, { message: "Confirming the fee\u2026" })
|
|
3322
|
+
) : /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3323
|
+
/* @__PURE__ */ jsx13("dl", { className: "sk-cf__review", children: details.map((d) => /* @__PURE__ */ jsxs11("div", { className: "sk-cf__review-row", children: [
|
|
3324
|
+
/* @__PURE__ */ jsx13("dt", { className: "sk-cf__review-label", children: d.label }),
|
|
3325
|
+
/* @__PURE__ */ jsx13("dd", { className: "sk-cf__review-value", children: d.value })
|
|
3590
3326
|
] }, d.label)) }),
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
/* @__PURE__ */
|
|
3327
|
+
/* @__PURE__ */ jsx13("ul", { className: "sk-cf__consent-summary", children: summary.map((point) => /* @__PURE__ */ jsx13("li", { children: point }, point)) }),
|
|
3328
|
+
/* @__PURE__ */ jsx13(
|
|
3593
3329
|
"button",
|
|
3594
3330
|
{
|
|
3595
3331
|
type: "button",
|
|
@@ -3600,18 +3336,18 @@ function ConsentStep({
|
|
|
3600
3336
|
children: showFull ? "Hide full text" : "Read the full text"
|
|
3601
3337
|
}
|
|
3602
3338
|
),
|
|
3603
|
-
/* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3339
|
+
/* @__PURE__ */ jsx13("div", { id: "sk-cf-consent-full", className: "sk-cf__consent-full", hidden: !showFull, children: paragraphs.map((p) => /* @__PURE__ */ jsx13("p", { children: p }, p)) }),
|
|
3340
|
+
/* @__PURE__ */ jsx13("form", { id: "sk-cf-consent", onSubmit: (e) => void handleSubmit(e), className: "sk-cf__consent-form", children: /* @__PURE__ */ jsxs11("p", { className: "sk-cf__agree-note", children: [
|
|
3605
3341
|
"Confirming agrees to the above, the",
|
|
3606
3342
|
" ",
|
|
3607
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ jsx13("a", { className: "sk-cf__link", href: POLICY_LINKS.terms, children: "terms" }),
|
|
3608
3344
|
" ",
|
|
3609
3345
|
"and the",
|
|
3610
3346
|
" ",
|
|
3611
|
-
/* @__PURE__ */
|
|
3347
|
+
/* @__PURE__ */ jsx13("a", { className: "sk-cf__link", href: POLICY_LINKS.privacy, children: "privacy policy" }),
|
|
3612
3348
|
"."
|
|
3613
3349
|
] }) }),
|
|
3614
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ jsx13(FlowError, { children: error2 })
|
|
3615
3351
|
] })
|
|
3616
3352
|
}
|
|
3617
3353
|
);
|
|
@@ -3619,7 +3355,7 @@ function ConsentStep({
|
|
|
3619
3355
|
|
|
3620
3356
|
// src/certificate-funnel-steps/slot-step.tsx
|
|
3621
3357
|
import * as React13 from "react";
|
|
3622
|
-
import { jsx as
|
|
3358
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3623
3359
|
function formatBookedFor(iso, tz) {
|
|
3624
3360
|
const day = new Intl.DateTimeFormat("en-AU", {
|
|
3625
3361
|
timeZone: tz,
|
|
@@ -3638,16 +3374,16 @@ function SlotCancelControl({
|
|
|
3638
3374
|
onKeep,
|
|
3639
3375
|
onConfirm
|
|
3640
3376
|
}) {
|
|
3641
|
-
return /* @__PURE__ */
|
|
3377
|
+
return /* @__PURE__ */ jsxs12(
|
|
3642
3378
|
"div",
|
|
3643
3379
|
{
|
|
3644
3380
|
className: "sk-cf__after sk-cf__cancel",
|
|
3645
3381
|
role: confirming ? "group" : void 0,
|
|
3646
3382
|
"aria-label": confirming ? "Confirm cancellation" : void 0,
|
|
3647
3383
|
children: [
|
|
3648
|
-
confirming && /* @__PURE__ */
|
|
3649
|
-
/* @__PURE__ */
|
|
3650
|
-
confirming && /* @__PURE__ */
|
|
3384
|
+
confirming && /* @__PURE__ */ jsx14("p", { className: "sk-cf__body", role: "status", "aria-live": "polite", children: "Cancel this request? You\u2019ll need to start again if you change your mind." }),
|
|
3385
|
+
/* @__PURE__ */ jsx14(FlowButton, { type: "button", variant: "quiet", onClick: confirming ? onKeep : onAsk, children: confirming ? "Keep my request" : isFree === false ? "Cancel and release the hold" : "Cancel this request" }),
|
|
3386
|
+
confirming && /* @__PURE__ */ jsx14(FlowButton, { type: "button", variant: "secondary", busy, onClick: onConfirm, children: busy ? "Cancelling\u2026" : "Yes, cancel this request" })
|
|
3651
3387
|
]
|
|
3652
3388
|
}
|
|
3653
3389
|
);
|
|
@@ -3687,7 +3423,7 @@ function SlotStep({
|
|
|
3687
3423
|
);
|
|
3688
3424
|
}
|
|
3689
3425
|
}
|
|
3690
|
-
return /* @__PURE__ */
|
|
3426
|
+
return /* @__PURE__ */ jsxs12(
|
|
3691
3427
|
FlowShell,
|
|
3692
3428
|
{
|
|
3693
3429
|
...progress,
|
|
@@ -3696,7 +3432,7 @@ function SlotStep({
|
|
|
3696
3432
|
subheading: isFree === true ? "A practitioner will call you in the time you choose. This consult is bulk billed \u2014 there\u2019s nothing to pay." : "A practitioner will call you in the time you choose.",
|
|
3697
3433
|
documentTitle,
|
|
3698
3434
|
children: [
|
|
3699
|
-
/* @__PURE__ */
|
|
3435
|
+
/* @__PURE__ */ jsx14(
|
|
3700
3436
|
SlotPicker,
|
|
3701
3437
|
{
|
|
3702
3438
|
client,
|
|
@@ -3734,26 +3470,26 @@ function SlotStep({
|
|
|
3734
3470
|
}
|
|
3735
3471
|
}
|
|
3736
3472
|
),
|
|
3737
|
-
/* @__PURE__ */
|
|
3473
|
+
/* @__PURE__ */ jsxs12("div", { className: "sk-cf__after", children: [
|
|
3738
3474
|
clinicPhone && // "a time that suits", not "any of these times": this block renders while the
|
|
3739
3475
|
// grid is still loading, when the load failed and when the diary is empty, and
|
|
3740
3476
|
// "these times" would be pointing at nothing.
|
|
3741
|
-
/* @__PURE__ */
|
|
3477
|
+
/* @__PURE__ */ jsxs12("p", { className: "sk-slots__empty-note", children: [
|
|
3742
3478
|
"Can\u2019t find a time that suits?",
|
|
3743
3479
|
" ",
|
|
3744
|
-
/* @__PURE__ */
|
|
3480
|
+
/* @__PURE__ */ jsxs12("a", { className: "sk-cf__link", href: `tel:${normalizeAuPhone(clinicPhone)}`, children: [
|
|
3745
3481
|
"Call the clinic on ",
|
|
3746
3482
|
clinicPhone
|
|
3747
3483
|
] })
|
|
3748
3484
|
] }),
|
|
3749
|
-
isFree === false && !applicationRunId && /* @__PURE__ */
|
|
3485
|
+
isFree === false && !applicationRunId && /* @__PURE__ */ jsxs12("p", { className: "sk-slots__empty-note", children: [
|
|
3750
3486
|
"You haven\u2019t been charged \u2014 only a hold was placed on your card.",
|
|
3751
3487
|
" ",
|
|
3752
3488
|
HOLD_RELEASE_NOTE
|
|
3753
3489
|
] }),
|
|
3754
|
-
applicationRunId && /* @__PURE__ */
|
|
3490
|
+
applicationRunId && /* @__PURE__ */ jsx14("p", { className: "sk-slots__empty-note", children: "We\u2019ll reserve this time for 10 minutes while you confirm your details and payment." })
|
|
3755
3491
|
] }),
|
|
3756
|
-
/* @__PURE__ */
|
|
3492
|
+
/* @__PURE__ */ jsx14(
|
|
3757
3493
|
SlotCancelControl,
|
|
3758
3494
|
{
|
|
3759
3495
|
confirming: confirmCancel,
|
|
@@ -3764,7 +3500,7 @@ function SlotStep({
|
|
|
3764
3500
|
onConfirm: () => void releaseAndExit()
|
|
3765
3501
|
}
|
|
3766
3502
|
),
|
|
3767
|
-
/* @__PURE__ */
|
|
3503
|
+
/* @__PURE__ */ jsx14(FlowError, { children: cancelError })
|
|
3768
3504
|
]
|
|
3769
3505
|
}
|
|
3770
3506
|
);
|
|
@@ -3772,7 +3508,7 @@ function SlotStep({
|
|
|
3772
3508
|
|
|
3773
3509
|
// src/certificate-funnel-steps/submitted-step.tsx
|
|
3774
3510
|
import * as React14 from "react";
|
|
3775
|
-
import { Fragment as Fragment5, jsx as
|
|
3511
|
+
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3776
3512
|
var CLOSED = /* @__PURE__ */ new Set(["cancelled", "blocked", "payment_failed"]);
|
|
3777
3513
|
var CANCELLABLE = /* @__PURE__ */ new Set(["draft", "payment_failed", "ready"]);
|
|
3778
3514
|
function terminalCopy(row, bookedFor, deliveryMode) {
|
|
@@ -3929,26 +3665,26 @@ function SubmittedStep({
|
|
|
3929
3665
|
}
|
|
3930
3666
|
}
|
|
3931
3667
|
if (noSession) {
|
|
3932
|
-
return /* @__PURE__ */
|
|
3668
|
+
return /* @__PURE__ */ jsxs13(
|
|
3933
3669
|
FlowShell,
|
|
3934
3670
|
{
|
|
3935
3671
|
stepKey: "submitted-session-lost",
|
|
3936
3672
|
heading: "Your request is in progress",
|
|
3937
3673
|
documentTitle,
|
|
3938
3674
|
children: [
|
|
3939
|
-
/* @__PURE__ */
|
|
3675
|
+
/* @__PURE__ */ jsxs13("p", { className: "sk-cf__body", children: [
|
|
3940
3676
|
"We\u2019ve emailed you about your request.",
|
|
3941
3677
|
portalUrl ? " You can also manage it in the patient portal." : ""
|
|
3942
3678
|
] }),
|
|
3943
|
-
/* @__PURE__ */
|
|
3944
|
-
/* @__PURE__ */
|
|
3945
|
-
!portalUrl && clinicPhone && /* @__PURE__ */
|
|
3679
|
+
/* @__PURE__ */ jsx15(EmailDestination, { promisesEmail: true, email }),
|
|
3680
|
+
/* @__PURE__ */ jsx15(PortalLink, { portalUrl }),
|
|
3681
|
+
!portalUrl && clinicPhone && /* @__PURE__ */ jsx15(ClinicPhone, { clinicPhone })
|
|
3946
3682
|
]
|
|
3947
3683
|
}
|
|
3948
3684
|
);
|
|
3949
3685
|
}
|
|
3950
3686
|
if (unreachable) {
|
|
3951
|
-
return /* @__PURE__ */
|
|
3687
|
+
return /* @__PURE__ */ jsx15(
|
|
3952
3688
|
SubmittedUnreachable,
|
|
3953
3689
|
{
|
|
3954
3690
|
documentTitle,
|
|
@@ -3959,25 +3695,25 @@ function SubmittedStep({
|
|
|
3959
3695
|
}
|
|
3960
3696
|
const status = row?.status;
|
|
3961
3697
|
const copy = terminalCopy(row, bookedFor, deliveryMode);
|
|
3962
|
-
return /* @__PURE__ */
|
|
3698
|
+
return /* @__PURE__ */ jsx15(
|
|
3963
3699
|
FlowShell,
|
|
3964
3700
|
{
|
|
3965
3701
|
stepKey: "submitted-status",
|
|
3966
3702
|
heading: copy.heading,
|
|
3967
3703
|
documentTitle,
|
|
3968
|
-
footer: portalUrl ? /* @__PURE__ */
|
|
3969
|
-
children: row === void 0 ? /* @__PURE__ */
|
|
3970
|
-
/* @__PURE__ */
|
|
3971
|
-
copy.booked && bookedFor && /* @__PURE__ */
|
|
3972
|
-
/* @__PURE__ */
|
|
3973
|
-
/* @__PURE__ */
|
|
3704
|
+
footer: portalUrl ? /* @__PURE__ */ jsx15("a", { className: "sk-flow__btn sk-flow__btn--primary", href: portalUrl, children: "Track this in the patient portal" }) : /* @__PURE__ */ jsx15(FlowButton, { type: "button", variant: "quiet", onClick: onRestart, children: "Make another request" }),
|
|
3705
|
+
children: row === void 0 ? /* @__PURE__ */ jsx15(FlowLoading, { message: "Loading your request\u2026" }) : /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
3706
|
+
/* @__PURE__ */ jsx15("p", { className: "sk-cf__body", children: copy.body }),
|
|
3707
|
+
copy.booked && bookedFor && /* @__PURE__ */ jsxs13("p", { className: "sk-cf__booked", children: [
|
|
3708
|
+
/* @__PURE__ */ jsx15("span", { className: "sk-cf__booked-label", children: "Your appointment" }),
|
|
3709
|
+
/* @__PURE__ */ jsx15("span", { className: "sk-cf__booked-when", children: bookedFor })
|
|
3974
3710
|
] }),
|
|
3975
|
-
/* @__PURE__ */
|
|
3976
|
-
/* @__PURE__ */
|
|
3977
|
-
notice && /* @__PURE__ */
|
|
3978
|
-
/* @__PURE__ */
|
|
3979
|
-
portalUrl && /* @__PURE__ */
|
|
3980
|
-
status && CANCELLABLE.has(status) && !notice && /* @__PURE__ */
|
|
3711
|
+
/* @__PURE__ */ jsx15(CallDestination, { booked: copy.booked, phone: patientPhone }),
|
|
3712
|
+
/* @__PURE__ */ jsx15(EmailDestination, { promisesEmail: copy.promisesEmail, email }),
|
|
3713
|
+
notice && /* @__PURE__ */ jsx15("p", { className: "sk-cf__notice", role: "status", "aria-live": "polite", children: notice }),
|
|
3714
|
+
/* @__PURE__ */ jsx15(FlowError, { children: error2 }),
|
|
3715
|
+
portalUrl && /* @__PURE__ */ jsx15("div", { className: "sk-cf__after", children: /* @__PURE__ */ jsx15(FlowButton, { type: "button", variant: "quiet", onClick: onRestart, children: "Make another request" }) }),
|
|
3716
|
+
status && CANCELLABLE.has(status) && !notice && /* @__PURE__ */ jsx15(
|
|
3981
3717
|
CancelControl,
|
|
3982
3718
|
{
|
|
3983
3719
|
confirming: confirmCancel,
|
|
@@ -4004,16 +3740,16 @@ function SubmittedUnreachable({
|
|
|
4004
3740
|
portalUrl,
|
|
4005
3741
|
clinicPhone
|
|
4006
3742
|
}) {
|
|
4007
|
-
return /* @__PURE__ */
|
|
3743
|
+
return /* @__PURE__ */ jsxs13(
|
|
4008
3744
|
FlowShell,
|
|
4009
3745
|
{
|
|
4010
3746
|
stepKey: "submitted-unreachable",
|
|
4011
3747
|
heading: "We can\u2019t check your request",
|
|
4012
3748
|
documentTitle,
|
|
4013
|
-
footer: portalUrl ? /* @__PURE__ */
|
|
3749
|
+
footer: portalUrl ? /* @__PURE__ */ jsx15("a", { className: "sk-flow__btn sk-flow__btn--primary", href: portalUrl, children: "Track this in the patient portal" }) : void 0,
|
|
4014
3750
|
children: [
|
|
4015
|
-
/* @__PURE__ */
|
|
4016
|
-
clinicPhone ? /* @__PURE__ */
|
|
3751
|
+
/* @__PURE__ */ jsx15(FlowError, { children: "We can\u2019t check your request in this browser right now. Your request is still with the clinic." }),
|
|
3752
|
+
clinicPhone ? /* @__PURE__ */ jsx15(ClinicPhone, { clinicPhone }) : !portalUrl ? /* @__PURE__ */ jsx15("p", { className: "sk-cf__aside", children: "Please contact the clinic using the details on this website." }) : null
|
|
4017
3753
|
]
|
|
4018
3754
|
}
|
|
4019
3755
|
);
|
|
@@ -4023,9 +3759,9 @@ function CallDestination({
|
|
|
4023
3759
|
phone
|
|
4024
3760
|
}) {
|
|
4025
3761
|
if (!booked) return null;
|
|
4026
|
-
return /* @__PURE__ */
|
|
4027
|
-
/* @__PURE__ */
|
|
4028
|
-
/* @__PURE__ */
|
|
3762
|
+
return /* @__PURE__ */ jsxs13("p", { className: "sk-cf__booked sk-cf__call", children: [
|
|
3763
|
+
/* @__PURE__ */ jsx15("span", { className: "sk-cf__booked-label", children: "We\u2019ll call you on" }),
|
|
3764
|
+
/* @__PURE__ */ jsx15("span", { className: "sk-cf__booked-when", children: phone ? formatAuPhone(phone) : "the number you gave us" })
|
|
4029
3765
|
] });
|
|
4030
3766
|
}
|
|
4031
3767
|
function EmailDestination({
|
|
@@ -4033,9 +3769,9 @@ function EmailDestination({
|
|
|
4033
3769
|
email
|
|
4034
3770
|
}) {
|
|
4035
3771
|
if (!promisesEmail || !email) return null;
|
|
4036
|
-
return /* @__PURE__ */
|
|
3772
|
+
return /* @__PURE__ */ jsxs13("p", { className: "sk-cf__aside", children: [
|
|
4037
3773
|
"We\u2019ll email ",
|
|
4038
|
-
/* @__PURE__ */
|
|
3774
|
+
/* @__PURE__ */ jsx15("strong", { children: email }),
|
|
4039
3775
|
" as things progress."
|
|
4040
3776
|
] });
|
|
4041
3777
|
}
|
|
@@ -4048,7 +3784,7 @@ function CancelControl({
|
|
|
4048
3784
|
onConfirm
|
|
4049
3785
|
}) {
|
|
4050
3786
|
const noun = booked ? "appointment" : "request";
|
|
4051
|
-
return /* @__PURE__ */
|
|
3787
|
+
return /* @__PURE__ */ jsxs13(
|
|
4052
3788
|
"div",
|
|
4053
3789
|
{
|
|
4054
3790
|
className: "sk-cf__after sk-cf__cancel",
|
|
@@ -4058,49 +3794,49 @@ function CancelControl({
|
|
|
4058
3794
|
confirming && // This control is reachable on `draft`, `payment_failed`, and bulk-billed
|
|
4059
3795
|
// requests. It has neither fee state nor the release result, so it makes no card
|
|
4060
3796
|
// claim; the paid slot screen carries the complete shared release note instead.
|
|
4061
|
-
/* @__PURE__ */
|
|
3797
|
+
/* @__PURE__ */ jsxs13("p", { className: "sk-cf__body", role: "status", "aria-live": "polite", children: [
|
|
4062
3798
|
"Cancel this ",
|
|
4063
3799
|
noun,
|
|
4064
3800
|
"? ",
|
|
4065
3801
|
booked ? "You\u2019ll give up your appointment time. " : "",
|
|
4066
3802
|
"You\u2019ll need to start again if you change your mind."
|
|
4067
3803
|
] }),
|
|
4068
|
-
/* @__PURE__ */
|
|
4069
|
-
confirming && /* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ jsx15(FlowButton, { type: "button", variant: "quiet", onClick: confirming ? onKeep : onAsk, children: confirming ? `Keep my ${noun}` : "Cancel this request" }),
|
|
3805
|
+
confirming && /* @__PURE__ */ jsx15(FlowButton, { type: "button", variant: "secondary", busy, onClick: onConfirm, children: busy ? "Cancelling\u2026" : `Yes, cancel this ${noun}` })
|
|
4070
3806
|
]
|
|
4071
3807
|
}
|
|
4072
3808
|
);
|
|
4073
3809
|
}
|
|
4074
3810
|
function PortalLink({ portalUrl }) {
|
|
4075
3811
|
if (!portalUrl) return null;
|
|
4076
|
-
return /* @__PURE__ */
|
|
3812
|
+
return /* @__PURE__ */ jsx15("p", { className: "sk-cf__aside", children: /* @__PURE__ */ jsx15("a", { className: "sk-cf__link", href: portalUrl, children: "Manage this in the patient portal" }) });
|
|
4077
3813
|
}
|
|
4078
3814
|
function ClinicPhone({ clinicPhone }) {
|
|
4079
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ jsx15("p", { className: "sk-cf__aside", children: /* @__PURE__ */ jsxs13("a", { className: "sk-cf__link", href: `tel:${normalizeAuPhone(clinicPhone)}`, children: [
|
|
4080
3816
|
"Call the clinic on ",
|
|
4081
3817
|
formatAuPhone(clinicPhone)
|
|
4082
3818
|
] }) });
|
|
4083
3819
|
}
|
|
4084
3820
|
|
|
4085
3821
|
// src/certificate-funnel-steps/trust-rail.tsx
|
|
4086
|
-
import { Fragment as Fragment6, jsx as
|
|
3822
|
+
import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4087
3823
|
function TrustRail({ clinicName, fee }) {
|
|
4088
3824
|
const money = feeNote(fee);
|
|
4089
|
-
return /* @__PURE__ */
|
|
4090
|
-
clinicName && /* @__PURE__ */
|
|
4091
|
-
/* @__PURE__ */
|
|
4092
|
-
money && /* @__PURE__ */
|
|
4093
|
-
/* @__PURE__ */
|
|
4094
|
-
/* @__PURE__ */
|
|
4095
|
-
/* @__PURE__ */
|
|
4096
|
-
/* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
3826
|
+
clinicName && /* @__PURE__ */ jsx16("p", { className: "sk-flow__rail-clinic", children: clinicName }),
|
|
3827
|
+
/* @__PURE__ */ jsx16("p", { children: "Every request is reviewed by a practitioner registered with Ahpra, the Australian Health Practitioner Regulation Agency." }),
|
|
3828
|
+
money && /* @__PURE__ */ jsx16("p", { children: money }),
|
|
3829
|
+
/* @__PURE__ */ jsx16("p", { children: "Your health information is stored in Australia and is only accessible to this clinic\u2019s care team." }),
|
|
3830
|
+
/* @__PURE__ */ jsxs14("p", { className: "sk-flow__rail-policies", children: [
|
|
3831
|
+
/* @__PURE__ */ jsx16("a", { className: "sk-flow__rail-link", href: POLICY_LINKS.terms, children: "Terms" }),
|
|
3832
|
+
/* @__PURE__ */ jsx16("a", { className: "sk-flow__rail-link", href: POLICY_LINKS.privacy, children: "Privacy policy" })
|
|
4097
3833
|
] })
|
|
4098
3834
|
] });
|
|
4099
3835
|
}
|
|
4100
3836
|
|
|
4101
3837
|
// src/certificate-funnel-steps/exit-steps.tsx
|
|
4102
3838
|
import * as React15 from "react";
|
|
4103
|
-
import { jsx as
|
|
3839
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4104
3840
|
var EMERGENCY2 = "000";
|
|
4105
3841
|
var EMERGENCY_INTL = "112";
|
|
4106
3842
|
function EscalateStep({
|
|
@@ -4116,7 +3852,7 @@ function EscalateStep({
|
|
|
4116
3852
|
}, [documentTitle]);
|
|
4117
3853
|
return (
|
|
4118
3854
|
// `alertdialog` + `aria-modal`: this must interrupt, not sit politely in the page.
|
|
4119
|
-
/* @__PURE__ */
|
|
3855
|
+
/* @__PURE__ */ jsxs15(
|
|
4120
3856
|
"div",
|
|
4121
3857
|
{
|
|
4122
3858
|
className: "sk-cf__escalate",
|
|
@@ -4125,22 +3861,22 @@ function EscalateStep({
|
|
|
4125
3861
|
"aria-labelledby": "sk-cf-escalate-heading",
|
|
4126
3862
|
"data-sk-escalate": "",
|
|
4127
3863
|
children: [
|
|
4128
|
-
/* @__PURE__ */
|
|
4129
|
-
/* @__PURE__ */
|
|
3864
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__escalate-eyebrow", children: "Emergency" }),
|
|
3865
|
+
/* @__PURE__ */ jsxs15("h2", { id: "sk-cf-escalate-heading", ref: headingRef, tabIndex: -1, className: "sk-cf__escalate-heading", children: [
|
|
4130
3866
|
"Call ",
|
|
4131
3867
|
EMERGENCY2
|
|
4132
3868
|
] }),
|
|
4133
|
-
/* @__PURE__ */
|
|
4134
|
-
/* @__PURE__ */
|
|
3869
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__escalate-body", children: gate?.message ?? "Your answers suggest you may need urgent care. Please call 000 or go to your nearest emergency department." }),
|
|
3870
|
+
/* @__PURE__ */ jsxs15("a", { className: "sk-cf__escalate-cta", href: `tel:${EMERGENCY2}`, children: [
|
|
4135
3871
|
"Call ",
|
|
4136
3872
|
EMERGENCY2,
|
|
4137
3873
|
" (in Australia)"
|
|
4138
3874
|
] }),
|
|
4139
|
-
/* @__PURE__ */
|
|
3875
|
+
/* @__PURE__ */ jsxs15("a", { className: "sk-cf__escalate-alt", href: `tel:${EMERGENCY_INTL}`, children: [
|
|
4140
3876
|
"Outside Australia / international SIM: ",
|
|
4141
3877
|
EMERGENCY_INTL
|
|
4142
3878
|
] }),
|
|
4143
|
-
/* @__PURE__ */
|
|
3879
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__escalate-note", children: "We\u2019ve stopped your request so you can get to care quickly." })
|
|
4144
3880
|
]
|
|
4145
3881
|
}
|
|
4146
3882
|
)
|
|
@@ -4152,29 +3888,29 @@ function BlockedStep({
|
|
|
4152
3888
|
clinicPhone,
|
|
4153
3889
|
onRestart
|
|
4154
3890
|
}) {
|
|
4155
|
-
return /* @__PURE__ */
|
|
3891
|
+
return /* @__PURE__ */ jsxs15(
|
|
4156
3892
|
FlowShell,
|
|
4157
3893
|
{
|
|
4158
3894
|
stepKey: "blocked",
|
|
4159
3895
|
eyebrow: "Next step",
|
|
4160
3896
|
heading: "Let\u2019s get you to the right care",
|
|
4161
3897
|
documentTitle,
|
|
4162
|
-
footer: /* @__PURE__ */
|
|
3898
|
+
footer: /* @__PURE__ */ jsx17(FlowButton, { type: "button", variant: "quiet", onClick: onRestart, children: "Start again" }),
|
|
4163
3899
|
children: [
|
|
4164
|
-
/* @__PURE__ */
|
|
4165
|
-
/* @__PURE__ */
|
|
4166
|
-
/* @__PURE__ */
|
|
4167
|
-
/* @__PURE__ */
|
|
4168
|
-
/* @__PURE__ */
|
|
3900
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__body", children: gate?.message ?? "Based on your answers, we\u2019re not able to issue a certificate online this time." }),
|
|
3901
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__body", children: "We\u2019d recommend seeing your own GP, who can assess you properly." }),
|
|
3902
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__body", children: "Nothing has been charged." }),
|
|
3903
|
+
/* @__PURE__ */ jsxs15("ul", { className: "sk-cf__links", children: [
|
|
3904
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15("a", { className: "sk-cf__emergency", href: `tel:${EMERGENCY2}`, children: [
|
|
4169
3905
|
"If your symptoms get worse, call ",
|
|
4170
3906
|
EMERGENCY2
|
|
4171
3907
|
] }) }),
|
|
4172
|
-
/* @__PURE__ */
|
|
4173
|
-
clinicPhone && /* @__PURE__ */
|
|
3908
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17("a", { className: "sk-cf__link", href: "tel:1800022222", children: "Health advice, 24 hours \u2014 healthdirect on 1800 022 222" }) }),
|
|
3909
|
+
clinicPhone && /* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15("a", { className: "sk-cf__link", href: `tel:${normalizeAuPhone(clinicPhone)}`, children: [
|
|
4174
3910
|
"Call the clinic on ",
|
|
4175
3911
|
clinicPhone
|
|
4176
3912
|
] }) }),
|
|
4177
|
-
/* @__PURE__ */
|
|
3913
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17(
|
|
4178
3914
|
"a",
|
|
4179
3915
|
{
|
|
4180
3916
|
className: "sk-cf__link",
|
|
@@ -4195,20 +3931,20 @@ function PaymentFailedStep({
|
|
|
4195
3931
|
clinicPhone,
|
|
4196
3932
|
onRestart
|
|
4197
3933
|
}) {
|
|
4198
|
-
return /* @__PURE__ */
|
|
3934
|
+
return /* @__PURE__ */ jsxs15(
|
|
4199
3935
|
FlowShell,
|
|
4200
3936
|
{
|
|
4201
3937
|
stepKey: "payment-failed",
|
|
4202
3938
|
heading: "Payment could not be authorised",
|
|
4203
3939
|
documentTitle,
|
|
4204
|
-
footer: /* @__PURE__ */
|
|
3940
|
+
footer: /* @__PURE__ */ jsx17(FlowButton, { type: "button", variant: "primary", onClick: onRestart, children: "Start again with a different card" }),
|
|
4205
3941
|
children: [
|
|
4206
|
-
/* @__PURE__ */
|
|
4207
|
-
/* @__PURE__ */
|
|
4208
|
-
clinicPhone && /* @__PURE__ */
|
|
3942
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__body", children: message ?? "Your card was declined and the pre-authorisation could not be completed." }),
|
|
3943
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__body", children: "No hold was placed and no certificate has been created." }),
|
|
3944
|
+
clinicPhone && /* @__PURE__ */ jsxs15("p", { className: "sk-cf__body", children: [
|
|
4209
3945
|
"Still not working?",
|
|
4210
3946
|
" ",
|
|
4211
|
-
/* @__PURE__ */
|
|
3947
|
+
/* @__PURE__ */ jsxs15("a", { className: "sk-cf__link", href: `tel:${normalizeAuPhone(clinicPhone)}`, children: [
|
|
4212
3948
|
"Call the clinic on ",
|
|
4213
3949
|
clinicPhone
|
|
4214
3950
|
] })
|
|
@@ -4222,25 +3958,25 @@ function UnavailableStep({
|
|
|
4222
3958
|
clinicPhone,
|
|
4223
3959
|
onBack
|
|
4224
3960
|
}) {
|
|
4225
|
-
return /* @__PURE__ */
|
|
3961
|
+
return /* @__PURE__ */ jsxs15(
|
|
4226
3962
|
FlowShell,
|
|
4227
3963
|
{
|
|
4228
3964
|
stepKey: "unavailable",
|
|
4229
3965
|
heading: "We can\u2019t help with this type of certificate online",
|
|
4230
3966
|
documentTitle,
|
|
4231
|
-
footer: onBack ? /* @__PURE__ */
|
|
3967
|
+
footer: onBack ? /* @__PURE__ */ jsx17(FlowButton, { type: "button", variant: "quiet", onClick: onBack, children: "Choose a different certificate" }) : void 0,
|
|
4232
3968
|
children: [
|
|
4233
|
-
/* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
/* @__PURE__ */
|
|
4236
|
-
/* @__PURE__ */
|
|
4237
|
-
/* @__PURE__ */
|
|
4238
|
-
/* @__PURE__ */
|
|
4239
|
-
/* @__PURE__ */
|
|
3969
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__body", children: "Online certificates cover short, common illness absences. These need an in-person assessment:" }),
|
|
3970
|
+
/* @__PURE__ */ jsxs15("ul", { className: "sk-cf__list", children: [
|
|
3971
|
+
/* @__PURE__ */ jsx17("li", { children: "Mental-health-related absences" }),
|
|
3972
|
+
/* @__PURE__ */ jsx17("li", { children: "Workers\u2019 compensation certificates" }),
|
|
3973
|
+
/* @__PURE__ */ jsx17("li", { children: "Legal or court-related certificates" }),
|
|
3974
|
+
/* @__PURE__ */ jsx17("li", { children: "Insurance claim certificates" }),
|
|
3975
|
+
/* @__PURE__ */ jsx17("li", { children: "Backdated certificates well after the fact" })
|
|
4240
3976
|
] }),
|
|
4241
|
-
/* @__PURE__ */
|
|
4242
|
-
/* @__PURE__ */
|
|
4243
|
-
/* @__PURE__ */
|
|
3977
|
+
/* @__PURE__ */ jsx17("p", { className: "sk-cf__body", children: "For these, please see your regular GP, who can assess you in person and issue the right kind of certificate." }),
|
|
3978
|
+
/* @__PURE__ */ jsxs15("ul", { className: "sk-cf__links", children: [
|
|
3979
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17(
|
|
4244
3980
|
"a",
|
|
4245
3981
|
{
|
|
4246
3982
|
className: "sk-cf__link",
|
|
@@ -4250,11 +3986,11 @@ function UnavailableStep({
|
|
|
4250
3986
|
children: "Find a GP near you"
|
|
4251
3987
|
}
|
|
4252
3988
|
) }),
|
|
4253
|
-
clinicPhone && /* @__PURE__ */
|
|
3989
|
+
clinicPhone && /* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15("a", { className: "sk-cf__link", href: `tel:${normalizeAuPhone(clinicPhone)}`, children: [
|
|
4254
3990
|
"Call the clinic on ",
|
|
4255
3991
|
clinicPhone
|
|
4256
3992
|
] }) }),
|
|
4257
|
-
/* @__PURE__ */
|
|
3993
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17("a", { className: "sk-cf__link", href: "tel:1800022222", children: "Health advice, 24 hours \u2014 healthdirect on 1800 022 222" }) })
|
|
4258
3994
|
] })
|
|
4259
3995
|
]
|
|
4260
3996
|
}
|
|
@@ -4262,7 +3998,7 @@ function UnavailableStep({
|
|
|
4262
3998
|
}
|
|
4263
3999
|
|
|
4264
4000
|
// src/certificate-funnel.client.tsx
|
|
4265
|
-
import { jsx as
|
|
4001
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4266
4002
|
function slotFlowIsLost(flowChecked, flow, capturing) {
|
|
4267
4003
|
return flowChecked && !flow?.appointmentTypeId && !capturing;
|
|
4268
4004
|
}
|
|
@@ -4287,15 +4023,15 @@ function CertificateFunnelClient(props) {
|
|
|
4287
4023
|
]
|
|
4288
4024
|
);
|
|
4289
4025
|
if (!props.publicApi?.publishableKey) {
|
|
4290
|
-
return /* @__PURE__ */
|
|
4291
|
-
/* @__PURE__ */
|
|
4292
|
-
/* @__PURE__ */
|
|
4026
|
+
return /* @__PURE__ */ jsxs16("div", { className: "sk-cf sk-cf--unconfigured", children: [
|
|
4027
|
+
/* @__PURE__ */ jsx18("h2", { className: "sk-certificate-funnel__heading", children: props.heading ?? "Medical certificates" }),
|
|
4028
|
+
/* @__PURE__ */ jsxs16("p", { className: "sk-certificate-funnel__placeholder", children: [
|
|
4293
4029
|
"Online requests aren\u2019t available right now.",
|
|
4294
4030
|
props.clinicPhone ? ` Please call the clinic on ${props.clinicPhone}.` : " Please call the clinic."
|
|
4295
4031
|
] })
|
|
4296
4032
|
] });
|
|
4297
4033
|
}
|
|
4298
|
-
return /* @__PURE__ */
|
|
4034
|
+
return /* @__PURE__ */ jsx18(PortalProvider, { client: portalClient, children: /* @__PURE__ */ jsx18(Funnel, { ...props }) });
|
|
4299
4035
|
}
|
|
4300
4036
|
var RESERVATION_REQUIRED_STEPS = /* @__PURE__ */ new Set([
|
|
4301
4037
|
"identity",
|
|
@@ -4672,7 +4408,7 @@ function Funnel({
|
|
|
4672
4408
|
intakeSteps: intakeStepsFor(questionCounts, chosenKey)
|
|
4673
4409
|
};
|
|
4674
4410
|
}, [flow, fees, pinnedService, chosenKey, step, questionCounts]);
|
|
4675
|
-
if (!state) return /* @__PURE__ */
|
|
4411
|
+
if (!state) return /* @__PURE__ */ jsx18(FlowLoading, {});
|
|
4676
4412
|
const title = stepTitle(state.step, clinicName);
|
|
4677
4413
|
const selectableServices = enabledServiceKeys ? services.filter((candidate) => enabledServiceKeys.has(candidate.key)) : [];
|
|
4678
4414
|
const service = selectableServices.find((candidate) => candidate.key === state.serviceKey) ?? null;
|
|
@@ -4701,7 +4437,7 @@ function Funnel({
|
|
|
4701
4437
|
});
|
|
4702
4438
|
}
|
|
4703
4439
|
const quietMoney = HOLDLESS_STEPS.has(state.step) || state.step === "consent" || state.step === "payment";
|
|
4704
|
-
const rail = /* @__PURE__ */
|
|
4440
|
+
const rail = /* @__PURE__ */ jsx18(
|
|
4705
4441
|
TrustRail,
|
|
4706
4442
|
{
|
|
4707
4443
|
clinicName,
|
|
@@ -4711,7 +4447,7 @@ function Funnel({
|
|
|
4711
4447
|
const renderStep = () => {
|
|
4712
4448
|
switch (state.step) {
|
|
4713
4449
|
case "service":
|
|
4714
|
-
return /* @__PURE__ */
|
|
4450
|
+
return /* @__PURE__ */ jsx18(
|
|
4715
4451
|
ServiceStep,
|
|
4716
4452
|
{
|
|
4717
4453
|
services: selectableServices,
|
|
@@ -4725,9 +4461,9 @@ function Funnel({
|
|
|
4725
4461
|
}
|
|
4726
4462
|
);
|
|
4727
4463
|
case "preflight":
|
|
4728
|
-
if (!enabledServiceKeys) return /* @__PURE__ */
|
|
4464
|
+
if (!enabledServiceKeys) return /* @__PURE__ */ jsx18(FlowLoading, {});
|
|
4729
4465
|
if (!state.serviceKey || !enabledServiceKeys.has(state.serviceKey)) {
|
|
4730
|
-
return /* @__PURE__ */
|
|
4466
|
+
return /* @__PURE__ */ jsxs16(
|
|
4731
4467
|
FlowShell,
|
|
4732
4468
|
{
|
|
4733
4469
|
...stepProgress("preflight", shape),
|
|
@@ -4736,8 +4472,8 @@ function Funnel({
|
|
|
4736
4472
|
documentTitle: title,
|
|
4737
4473
|
onBack: showBack ? back2 : void 0,
|
|
4738
4474
|
children: [
|
|
4739
|
-
/* @__PURE__ */
|
|
4740
|
-
/* @__PURE__ */
|
|
4475
|
+
/* @__PURE__ */ jsx18(FlowError, { children: "This certificate type is not currently available through this website." }),
|
|
4476
|
+
/* @__PURE__ */ jsx18(
|
|
4741
4477
|
FlowButton,
|
|
4742
4478
|
{
|
|
4743
4479
|
type: "button",
|
|
@@ -4750,8 +4486,8 @@ function Funnel({
|
|
|
4750
4486
|
}
|
|
4751
4487
|
);
|
|
4752
4488
|
}
|
|
4753
|
-
return /* @__PURE__ */
|
|
4754
|
-
/* @__PURE__ */
|
|
4489
|
+
return /* @__PURE__ */ jsxs16("div", { children: [
|
|
4490
|
+
/* @__PURE__ */ jsx18(
|
|
4755
4491
|
PreflightStep,
|
|
4756
4492
|
{
|
|
4757
4493
|
documentTitle: title,
|
|
@@ -4761,12 +4497,12 @@ function Funnel({
|
|
|
4761
4497
|
onBack: showBack ? back2 : void 0
|
|
4762
4498
|
}
|
|
4763
4499
|
),
|
|
4764
|
-
/* @__PURE__ */
|
|
4500
|
+
/* @__PURE__ */ jsx18(FlowError, { children: resolveError })
|
|
4765
4501
|
] });
|
|
4766
4502
|
case "identity":
|
|
4767
4503
|
case "confirm-identity":
|
|
4768
|
-
return /* @__PURE__ */
|
|
4769
|
-
/* @__PURE__ */
|
|
4504
|
+
return /* @__PURE__ */ jsxs16("div", { children: [
|
|
4505
|
+
/* @__PURE__ */ jsx18(
|
|
4770
4506
|
IdentityStep,
|
|
4771
4507
|
{
|
|
4772
4508
|
client,
|
|
@@ -4803,11 +4539,11 @@ function Funnel({
|
|
|
4803
4539
|
}
|
|
4804
4540
|
}
|
|
4805
4541
|
),
|
|
4806
|
-
/* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsx18(FlowError, { children: resolveError })
|
|
4807
4543
|
] });
|
|
4808
4544
|
case "intake":
|
|
4809
4545
|
if (reopeningScreening || reopenScreeningError || applicationRun?.status === "screening_complete" || applicationRun?.status === "reserved") {
|
|
4810
|
-
return /* @__PURE__ */
|
|
4546
|
+
return /* @__PURE__ */ jsxs16(
|
|
4811
4547
|
FlowShell,
|
|
4812
4548
|
{
|
|
4813
4549
|
...stepProgress("intake", shape),
|
|
@@ -4816,14 +4552,14 @@ function Funnel({
|
|
|
4816
4552
|
documentTitle: title,
|
|
4817
4553
|
onBack: showBack ? back2 : void 0,
|
|
4818
4554
|
children: [
|
|
4819
|
-
reopeningScreening && /* @__PURE__ */
|
|
4820
|
-
/* @__PURE__ */
|
|
4821
|
-
reopenScreeningError && /* @__PURE__ */
|
|
4555
|
+
reopeningScreening && /* @__PURE__ */ jsx18(FlowLoading, { message: "Reopening your screening\u2026" }),
|
|
4556
|
+
/* @__PURE__ */ jsx18(FlowError, { children: reopenScreeningError }),
|
|
4557
|
+
reopenScreeningError && /* @__PURE__ */ jsx18(FlowButton, { type: "button", variant: "primary", onClick: () => void reopenScreening(), children: "Try again" })
|
|
4822
4558
|
]
|
|
4823
4559
|
}
|
|
4824
4560
|
);
|
|
4825
4561
|
}
|
|
4826
|
-
return /* @__PURE__ */
|
|
4562
|
+
return /* @__PURE__ */ jsx18(
|
|
4827
4563
|
IntakeStep,
|
|
4828
4564
|
{
|
|
4829
4565
|
client,
|
|
@@ -4839,7 +4575,7 @@ function Funnel({
|
|
|
4839
4575
|
}
|
|
4840
4576
|
);
|
|
4841
4577
|
case "medicare":
|
|
4842
|
-
return /* @__PURE__ */
|
|
4578
|
+
return /* @__PURE__ */ jsx18(
|
|
4843
4579
|
MedicareStep,
|
|
4844
4580
|
{
|
|
4845
4581
|
client,
|
|
@@ -4852,7 +4588,7 @@ function Funnel({
|
|
|
4852
4588
|
}
|
|
4853
4589
|
);
|
|
4854
4590
|
case "consent":
|
|
4855
|
-
return flowChecked && !flow && !capturing ? /* @__PURE__ */
|
|
4591
|
+
return flowChecked && !flow && !capturing ? /* @__PURE__ */ jsx18(
|
|
4856
4592
|
FlowShell,
|
|
4857
4593
|
{
|
|
4858
4594
|
...stepProgress("consent", shape),
|
|
@@ -4860,9 +4596,9 @@ function Funnel({
|
|
|
4860
4596
|
heading: "Confirm & sign",
|
|
4861
4597
|
onBack: showBack ? back2 : void 0,
|
|
4862
4598
|
documentTitle: title,
|
|
4863
|
-
children: /* @__PURE__ */
|
|
4599
|
+
children: /* @__PURE__ */ jsx18(FlowError, { children: "We can\u2019t pick up this booking in this browser. Please go back and try again." })
|
|
4864
4600
|
}
|
|
4865
|
-
) : /* @__PURE__ */
|
|
4601
|
+
) : /* @__PURE__ */ jsx18(
|
|
4866
4602
|
ConsentStep,
|
|
4867
4603
|
{
|
|
4868
4604
|
client,
|
|
@@ -4901,7 +4637,7 @@ function Funnel({
|
|
|
4901
4637
|
}
|
|
4902
4638
|
);
|
|
4903
4639
|
case "payment":
|
|
4904
|
-
return /* @__PURE__ */
|
|
4640
|
+
return /* @__PURE__ */ jsx18(
|
|
4905
4641
|
FlowShell,
|
|
4906
4642
|
{
|
|
4907
4643
|
...stepProgress("payment", shape),
|
|
@@ -4910,7 +4646,7 @@ function Funnel({
|
|
|
4910
4646
|
subheading: HOLD_RELEASE_NOTE,
|
|
4911
4647
|
documentTitle: title,
|
|
4912
4648
|
onBack: showBack ? back2 : void 0,
|
|
4913
|
-
children: /* @__PURE__ */
|
|
4649
|
+
children: /* @__PURE__ */ jsx18(
|
|
4914
4650
|
PaymentStep,
|
|
4915
4651
|
{
|
|
4916
4652
|
client,
|
|
@@ -4939,7 +4675,7 @@ function Funnel({
|
|
|
4939
4675
|
}
|
|
4940
4676
|
);
|
|
4941
4677
|
case "slot":
|
|
4942
|
-
return flow?.appointmentTypeId ? /* @__PURE__ */
|
|
4678
|
+
return flow?.appointmentTypeId ? /* @__PURE__ */ jsx18(
|
|
4943
4679
|
SlotStep,
|
|
4944
4680
|
{
|
|
4945
4681
|
client,
|
|
@@ -4966,14 +4702,14 @@ function Funnel({
|
|
|
4966
4702
|
) : flowLost ? (
|
|
4967
4703
|
// Same chrome as the real slot screen — a recovery state that drops the
|
|
4968
4704
|
// progress reads as a terminal exit, which is exactly what it is not.
|
|
4969
|
-
/* @__PURE__ */
|
|
4705
|
+
/* @__PURE__ */ jsxs16(
|
|
4970
4706
|
FlowShell,
|
|
4971
4707
|
{
|
|
4972
4708
|
...stepProgress("slot", shape),
|
|
4973
4709
|
stepKey: "slot",
|
|
4974
4710
|
heading: "Choose your appointment time",
|
|
4975
4711
|
documentTitle: title,
|
|
4976
|
-
footer: /* @__PURE__ */
|
|
4712
|
+
footer: /* @__PURE__ */ jsx18(
|
|
4977
4713
|
FlowButton,
|
|
4978
4714
|
{
|
|
4979
4715
|
type: "button",
|
|
@@ -4984,31 +4720,31 @@ function Funnel({
|
|
|
4984
4720
|
}
|
|
4985
4721
|
),
|
|
4986
4722
|
children: [
|
|
4987
|
-
/* @__PURE__ */
|
|
4988
|
-
clinicPhone && /* @__PURE__ */
|
|
4723
|
+
/* @__PURE__ */ jsx18(FlowError, { children: "We can\u2019t pick up this booking in this browser. Your request is still with the clinic." }),
|
|
4724
|
+
clinicPhone && /* @__PURE__ */ jsxs16("p", { className: "sk-slots__empty-note", children: [
|
|
4989
4725
|
"Can\u2019t find a time that suits?",
|
|
4990
4726
|
" ",
|
|
4991
|
-
/* @__PURE__ */
|
|
4727
|
+
/* @__PURE__ */ jsxs16("a", { className: "sk-cf__link", href: `tel:${normalizeAuPhone(clinicPhone)}`, children: [
|
|
4992
4728
|
"Call the clinic on ",
|
|
4993
4729
|
clinicPhone
|
|
4994
4730
|
] })
|
|
4995
4731
|
] }),
|
|
4996
|
-
/* @__PURE__ */
|
|
4732
|
+
/* @__PURE__ */ jsx18(FlowError, { children: lostSlotCancelError })
|
|
4997
4733
|
]
|
|
4998
4734
|
}
|
|
4999
4735
|
)
|
|
5000
|
-
) : /* @__PURE__ */
|
|
4736
|
+
) : /* @__PURE__ */ jsx18(
|
|
5001
4737
|
FlowShell,
|
|
5002
4738
|
{
|
|
5003
4739
|
...stepProgress("slot", shape),
|
|
5004
4740
|
stepKey: "slot",
|
|
5005
4741
|
heading: "Choose your appointment time",
|
|
5006
4742
|
documentTitle: title,
|
|
5007
|
-
children: /* @__PURE__ */
|
|
4743
|
+
children: /* @__PURE__ */ jsx18(FlowLoading, { message: "Loading your booking\u2026" })
|
|
5008
4744
|
}
|
|
5009
4745
|
);
|
|
5010
4746
|
case "submitted":
|
|
5011
|
-
return /* @__PURE__ */
|
|
4747
|
+
return /* @__PURE__ */ jsx18(
|
|
5012
4748
|
SubmittedStep,
|
|
5013
4749
|
{
|
|
5014
4750
|
client,
|
|
@@ -5024,7 +4760,7 @@ function Funnel({
|
|
|
5024
4760
|
}
|
|
5025
4761
|
);
|
|
5026
4762
|
case "blocked":
|
|
5027
|
-
return /* @__PURE__ */
|
|
4763
|
+
return /* @__PURE__ */ jsx18(
|
|
5028
4764
|
BlockedStep,
|
|
5029
4765
|
{
|
|
5030
4766
|
gate: state.gate,
|
|
@@ -5034,9 +4770,9 @@ function Funnel({
|
|
|
5034
4770
|
}
|
|
5035
4771
|
);
|
|
5036
4772
|
case "escalate":
|
|
5037
|
-
return /* @__PURE__ */
|
|
4773
|
+
return /* @__PURE__ */ jsx18(EscalateStep, { gate: state.gate, documentTitle: title });
|
|
5038
4774
|
case "payment-failed":
|
|
5039
|
-
return /* @__PURE__ */
|
|
4775
|
+
return /* @__PURE__ */ jsx18(
|
|
5040
4776
|
PaymentFailedStep,
|
|
5041
4777
|
{
|
|
5042
4778
|
message: state.failure,
|
|
@@ -5046,7 +4782,7 @@ function Funnel({
|
|
|
5046
4782
|
}
|
|
5047
4783
|
);
|
|
5048
4784
|
case "session-expired":
|
|
5049
|
-
return /* @__PURE__ */
|
|
4785
|
+
return /* @__PURE__ */ jsx18(
|
|
5050
4786
|
SessionExpiredState,
|
|
5051
4787
|
{
|
|
5052
4788
|
requestStarted: !!state.requestId,
|
|
@@ -5057,7 +4793,7 @@ function Funnel({
|
|
|
5057
4793
|
}
|
|
5058
4794
|
);
|
|
5059
4795
|
case "unavailable":
|
|
5060
|
-
return /* @__PURE__ */
|
|
4796
|
+
return /* @__PURE__ */ jsx18(
|
|
5061
4797
|
UnavailableStep,
|
|
5062
4798
|
{
|
|
5063
4799
|
documentTitle: title,
|
|
@@ -5067,7 +4803,7 @@ function Funnel({
|
|
|
5067
4803
|
);
|
|
5068
4804
|
}
|
|
5069
4805
|
};
|
|
5070
|
-
return /* @__PURE__ */
|
|
4806
|
+
return /* @__PURE__ */ jsx18(FlowShapeContext.Provider, { value: shape, children: /* @__PURE__ */ jsx18(FlowRailContext.Provider, { value: rail, children: renderStep() }) });
|
|
5071
4807
|
}
|
|
5072
4808
|
function SessionExpiredState({
|
|
5073
4809
|
requestStarted,
|
|
@@ -5076,20 +4812,20 @@ function SessionExpiredState({
|
|
|
5076
4812
|
documentTitle,
|
|
5077
4813
|
onRestart
|
|
5078
4814
|
}) {
|
|
5079
|
-
return /* @__PURE__ */
|
|
4815
|
+
return /* @__PURE__ */ jsxs16(
|
|
5080
4816
|
FlowShell,
|
|
5081
4817
|
{
|
|
5082
4818
|
stepKey: "session-expired",
|
|
5083
4819
|
heading: "Your secure session ended",
|
|
5084
4820
|
documentTitle,
|
|
5085
|
-
footer: portalUrl ? /* @__PURE__ */
|
|
4821
|
+
footer: portalUrl ? /* @__PURE__ */ jsx18("a", { className: "sk-flow__btn sk-flow__btn--primary", href: portalUrl, children: "Continue in the patient portal" }) : requestStarted ? void 0 : /* @__PURE__ */ jsx18(FlowButton, { type: "button", variant: "primary", onClick: onRestart, children: "Start again securely" }),
|
|
5086
4822
|
children: [
|
|
5087
|
-
/* @__PURE__ */
|
|
4823
|
+
/* @__PURE__ */ jsxs16("p", { className: "sk-cf__body", children: [
|
|
5088
4824
|
"This secure session is no longer available.",
|
|
5089
4825
|
" ",
|
|
5090
4826
|
requestStarted ? "Your request is still with the clinic." : "You can start again securely."
|
|
5091
4827
|
] }),
|
|
5092
|
-
clinicPhone ? /* @__PURE__ */
|
|
4828
|
+
clinicPhone ? /* @__PURE__ */ jsx18(ClinicPhone, { clinicPhone }) : portalUrl ? null : /* @__PURE__ */ jsx18("p", { className: "sk-cf__aside", children: "Please contact the clinic using the details on this website." })
|
|
5093
4829
|
]
|
|
5094
4830
|
}
|
|
5095
4831
|
);
|
|
@@ -5097,7 +4833,7 @@ function SessionExpiredState({
|
|
|
5097
4833
|
|
|
5098
4834
|
// src/portal-panel.client.tsx
|
|
5099
4835
|
import * as React17 from "react";
|
|
5100
|
-
import { Fragment as Fragment7, jsx as
|
|
4836
|
+
import { Fragment as Fragment7, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5101
4837
|
var SUMMARY_URL = "/portal/api/summary";
|
|
5102
4838
|
async function loadPortalPanelWithClient(surface, client) {
|
|
5103
4839
|
const res = await client.get(
|
|
@@ -5135,7 +4871,7 @@ function PortalPanelClient({
|
|
|
5135
4871
|
() => createPortalClient({ apiOrigin: portalApiOrigin, portalUrl, fetchImpl }),
|
|
5136
4872
|
[portalApiOrigin, portalUrl, fetchImpl]
|
|
5137
4873
|
);
|
|
5138
|
-
return /* @__PURE__ */
|
|
4874
|
+
return /* @__PURE__ */ jsx19(PortalProvider, { client, children: /* @__PURE__ */ jsx19(
|
|
5139
4875
|
PortalPanelContent,
|
|
5140
4876
|
{
|
|
5141
4877
|
surface,
|
|
@@ -5164,11 +4900,11 @@ function PortalPanelContent({
|
|
|
5164
4900
|
const heading2 = PORTAL_SURFACE_LABEL[surface] ?? "Your portal";
|
|
5165
4901
|
const href = portalSurfaceHref(surface, portalUrl);
|
|
5166
4902
|
const signInHref = portalUrl ?? "/portal";
|
|
5167
|
-
return /* @__PURE__ */
|
|
5168
|
-
/* @__PURE__ */
|
|
5169
|
-
state.kind === "loading" ? /* @__PURE__ */
|
|
5170
|
-
state.kind === "link-out" ? /* @__PURE__ */
|
|
5171
|
-
state.kind === "signed-out" ? /* @__PURE__ */
|
|
4903
|
+
return /* @__PURE__ */ jsxs17("section", { className: "sk-portal-panel__body", "aria-busy": state.kind === "loading", children: [
|
|
4904
|
+
/* @__PURE__ */ jsx19("h2", { className: "sk-portal-panel__heading", children: heading2 }),
|
|
4905
|
+
state.kind === "loading" ? /* @__PURE__ */ jsx19("p", { className: "sk-portal-panel__placeholder", children: "Checking your sign-in\u2026" }) : null,
|
|
4906
|
+
state.kind === "link-out" ? /* @__PURE__ */ jsx19("p", { className: "sk-portal-panel__placeholder", children: /* @__PURE__ */ jsx19("a", { className: "sk-portal-panel__link", href: signInHref, children: "Sign in to your patient portal" }) }) : null,
|
|
4907
|
+
state.kind === "signed-out" ? /* @__PURE__ */ jsx19(
|
|
5172
4908
|
PortalSignInRamp,
|
|
5173
4909
|
{
|
|
5174
4910
|
idSuffix: surface,
|
|
@@ -5176,17 +4912,17 @@ function PortalPanelContent({
|
|
|
5176
4912
|
onResult: ({ ok, email }) => setState(ok ? { kind: "link-sent", email } : { kind: "link-out" })
|
|
5177
4913
|
}
|
|
5178
4914
|
) : null,
|
|
5179
|
-
state.kind === "link-sent" ? /* @__PURE__ */
|
|
5180
|
-
state.kind === "signed-in" ? /* @__PURE__ */
|
|
5181
|
-
state.items.length === 0 ? /* @__PURE__ */
|
|
4915
|
+
state.kind === "link-sent" ? /* @__PURE__ */ jsx19(PortalLinkSentNotice, { email: state.email }) : null,
|
|
4916
|
+
state.kind === "signed-in" ? /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
4917
|
+
state.items.length === 0 ? /* @__PURE__ */ jsx19("p", { className: "sk-portal-panel__empty", children: "Nothing to show here yet." }) : /* @__PURE__ */ jsx19("ul", { className: "sk-portal-panel__list", children: state.items.map((item) => {
|
|
5182
4918
|
const meta = itemMeta(item);
|
|
5183
|
-
return /* @__PURE__ */
|
|
5184
|
-
/* @__PURE__ */
|
|
5185
|
-
meta ? /* @__PURE__ */
|
|
5186
|
-
item.status ? /* @__PURE__ */
|
|
4919
|
+
return /* @__PURE__ */ jsxs17("li", { className: "sk-portal-panel__item", children: [
|
|
4920
|
+
/* @__PURE__ */ jsx19("span", { className: "sk-portal-panel__item-title", children: item.title ?? "\u2014" }),
|
|
4921
|
+
meta ? /* @__PURE__ */ jsx19("span", { className: "sk-portal-panel__item-meta", children: meta }) : null,
|
|
4922
|
+
item.status ? /* @__PURE__ */ jsx19("span", { className: "sk-portal-panel__item-status", children: item.status }) : null
|
|
5187
4923
|
] }, item.id);
|
|
5188
4924
|
}) }),
|
|
5189
|
-
/* @__PURE__ */
|
|
4925
|
+
/* @__PURE__ */ jsx19("a", { className: "sk-portal-panel__link", href, children: "Open portal" })
|
|
5190
4926
|
] }) : null
|
|
5191
4927
|
] });
|
|
5192
4928
|
}
|
|
@@ -10750,11 +10486,11 @@ MarkdownIt.prototype.renderInline = function(src, env) {
|
|
|
10750
10486
|
var lib_default = MarkdownIt;
|
|
10751
10487
|
|
|
10752
10488
|
// ../website-sdk/src/primitives.tsx
|
|
10753
|
-
import { jsx as
|
|
10489
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
10754
10490
|
var md = new lib_default({ html: false, linkify: true });
|
|
10755
10491
|
|
|
10756
10492
|
// src/portal-book-launcher.tsx
|
|
10757
|
-
import { jsx as
|
|
10493
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
10758
10494
|
var DEFAULT_FUNNEL_HREF = "/certificates";
|
|
10759
10495
|
function funnelServiceHref(funnelHref, serviceKey) {
|
|
10760
10496
|
const trimmed = (funnelHref ?? DEFAULT_FUNNEL_HREF).replace(/\/$/, "");
|
|
@@ -10768,25 +10504,25 @@ function ServiceLauncherList({
|
|
|
10768
10504
|
clinicPhone
|
|
10769
10505
|
}) {
|
|
10770
10506
|
if (services.length === 0) {
|
|
10771
|
-
return /* @__PURE__ */
|
|
10507
|
+
return /* @__PURE__ */ jsxs19("p", { className: "sk-portal-account__note", role: "note", children: [
|
|
10772
10508
|
"Online booking isn\u2019t available right now.",
|
|
10773
10509
|
clinicPhone ? ` Please call the clinic on ${clinicPhone}.` : " Please call the clinic."
|
|
10774
10510
|
] });
|
|
10775
10511
|
}
|
|
10776
|
-
return /* @__PURE__ */
|
|
10512
|
+
return /* @__PURE__ */ jsx21("ul", { className: "sk-portal-launcher", children: services.map((s) => {
|
|
10777
10513
|
const price = prices?.[s.key] ?? "";
|
|
10778
|
-
return /* @__PURE__ */
|
|
10514
|
+
return /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsxs19(
|
|
10779
10515
|
"a",
|
|
10780
10516
|
{
|
|
10781
10517
|
className: "sk-portal-launcher__service",
|
|
10782
10518
|
href: funnelServiceHref(funnelHref, s.key),
|
|
10783
10519
|
"data-sk-service": s.key,
|
|
10784
10520
|
children: [
|
|
10785
|
-
/* @__PURE__ */
|
|
10786
|
-
/* @__PURE__ */
|
|
10787
|
-
price ? /* @__PURE__ */
|
|
10521
|
+
/* @__PURE__ */ jsxs19("span", { className: "sk-portal-launcher__body", children: [
|
|
10522
|
+
/* @__PURE__ */ jsx21("span", { className: "sk-portal-launcher__label", children: s.label }),
|
|
10523
|
+
price ? /* @__PURE__ */ jsx21("span", { className: "sk-portal-launcher__fee", children: price }) : null
|
|
10788
10524
|
] }),
|
|
10789
|
-
/* @__PURE__ */
|
|
10525
|
+
/* @__PURE__ */ jsx21("span", { "aria-hidden": "true", className: "sk-portal-launcher__chevron", children: "\u2192" })
|
|
10790
10526
|
]
|
|
10791
10527
|
}
|
|
10792
10528
|
) }, s.key);
|
|
@@ -10794,7 +10530,7 @@ function ServiceLauncherList({
|
|
|
10794
10530
|
}
|
|
10795
10531
|
|
|
10796
10532
|
// src/portal-account.tsx
|
|
10797
|
-
import { jsx as
|
|
10533
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
10798
10534
|
var PORTAL_ACCOUNT_HEADING = {
|
|
10799
10535
|
appointments: "Your appointments",
|
|
10800
10536
|
documents: "Your documents",
|
|
@@ -10833,7 +10569,7 @@ function PortalAccount({
|
|
|
10833
10569
|
const services = isBook ? getServices().filter((s) => !!s.key).map((s) => ({ key: s.key, label: s.label })) : [];
|
|
10834
10570
|
const clinicPhone = isBook ? getClinic().phone : void 0;
|
|
10835
10571
|
const publicApi = isBook ? getPublicApi() : void 0;
|
|
10836
|
-
return /* @__PURE__ */
|
|
10572
|
+
return /* @__PURE__ */ jsxs20(
|
|
10837
10573
|
Island,
|
|
10838
10574
|
{
|
|
10839
10575
|
name: "portal-account",
|
|
@@ -10847,7 +10583,7 @@ function PortalAccount({
|
|
|
10847
10583
|
},
|
|
10848
10584
|
className: ["sk-portal-account", className].filter(Boolean).join(" "),
|
|
10849
10585
|
children: [
|
|
10850
|
-
/* @__PURE__ */
|
|
10586
|
+
/* @__PURE__ */ jsx22("h2", { className: "sk-portal-account__heading", children: PORTAL_ACCOUNT_HEADING[surface] ?? "Your account" }),
|
|
10851
10587
|
isBook ? (
|
|
10852
10588
|
// A REAL, working list — not a sign-in card. Every link here is valid before any
|
|
10853
10589
|
// JavaScript runs, because the services and their destinations are both known at
|
|
@@ -10855,7 +10591,7 @@ function PortalAccount({
|
|
|
10855
10591
|
// carry. This is the surface a crawler indexes and a patient with JS blocked
|
|
10856
10592
|
// keeps permanently, and for a launcher that is the whole feature rather than a
|
|
10857
10593
|
// degraded copy of it.
|
|
10858
|
-
/* @__PURE__ */
|
|
10594
|
+
/* @__PURE__ */ jsx22(
|
|
10859
10595
|
ServiceLauncherList,
|
|
10860
10596
|
{
|
|
10861
10597
|
services,
|
|
@@ -10863,9 +10599,9 @@ function PortalAccount({
|
|
|
10863
10599
|
clinicPhone
|
|
10864
10600
|
}
|
|
10865
10601
|
)
|
|
10866
|
-
) : /* @__PURE__ */
|
|
10867
|
-
/* @__PURE__ */
|
|
10868
|
-
/* @__PURE__ */
|
|
10602
|
+
) : /* @__PURE__ */ jsxs20("div", { className: "sk-portal-account__signin-card", children: [
|
|
10603
|
+
/* @__PURE__ */ jsx22("p", { className: "sk-portal-account__placeholder", children: SURFACE_PROMPT[surface] ?? "Sign in to see your account." }),
|
|
10604
|
+
/* @__PURE__ */ jsx22("a", { className: "sk-portal-link", href, children: "Sign in to your patient portal" })
|
|
10869
10605
|
] })
|
|
10870
10606
|
]
|
|
10871
10607
|
}
|
|
@@ -10874,7 +10610,7 @@ function PortalAccount({
|
|
|
10874
10610
|
|
|
10875
10611
|
// src/portal-book-launcher.client.tsx
|
|
10876
10612
|
import * as React18 from "react";
|
|
10877
|
-
import { jsx as
|
|
10613
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10878
10614
|
function PortalBookLauncher({
|
|
10879
10615
|
services,
|
|
10880
10616
|
funnelHref,
|
|
@@ -10908,7 +10644,7 @@ function PortalBookLauncher({
|
|
|
10908
10644
|
alive = false;
|
|
10909
10645
|
};
|
|
10910
10646
|
}, [publishableKey, apiBase]);
|
|
10911
|
-
return /* @__PURE__ */
|
|
10647
|
+
return /* @__PURE__ */ jsx23(
|
|
10912
10648
|
ServiceLauncherList,
|
|
10913
10649
|
{
|
|
10914
10650
|
services,
|
|
@@ -10921,7 +10657,7 @@ function PortalBookLauncher({
|
|
|
10921
10657
|
|
|
10922
10658
|
// src/portal-addresses.client.tsx
|
|
10923
10659
|
import * as React19 from "react";
|
|
10924
|
-
import { Fragment as Fragment9, jsx as
|
|
10660
|
+
import { Fragment as Fragment9, jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
10925
10661
|
var ADDRESSES_URL = "/portal/api/addresses";
|
|
10926
10662
|
var PORTAL_ADDRESSES_URL = ADDRESSES_URL;
|
|
10927
10663
|
var ADDRESS_SAVE_FAILED_COPY = "We couldn't save that address just now. Please try again.";
|
|
@@ -11061,16 +10797,16 @@ function PortalAccountAddresses({
|
|
|
11061
10797
|
applied(res, () => setDeletingId(null));
|
|
11062
10798
|
}
|
|
11063
10799
|
const set2 = (k) => (v) => setForm((prev) => ({ ...prev, [k]: v }));
|
|
11064
|
-
return /* @__PURE__ */
|
|
11065
|
-
error2 ? /* @__PURE__ */
|
|
11066
|
-
data.items.length === 0 && editing !== "new" ? /* @__PURE__ */
|
|
11067
|
-
data.items.length > 0 ? /* @__PURE__ */
|
|
11068
|
-
/* @__PURE__ */
|
|
11069
|
-
/* @__PURE__ */
|
|
11070
|
-
address.isPrimary ? /* @__PURE__ */
|
|
10800
|
+
return /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
10801
|
+
error2 ? /* @__PURE__ */ jsx24("p", { className: "sk-portal-error", role: "alert", children: error2 }) : null,
|
|
10802
|
+
data.items.length === 0 && editing !== "new" ? /* @__PURE__ */ jsx24("p", { className: "sk-portal-account__empty", children: "We don't have an address for you yet." }) : null,
|
|
10803
|
+
data.items.length > 0 ? /* @__PURE__ */ jsx24("ul", { className: "sk-portal-account__list", children: data.items.map((address) => /* @__PURE__ */ jsxs21("li", { className: "sk-portal-account__item", children: [
|
|
10804
|
+
/* @__PURE__ */ jsxs21("div", { className: "sk-portal-account__item-head", children: [
|
|
10805
|
+
/* @__PURE__ */ jsx24("span", { className: "sk-portal-account__item-title", children: address.label || formatPortalAddress(address) || "Address" }),
|
|
10806
|
+
address.isPrimary ? /* @__PURE__ */ jsx24("span", { className: "sk-portal-account__status", children: "Main address" }) : null
|
|
11071
10807
|
] }),
|
|
11072
|
-
address.label ? /* @__PURE__ */
|
|
11073
|
-
editing === address.id ? /* @__PURE__ */
|
|
10808
|
+
address.label ? /* @__PURE__ */ jsx24("span", { className: "sk-portal-account__item-meta", children: formatPortalAddress(address) }) : null,
|
|
10809
|
+
editing === address.id ? /* @__PURE__ */ jsx24(
|
|
11074
10810
|
AddressForm,
|
|
11075
10811
|
{
|
|
11076
10812
|
idPrefix: address.id,
|
|
@@ -11082,8 +10818,8 @@ function PortalAccountAddresses({
|
|
|
11082
10818
|
onCancel: () => setEditing(null),
|
|
11083
10819
|
client
|
|
11084
10820
|
}
|
|
11085
|
-
) : /* @__PURE__ */
|
|
11086
|
-
/* @__PURE__ */
|
|
10821
|
+
) : /* @__PURE__ */ jsxs21("div", { className: "sk-portal-account__actions", children: [
|
|
10822
|
+
/* @__PURE__ */ jsx24(
|
|
11087
10823
|
"button",
|
|
11088
10824
|
{
|
|
11089
10825
|
type: "button",
|
|
@@ -11092,7 +10828,7 @@ function PortalAccountAddresses({
|
|
|
11092
10828
|
children: "Edit"
|
|
11093
10829
|
}
|
|
11094
10830
|
),
|
|
11095
|
-
!address.isPrimary ? /* @__PURE__ */
|
|
10831
|
+
!address.isPrimary ? /* @__PURE__ */ jsx24(
|
|
11096
10832
|
"button",
|
|
11097
10833
|
{
|
|
11098
10834
|
type: "button",
|
|
@@ -11102,7 +10838,7 @@ function PortalAccountAddresses({
|
|
|
11102
10838
|
children: "Make main"
|
|
11103
10839
|
}
|
|
11104
10840
|
) : null,
|
|
11105
|
-
/* @__PURE__ */
|
|
10841
|
+
/* @__PURE__ */ jsx24(
|
|
11106
10842
|
"button",
|
|
11107
10843
|
{
|
|
11108
10844
|
type: "button",
|
|
@@ -11119,10 +10855,10 @@ function PortalAccountAddresses({
|
|
|
11119
10855
|
deletingId === address.id ? (
|
|
11120
10856
|
// In-place confirm, same as cancelling an appointment: removing the
|
|
11121
10857
|
// address a prescription is posted to is not an undo-able tap.
|
|
11122
|
-
/* @__PURE__ */
|
|
11123
|
-
/* @__PURE__ */
|
|
11124
|
-
/* @__PURE__ */
|
|
11125
|
-
/* @__PURE__ */
|
|
10858
|
+
/* @__PURE__ */ jsxs21("div", { className: "sk-portal-account__confirm", children: [
|
|
10859
|
+
/* @__PURE__ */ jsx24("p", { className: "sk-portal-account__confirm-title", children: "Remove this address?" }),
|
|
10860
|
+
/* @__PURE__ */ jsxs21("div", { className: "sk-portal-account__confirm-actions", children: [
|
|
10861
|
+
/* @__PURE__ */ jsx24(
|
|
11126
10862
|
"button",
|
|
11127
10863
|
{
|
|
11128
10864
|
type: "button",
|
|
@@ -11132,7 +10868,7 @@ function PortalAccountAddresses({
|
|
|
11132
10868
|
children: busy ? "Removing\u2026" : "Remove address"
|
|
11133
10869
|
}
|
|
11134
10870
|
),
|
|
11135
|
-
/* @__PURE__ */
|
|
10871
|
+
/* @__PURE__ */ jsx24(
|
|
11136
10872
|
"button",
|
|
11137
10873
|
{
|
|
11138
10874
|
type: "button",
|
|
@@ -11146,7 +10882,7 @@ function PortalAccountAddresses({
|
|
|
11146
10882
|
] })
|
|
11147
10883
|
) : null
|
|
11148
10884
|
] }, address.id)) }) : null,
|
|
11149
|
-
editing === "new" ? /* @__PURE__ */
|
|
10885
|
+
editing === "new" ? /* @__PURE__ */ jsx24(
|
|
11150
10886
|
AddressForm,
|
|
11151
10887
|
{
|
|
11152
10888
|
idPrefix: "new",
|
|
@@ -11158,7 +10894,7 @@ function PortalAccountAddresses({
|
|
|
11158
10894
|
onCancel: () => setEditing(null),
|
|
11159
10895
|
client
|
|
11160
10896
|
}
|
|
11161
|
-
) : /* @__PURE__ */
|
|
10897
|
+
) : /* @__PURE__ */ jsx24(
|
|
11162
10898
|
"button",
|
|
11163
10899
|
{
|
|
11164
10900
|
type: "button",
|
|
@@ -11181,8 +10917,8 @@ function AddressForm({
|
|
|
11181
10917
|
client
|
|
11182
10918
|
}) {
|
|
11183
10919
|
const id = (field) => `sk-portal-address-${field}-${idPrefix}`;
|
|
11184
|
-
return /* @__PURE__ */
|
|
11185
|
-
/* @__PURE__ */
|
|
10920
|
+
return /* @__PURE__ */ jsxs21("form", { className: "sk-portal-account__form", onSubmit, children: [
|
|
10921
|
+
/* @__PURE__ */ jsx24(
|
|
11186
10922
|
AddressPicker,
|
|
11187
10923
|
{
|
|
11188
10924
|
idPrefix: `sk-portal-address-${idPrefix}`,
|
|
@@ -11197,9 +10933,9 @@ function AddressForm({
|
|
|
11197
10933
|
validate: (address) => validatePortalAddress(address, client)
|
|
11198
10934
|
}
|
|
11199
10935
|
),
|
|
11200
|
-
/* @__PURE__ */
|
|
11201
|
-
/* @__PURE__ */
|
|
11202
|
-
/* @__PURE__ */
|
|
10936
|
+
/* @__PURE__ */ jsxs21("div", { className: "sk-portal-account__confirm-actions", children: [
|
|
10937
|
+
/* @__PURE__ */ jsx24("button", { className: "sk-portal-button", type: "submit", disabled: busy, children: busy ? "Saving\u2026" : submitLabel }),
|
|
10938
|
+
/* @__PURE__ */ jsx24(
|
|
11203
10939
|
"button",
|
|
11204
10940
|
{
|
|
11205
10941
|
type: "button",
|
|
@@ -11215,7 +10951,7 @@ function AddressForm({
|
|
|
11215
10951
|
|
|
11216
10952
|
// src/portal-consult.client.tsx
|
|
11217
10953
|
import * as React20 from "react";
|
|
11218
|
-
import { Fragment as Fragment10, jsx as
|
|
10954
|
+
import { Fragment as Fragment10, jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
11219
10955
|
function consultChunkUrl(base2 = import.meta.url) {
|
|
11220
10956
|
return new URL(CONSULT_CHUNK_PATH, base2).href;
|
|
11221
10957
|
}
|
|
@@ -11304,10 +11040,10 @@ function PortalConsultPanel({
|
|
|
11304
11040
|
document.addEventListener("keydown", onKeyDown);
|
|
11305
11041
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
11306
11042
|
}, []);
|
|
11307
|
-
return /* @__PURE__ */
|
|
11308
|
-
/* @__PURE__ */
|
|
11309
|
-
/* @__PURE__ */
|
|
11310
|
-
/* @__PURE__ */
|
|
11043
|
+
return /* @__PURE__ */ jsxs22("div", { className: "sk-consult", role: "group", "aria-label": "Video consult", children: [
|
|
11044
|
+
/* @__PURE__ */ jsxs22("div", { className: "sk-consult__head", children: [
|
|
11045
|
+
/* @__PURE__ */ jsx25("p", { className: "sk-consult__title", children: "Video consult" }),
|
|
11046
|
+
/* @__PURE__ */ jsx25(
|
|
11311
11047
|
"button",
|
|
11312
11048
|
{
|
|
11313
11049
|
type: "button",
|
|
@@ -11317,17 +11053,17 @@ function PortalConsultPanel({
|
|
|
11317
11053
|
}
|
|
11318
11054
|
)
|
|
11319
11055
|
] }),
|
|
11320
|
-
status === "loading" ? /* @__PURE__ */
|
|
11321
|
-
status === "failed" ? /* @__PURE__ */
|
|
11322
|
-
/* @__PURE__ */
|
|
11323
|
-
/* @__PURE__ */
|
|
11056
|
+
status === "loading" ? /* @__PURE__ */ jsx25("p", { className: "sk-portal-account__placeholder", role: "status", children: "Starting your video call\u2026" }) : null,
|
|
11057
|
+
status === "failed" ? /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
11058
|
+
/* @__PURE__ */ jsx25("p", { className: "sk-portal-error", role: "alert", children: error2 ?? CONSULT_LOAD_FAILED_COPY }),
|
|
11059
|
+
/* @__PURE__ */ jsx25("a", { className: "sk-portal-button", href: fallbackHref, children: CONSULT_FALLBACK_LINK_COPY })
|
|
11324
11060
|
] }) : null,
|
|
11325
|
-
/* @__PURE__ */
|
|
11061
|
+
/* @__PURE__ */ jsx25("div", { className: "sk-consult__host", ref: hostRef })
|
|
11326
11062
|
] });
|
|
11327
11063
|
}
|
|
11328
11064
|
|
|
11329
11065
|
// src/portal-account.client.tsx
|
|
11330
|
-
import { Fragment as Fragment11, jsx as
|
|
11066
|
+
import { Fragment as Fragment11, jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
11331
11067
|
var APPOINTMENTS_URL = "/portal/api/appointments";
|
|
11332
11068
|
var CANCEL_REASONS_URL = "/portal/api/appointments/cancel-reasons";
|
|
11333
11069
|
var DOCUMENTS_URL = "/portal/api/documents";
|
|
@@ -11448,12 +11184,12 @@ function PortalAccountClient(props) {
|
|
|
11448
11184
|
}),
|
|
11449
11185
|
[props.portalApiOrigin, props.portalUrl, props.fetchImpl]
|
|
11450
11186
|
);
|
|
11451
|
-
return /* @__PURE__ */
|
|
11187
|
+
return /* @__PURE__ */ jsx26(PortalProvider, { client, children: /* @__PURE__ */ jsx26(PortalAccountContent, { ...props }) });
|
|
11452
11188
|
}
|
|
11453
11189
|
function PortalAccountContent(props) {
|
|
11454
11190
|
const { surface } = props;
|
|
11455
|
-
if (surface === "book") return /* @__PURE__ */
|
|
11456
|
-
return /* @__PURE__ */
|
|
11191
|
+
if (surface === "book") return /* @__PURE__ */ jsx26(PortalAccountBookLauncher, { ...props });
|
|
11192
|
+
return /* @__PURE__ */ jsx26(PortalAccountSurfaceClient, { ...props, surface });
|
|
11457
11193
|
}
|
|
11458
11194
|
function PortalAccountBookLauncher({
|
|
11459
11195
|
funnelHref,
|
|
@@ -11461,9 +11197,9 @@ function PortalAccountBookLauncher({
|
|
|
11461
11197
|
publicApi,
|
|
11462
11198
|
clinicPhone
|
|
11463
11199
|
}) {
|
|
11464
|
-
return /* @__PURE__ */
|
|
11465
|
-
/* @__PURE__ */
|
|
11466
|
-
/* @__PURE__ */
|
|
11200
|
+
return /* @__PURE__ */ jsxs23("section", { className: "sk-portal-account__body", children: [
|
|
11201
|
+
/* @__PURE__ */ jsx26("h2", { className: "sk-portal-account__heading", children: PORTAL_ACCOUNT_HEADING.book }),
|
|
11202
|
+
/* @__PURE__ */ jsx26(
|
|
11467
11203
|
PortalBookLauncher,
|
|
11468
11204
|
{
|
|
11469
11205
|
services: services ?? [],
|
|
@@ -11521,12 +11257,12 @@ function PortalAccountSurfaceClient({
|
|
|
11521
11257
|
(prev) => prev.kind === "signed-in" ? { ...prev, data, givenName: refetched === void 0 ? prev.givenName : refetched } : prev
|
|
11522
11258
|
);
|
|
11523
11259
|
}
|
|
11524
|
-
return /* @__PURE__ */
|
|
11525
|
-
/* @__PURE__ */
|
|
11526
|
-
state.kind === "loading" && !state.hinted ? /* @__PURE__ */
|
|
11527
|
-
state.kind === "loading" && state.hinted ? /* @__PURE__ */
|
|
11528
|
-
state.kind === "link-out" ? /* @__PURE__ */
|
|
11529
|
-
state.kind === "signed-out" ? /* @__PURE__ */
|
|
11260
|
+
return /* @__PURE__ */ jsxs23("section", { className: "sk-portal-account__body", "aria-busy": state.kind === "loading", children: [
|
|
11261
|
+
/* @__PURE__ */ jsx26("h2", { className: "sk-portal-account__heading", children: heading2 }),
|
|
11262
|
+
state.kind === "loading" && !state.hinted ? /* @__PURE__ */ jsx26("p", { className: "sk-portal-account__placeholder", children: "Checking your sign-in\u2026" }) : null,
|
|
11263
|
+
state.kind === "loading" && state.hinted ? /* @__PURE__ */ jsx26(PortalAccountSkeleton, {}) : null,
|
|
11264
|
+
state.kind === "link-out" ? /* @__PURE__ */ jsx26("p", { className: "sk-portal-account__placeholder", children: /* @__PURE__ */ jsx26("a", { className: "sk-portal-link", href: base2, children: "Sign in to your patient portal" }) }) : null,
|
|
11265
|
+
state.kind === "signed-out" ? /* @__PURE__ */ jsx26(
|
|
11530
11266
|
PortalSignInRamp,
|
|
11531
11267
|
{
|
|
11532
11268
|
idSuffix: `account-${surface}`,
|
|
@@ -11534,13 +11270,13 @@ function PortalAccountSurfaceClient({
|
|
|
11534
11270
|
onResult: ({ ok, email }) => setState(ok ? { kind: "link-sent", email } : { kind: "link-out" })
|
|
11535
11271
|
}
|
|
11536
11272
|
) : null,
|
|
11537
|
-
state.kind === "link-sent" ? /* @__PURE__ */
|
|
11538
|
-
state.kind === "not-available" || state.kind === "signed-in" ? /* @__PURE__ */
|
|
11539
|
-
/* @__PURE__ */
|
|
11273
|
+
state.kind === "link-sent" ? /* @__PURE__ */ jsx26(PortalLinkSentNotice, { email: state.email }) : null,
|
|
11274
|
+
state.kind === "not-available" || state.kind === "signed-in" ? /* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__header", children: [
|
|
11275
|
+
/* @__PURE__ */ jsxs23("span", { className: "sk-portal-account__who", children: [
|
|
11540
11276
|
"Signed in as ",
|
|
11541
11277
|
state.givenName ?? "you"
|
|
11542
11278
|
] }),
|
|
11543
|
-
/* @__PURE__ */
|
|
11279
|
+
/* @__PURE__ */ jsx26(
|
|
11544
11280
|
"button",
|
|
11545
11281
|
{
|
|
11546
11282
|
type: "button",
|
|
@@ -11551,8 +11287,8 @@ function PortalAccountSurfaceClient({
|
|
|
11551
11287
|
}
|
|
11552
11288
|
)
|
|
11553
11289
|
] }) : null,
|
|
11554
|
-
state.kind === "not-available" ? /* @__PURE__ */
|
|
11555
|
-
state.kind === "signed-in" && surface === "appointments" ? /* @__PURE__ */
|
|
11290
|
+
state.kind === "not-available" ? /* @__PURE__ */ jsx26("p", { className: "sk-portal-account__note", role: "note", children: "This isn't available online at this clinic." }) : null,
|
|
11291
|
+
state.kind === "signed-in" && surface === "appointments" ? /* @__PURE__ */ jsx26(
|
|
11556
11292
|
PortalAccountAppointments,
|
|
11557
11293
|
{
|
|
11558
11294
|
data: state.data,
|
|
@@ -11562,7 +11298,7 @@ function PortalAccountSurfaceClient({
|
|
|
11562
11298
|
onReloaded: replaceData
|
|
11563
11299
|
}
|
|
11564
11300
|
) : null,
|
|
11565
|
-
state.kind === "signed-in" && surface === "addresses" ? /* @__PURE__ */
|
|
11301
|
+
state.kind === "signed-in" && surface === "addresses" ? /* @__PURE__ */ jsx26(
|
|
11566
11302
|
PortalAccountAddresses,
|
|
11567
11303
|
{
|
|
11568
11304
|
data: state.data,
|
|
@@ -11571,7 +11307,7 @@ function PortalAccountSurfaceClient({
|
|
|
11571
11307
|
onReloaded: replaceData
|
|
11572
11308
|
}
|
|
11573
11309
|
) : null,
|
|
11574
|
-
state.kind === "signed-in" && surface === "documents" ? /* @__PURE__ */
|
|
11310
|
+
state.kind === "signed-in" && surface === "documents" ? /* @__PURE__ */ jsx26(
|
|
11575
11311
|
PortalAccountDocuments,
|
|
11576
11312
|
{
|
|
11577
11313
|
data: state.data,
|
|
@@ -11579,7 +11315,7 @@ function PortalAccountSurfaceClient({
|
|
|
11579
11315
|
openUrl
|
|
11580
11316
|
}
|
|
11581
11317
|
) : null,
|
|
11582
|
-
state.kind === "signed-in" && surface === "orders" ? /* @__PURE__ */
|
|
11318
|
+
state.kind === "signed-in" && surface === "orders" ? /* @__PURE__ */ jsx26(
|
|
11583
11319
|
PortalAccountOrders,
|
|
11584
11320
|
{
|
|
11585
11321
|
data: state.data,
|
|
@@ -11587,7 +11323,7 @@ function PortalAccountSurfaceClient({
|
|
|
11587
11323
|
openUrl
|
|
11588
11324
|
}
|
|
11589
11325
|
) : null,
|
|
11590
|
-
state.kind === "signed-in" && surface === "profile" ? /* @__PURE__ */
|
|
11326
|
+
state.kind === "signed-in" && surface === "profile" ? /* @__PURE__ */ jsx26(
|
|
11591
11327
|
PortalAccountProfile,
|
|
11592
11328
|
{
|
|
11593
11329
|
data: state.data,
|
|
@@ -11598,19 +11334,19 @@ function PortalAccountSurfaceClient({
|
|
|
11598
11334
|
] });
|
|
11599
11335
|
}
|
|
11600
11336
|
function PortalAccountSkeleton() {
|
|
11601
|
-
return /* @__PURE__ */
|
|
11602
|
-
/* @__PURE__ */
|
|
11603
|
-
/* @__PURE__ */
|
|
11604
|
-
/* @__PURE__ */
|
|
11337
|
+
return /* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__skeleton", "aria-hidden": "true", children: [
|
|
11338
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__skeleton-row" }),
|
|
11339
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__skeleton-row" }),
|
|
11340
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__skeleton-row" })
|
|
11605
11341
|
] });
|
|
11606
11342
|
}
|
|
11607
11343
|
function StatusBadge({ status }) {
|
|
11608
11344
|
if (!status) return null;
|
|
11609
|
-
return /* @__PURE__ */
|
|
11345
|
+
return /* @__PURE__ */ jsx26("span", { className: "sk-portal-account__status", children: status });
|
|
11610
11346
|
}
|
|
11611
11347
|
function ErrorNote({ message }) {
|
|
11612
11348
|
if (!message) return null;
|
|
11613
|
-
return /* @__PURE__ */
|
|
11349
|
+
return /* @__PURE__ */ jsx26("p", { className: "sk-portal-error", role: "alert", children: message });
|
|
11614
11350
|
}
|
|
11615
11351
|
function PortalAccountAppointments({
|
|
11616
11352
|
data,
|
|
@@ -11664,21 +11400,21 @@ function PortalAccountAppointments({
|
|
|
11664
11400
|
{ key: "past", title: "Past", items: data.past }
|
|
11665
11401
|
];
|
|
11666
11402
|
const empty = data.upcoming.length === 0 && data.past.length === 0;
|
|
11667
|
-
return /* @__PURE__ */
|
|
11668
|
-
empty ? /* @__PURE__ */
|
|
11669
|
-
/* @__PURE__ */
|
|
11670
|
-
/* @__PURE__ */
|
|
11403
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
11404
|
+
empty ? /* @__PURE__ */ jsx26("p", { className: "sk-portal-account__empty", children: "You have no appointments with us yet." }) : groups.filter((g) => g.items.length > 0).map((group) => /* @__PURE__ */ jsxs23("section", { className: "sk-portal-account__group", children: [
|
|
11405
|
+
/* @__PURE__ */ jsx26("h3", { className: "sk-portal-account__group-title", children: group.title }),
|
|
11406
|
+
/* @__PURE__ */ jsx26("ul", { className: "sk-portal-account__list", children: group.items.map((item) => {
|
|
11671
11407
|
const join = consultJoinAffordance(item, now);
|
|
11672
|
-
return /* @__PURE__ */
|
|
11673
|
-
/* @__PURE__ */
|
|
11674
|
-
/* @__PURE__ */
|
|
11675
|
-
item.telehealth ? /* @__PURE__ */
|
|
11676
|
-
/* @__PURE__ */
|
|
11408
|
+
return /* @__PURE__ */ jsxs23("li", { className: "sk-portal-account__item", children: [
|
|
11409
|
+
/* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__item-head", children: [
|
|
11410
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__item-title", children: item.title ?? "\u2014" }),
|
|
11411
|
+
item.telehealth ? /* @__PURE__ */ jsx26("span", { className: "sk-portal-account__status", children: "Telehealth" }) : null,
|
|
11412
|
+
/* @__PURE__ */ jsx26(StatusBadge, { status: item.status })
|
|
11677
11413
|
] }),
|
|
11678
|
-
/* @__PURE__ */
|
|
11679
|
-
item.locationName || item.practitionerName ? /* @__PURE__ */
|
|
11680
|
-
/* @__PURE__ */
|
|
11681
|
-
join.kind === "join" ? /* @__PURE__ */
|
|
11414
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__item-meta", children: formatPortalDateTime(item.start, item.timezone) ?? "Time to be confirmed" }),
|
|
11415
|
+
item.locationName || item.practitionerName ? /* @__PURE__ */ jsx26("span", { className: "sk-portal-account__item-meta", children: [item.locationName, item.practitionerName].filter(Boolean).join(" \xB7 ") }) : null,
|
|
11416
|
+
/* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__actions", children: [
|
|
11417
|
+
join.kind === "join" ? /* @__PURE__ */ jsx26(
|
|
11682
11418
|
"button",
|
|
11683
11419
|
{
|
|
11684
11420
|
type: "button",
|
|
@@ -11695,7 +11431,7 @@ function PortalAccountAppointments({
|
|
|
11695
11431
|
item.canReschedule ? (
|
|
11696
11432
|
// INLINE since PAT-789. It was a link into the portal; the round
|
|
11697
11433
|
// trip through a second host to pick a time was the seam.
|
|
11698
|
-
/* @__PURE__ */
|
|
11434
|
+
/* @__PURE__ */ jsx26(
|
|
11699
11435
|
"button",
|
|
11700
11436
|
{
|
|
11701
11437
|
type: "button",
|
|
@@ -11709,7 +11445,7 @@ function PortalAccountAppointments({
|
|
|
11709
11445
|
}
|
|
11710
11446
|
)
|
|
11711
11447
|
) : null,
|
|
11712
|
-
item.canCancel ? /* @__PURE__ */
|
|
11448
|
+
item.canCancel ? /* @__PURE__ */ jsx26(
|
|
11713
11449
|
"button",
|
|
11714
11450
|
{
|
|
11715
11451
|
type: "button",
|
|
@@ -11720,11 +11456,11 @@ function PortalAccountAppointments({
|
|
|
11720
11456
|
}
|
|
11721
11457
|
) : null
|
|
11722
11458
|
] }),
|
|
11723
|
-
join.kind === "opens-at" ? /* @__PURE__ */
|
|
11459
|
+
join.kind === "opens-at" ? /* @__PURE__ */ jsxs23("span", { className: "sk-portal-account__item-meta", role: "note", children: [
|
|
11724
11460
|
"Video opens at ",
|
|
11725
11461
|
formatPortalTime(join.at, item.timezone) ?? "your appointment time"
|
|
11726
11462
|
] }) : null,
|
|
11727
|
-
consultFor === item.id ? /* @__PURE__ */
|
|
11463
|
+
consultFor === item.id ? /* @__PURE__ */ jsx26(
|
|
11728
11464
|
PortalConsultPanel,
|
|
11729
11465
|
{
|
|
11730
11466
|
appointmentId: item.id,
|
|
@@ -11734,7 +11470,7 @@ function PortalAccountAppointments({
|
|
|
11734
11470
|
loadModule: loadConsultModule2
|
|
11735
11471
|
}
|
|
11736
11472
|
) : null,
|
|
11737
|
-
rescheduleFor === item.id ? /* @__PURE__ */
|
|
11473
|
+
rescheduleFor === item.id ? /* @__PURE__ */ jsx26(
|
|
11738
11474
|
PortalRescheduleInline,
|
|
11739
11475
|
{
|
|
11740
11476
|
appointment: item,
|
|
@@ -11746,12 +11482,12 @@ function PortalAccountAppointments({
|
|
|
11746
11482
|
onClose: () => setRescheduleFor(null)
|
|
11747
11483
|
}
|
|
11748
11484
|
) : null,
|
|
11749
|
-
cancelFor === item.id ? /* @__PURE__ */
|
|
11750
|
-
/* @__PURE__ */
|
|
11751
|
-
reasons.length > 0 ? /* @__PURE__ */
|
|
11752
|
-
/* @__PURE__ */
|
|
11753
|
-
reasons.map((reason) => /* @__PURE__ */
|
|
11754
|
-
/* @__PURE__ */
|
|
11485
|
+
cancelFor === item.id ? /* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__confirm", children: [
|
|
11486
|
+
/* @__PURE__ */ jsx26("p", { className: "sk-portal-account__confirm-title", children: "Cancel this appointment?" }),
|
|
11487
|
+
reasons.length > 0 ? /* @__PURE__ */ jsxs23("fieldset", { className: "sk-portal-account__reasons", children: [
|
|
11488
|
+
/* @__PURE__ */ jsx26("legend", { className: "sk-portal-label", children: "Reason (optional)" }),
|
|
11489
|
+
reasons.map((reason) => /* @__PURE__ */ jsxs23("label", { className: "sk-portal-account__reason", children: [
|
|
11490
|
+
/* @__PURE__ */ jsx26(
|
|
11755
11491
|
"input",
|
|
11756
11492
|
{
|
|
11757
11493
|
type: "radio",
|
|
@@ -11764,7 +11500,7 @@ function PortalAccountAppointments({
|
|
|
11764
11500
|
reason.label
|
|
11765
11501
|
] }, reason.id))
|
|
11766
11502
|
] }) : null,
|
|
11767
|
-
/* @__PURE__ */
|
|
11503
|
+
/* @__PURE__ */ jsx26(
|
|
11768
11504
|
"label",
|
|
11769
11505
|
{
|
|
11770
11506
|
className: "sk-portal-label",
|
|
@@ -11772,7 +11508,7 @@ function PortalAccountAppointments({
|
|
|
11772
11508
|
children: "Anything you'd like us to know? (optional)"
|
|
11773
11509
|
}
|
|
11774
11510
|
),
|
|
11775
|
-
/* @__PURE__ */
|
|
11511
|
+
/* @__PURE__ */ jsx26(
|
|
11776
11512
|
"textarea",
|
|
11777
11513
|
{
|
|
11778
11514
|
id: `sk-portal-cancel-note-${item.id}`,
|
|
@@ -11782,9 +11518,9 @@ function PortalAccountAppointments({
|
|
|
11782
11518
|
onChange: (e) => setNote(e.target.value)
|
|
11783
11519
|
}
|
|
11784
11520
|
),
|
|
11785
|
-
/* @__PURE__ */
|
|
11786
|
-
/* @__PURE__ */
|
|
11787
|
-
/* @__PURE__ */
|
|
11521
|
+
/* @__PURE__ */ jsx26(ErrorNote, { message: error2 }),
|
|
11522
|
+
/* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__confirm-actions", children: [
|
|
11523
|
+
/* @__PURE__ */ jsx26(
|
|
11788
11524
|
"button",
|
|
11789
11525
|
{
|
|
11790
11526
|
type: "button",
|
|
@@ -11794,7 +11530,7 @@ function PortalAccountAppointments({
|
|
|
11794
11530
|
children: busy ? "Cancelling\u2026" : "Cancel appointment"
|
|
11795
11531
|
}
|
|
11796
11532
|
),
|
|
11797
|
-
/* @__PURE__ */
|
|
11533
|
+
/* @__PURE__ */ jsx26(
|
|
11798
11534
|
"button",
|
|
11799
11535
|
{
|
|
11800
11536
|
type: "button",
|
|
@@ -11812,7 +11548,7 @@ function PortalAccountAppointments({
|
|
|
11812
11548
|
] }, item.id);
|
|
11813
11549
|
}) })
|
|
11814
11550
|
] }, group.key)),
|
|
11815
|
-
/* @__PURE__ */
|
|
11551
|
+
/* @__PURE__ */ jsx26("a", { className: "sk-portal-button", href: portalBookHref(bookHref), children: "Book an appointment" })
|
|
11816
11552
|
] });
|
|
11817
11553
|
}
|
|
11818
11554
|
function PortalAccountDocuments({
|
|
@@ -11832,17 +11568,17 @@ function PortalAccountDocuments({
|
|
|
11832
11568
|
if (!res.ok) setError(res.error ?? DOWNLOAD_FAILED_COPY);
|
|
11833
11569
|
}
|
|
11834
11570
|
if (data.items.length === 0) {
|
|
11835
|
-
return /* @__PURE__ */
|
|
11836
|
-
}
|
|
11837
|
-
return /* @__PURE__ */
|
|
11838
|
-
/* @__PURE__ */
|
|
11839
|
-
/* @__PURE__ */
|
|
11840
|
-
/* @__PURE__ */
|
|
11841
|
-
/* @__PURE__ */
|
|
11842
|
-
/* @__PURE__ */
|
|
11571
|
+
return /* @__PURE__ */ jsx26("p", { className: "sk-portal-account__empty", children: "You have no documents from us yet." });
|
|
11572
|
+
}
|
|
11573
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
11574
|
+
/* @__PURE__ */ jsx26(ErrorNote, { message: error2 }),
|
|
11575
|
+
/* @__PURE__ */ jsx26("ul", { className: "sk-portal-account__list", children: data.items.map((doc) => /* @__PURE__ */ jsxs23("li", { className: "sk-portal-account__item", children: [
|
|
11576
|
+
/* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__item-head", children: [
|
|
11577
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__item-title", children: doc.title ?? "Document" }),
|
|
11578
|
+
/* @__PURE__ */ jsx26(StatusBadge, { status: doc.status })
|
|
11843
11579
|
] }),
|
|
11844
|
-
/* @__PURE__ */
|
|
11845
|
-
/* @__PURE__ */
|
|
11580
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__item-meta", children: formatPortalDate(doc.date) ?? "" }),
|
|
11581
|
+
/* @__PURE__ */ jsx26("div", { className: "sk-portal-account__actions", children: /* @__PURE__ */ jsx26(
|
|
11846
11582
|
"button",
|
|
11847
11583
|
{
|
|
11848
11584
|
type: "button",
|
|
@@ -11884,14 +11620,14 @@ function PortalAccountOrders({
|
|
|
11884
11620
|
if (!res.ok) setError(res.error ?? RECEIPT_FAILED_COPY);
|
|
11885
11621
|
}
|
|
11886
11622
|
if (data.items.length === 0) {
|
|
11887
|
-
return /* @__PURE__ */
|
|
11623
|
+
return /* @__PURE__ */ jsx26("p", { className: "sk-portal-account__empty", children: "You haven't ordered anything from us yet." });
|
|
11888
11624
|
}
|
|
11889
|
-
return /* @__PURE__ */
|
|
11890
|
-
/* @__PURE__ */
|
|
11891
|
-
/* @__PURE__ */
|
|
11625
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
11626
|
+
/* @__PURE__ */ jsx26(ErrorNote, { message: error2 }),
|
|
11627
|
+
/* @__PURE__ */ jsx26("ul", { className: "sk-portal-account__list", children: data.items.map((order) => {
|
|
11892
11628
|
const open = expandedId === order.id;
|
|
11893
|
-
return /* @__PURE__ */
|
|
11894
|
-
/* @__PURE__ */
|
|
11629
|
+
return /* @__PURE__ */ jsxs23("li", { className: "sk-portal-account__item", children: [
|
|
11630
|
+
/* @__PURE__ */ jsxs23(
|
|
11895
11631
|
"button",
|
|
11896
11632
|
{
|
|
11897
11633
|
type: "button",
|
|
@@ -11899,9 +11635,9 @@ function PortalAccountOrders({
|
|
|
11899
11635
|
"aria-expanded": open,
|
|
11900
11636
|
onClick: () => void toggle(order.id),
|
|
11901
11637
|
children: [
|
|
11902
|
-
/* @__PURE__ */
|
|
11903
|
-
/* @__PURE__ */
|
|
11904
|
-
/* @__PURE__ */
|
|
11638
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__item-title", children: order.title ?? "Order" }),
|
|
11639
|
+
/* @__PURE__ */ jsx26(StatusBadge, { status: order.status }),
|
|
11640
|
+
/* @__PURE__ */ jsx26("span", { className: "sk-portal-account__item-meta", children: [
|
|
11905
11641
|
formatPortalDate(order.placedAt),
|
|
11906
11642
|
order.paymentStatus,
|
|
11907
11643
|
formatPortalMoney(order.total, order.currency)
|
|
@@ -11909,19 +11645,19 @@ function PortalAccountOrders({
|
|
|
11909
11645
|
]
|
|
11910
11646
|
}
|
|
11911
11647
|
),
|
|
11912
|
-
open ? /* @__PURE__ */
|
|
11913
|
-
/* @__PURE__ */
|
|
11914
|
-
/* @__PURE__ */
|
|
11648
|
+
open ? /* @__PURE__ */ jsx26("div", { className: "sk-portal-account__detail", children: loading ? /* @__PURE__ */ jsx26("p", { className: "sk-portal-account__placeholder", role: "status", children: "Loading this order\u2026" }) : !detail ? /* @__PURE__ */ jsx26("p", { className: "sk-portal-account__note", role: "note", children: "We couldn't load this order just now." }) : /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
11649
|
+
/* @__PURE__ */ jsx26("ul", { className: "sk-portal-account__lines", children: (detail.lines ?? []).map((line) => /* @__PURE__ */ jsxs23("li", { className: "sk-portal-account__line", children: [
|
|
11650
|
+
/* @__PURE__ */ jsxs23("span", { children: [
|
|
11915
11651
|
line.title ?? "\u2014",
|
|
11916
11652
|
line.quantity && line.quantity > 1 ? ` \xD7 ${line.quantity}` : ""
|
|
11917
11653
|
] }),
|
|
11918
|
-
/* @__PURE__ */
|
|
11654
|
+
/* @__PURE__ */ jsx26("span", { children: formatPortalMoney(line.total, detail.currency) ?? "" })
|
|
11919
11655
|
] }, line.id)) }),
|
|
11920
|
-
/* @__PURE__ */
|
|
11656
|
+
/* @__PURE__ */ jsxs23("p", { className: "sk-portal-account__total", children: [
|
|
11921
11657
|
"Total ",
|
|
11922
11658
|
formatPortalMoney(detail.total, detail.currency) ?? ""
|
|
11923
11659
|
] }),
|
|
11924
|
-
detail.hasReceipt !== false ? /* @__PURE__ */
|
|
11660
|
+
detail.hasReceipt !== false ? /* @__PURE__ */ jsx26("div", { className: "sk-portal-account__actions", children: /* @__PURE__ */ jsx26(
|
|
11925
11661
|
"button",
|
|
11926
11662
|
{
|
|
11927
11663
|
type: "button",
|
|
@@ -11962,15 +11698,15 @@ function PortalAccountProfile({
|
|
|
11962
11698
|
onSaved(res.data);
|
|
11963
11699
|
}
|
|
11964
11700
|
if (!editing) {
|
|
11965
|
-
return /* @__PURE__ */
|
|
11966
|
-
/* @__PURE__ */
|
|
11967
|
-
/* @__PURE__ */
|
|
11968
|
-
/* @__PURE__ */
|
|
11969
|
-
/* @__PURE__ */
|
|
11970
|
-
/* @__PURE__ */
|
|
11971
|
-
/* @__PURE__ */
|
|
11701
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
11702
|
+
/* @__PURE__ */ jsxs23("dl", { className: "sk-portal-account__fields", children: [
|
|
11703
|
+
/* @__PURE__ */ jsx26(Field2, { label: "First name", value: data.givenName }),
|
|
11704
|
+
/* @__PURE__ */ jsx26(Field2, { label: "Last name", value: data.familyName }),
|
|
11705
|
+
/* @__PURE__ */ jsx26(Field2, { label: "Email", value: data.email }),
|
|
11706
|
+
/* @__PURE__ */ jsx26(Field2, { label: "Mobile", value: data.phone }),
|
|
11707
|
+
/* @__PURE__ */ jsx26(Field2, { label: "Date of birth", value: formatPortalDate(data.dateOfBirth) })
|
|
11972
11708
|
] }),
|
|
11973
|
-
/* @__PURE__ */
|
|
11709
|
+
/* @__PURE__ */ jsx26(
|
|
11974
11710
|
"button",
|
|
11975
11711
|
{
|
|
11976
11712
|
type: "button",
|
|
@@ -11987,9 +11723,9 @@ function PortalAccountProfile({
|
|
|
11987
11723
|
)
|
|
11988
11724
|
] });
|
|
11989
11725
|
}
|
|
11990
|
-
return /* @__PURE__ */
|
|
11991
|
-
/* @__PURE__ */
|
|
11992
|
-
/* @__PURE__ */
|
|
11726
|
+
return /* @__PURE__ */ jsxs23("form", { className: "sk-portal-account__form", onSubmit: (e) => void save(e), children: [
|
|
11727
|
+
/* @__PURE__ */ jsx26("label", { className: "sk-portal-label", htmlFor: "sk-portal-given-name", children: "First name" }),
|
|
11728
|
+
/* @__PURE__ */ jsx26(
|
|
11993
11729
|
"input",
|
|
11994
11730
|
{
|
|
11995
11731
|
id: "sk-portal-given-name",
|
|
@@ -12000,8 +11736,8 @@ function PortalAccountProfile({
|
|
|
12000
11736
|
onChange: (e) => setGivenName(e.target.value)
|
|
12001
11737
|
}
|
|
12002
11738
|
),
|
|
12003
|
-
/* @__PURE__ */
|
|
12004
|
-
/* @__PURE__ */
|
|
11739
|
+
/* @__PURE__ */ jsx26("label", { className: "sk-portal-label", htmlFor: "sk-portal-family-name", children: "Last name" }),
|
|
11740
|
+
/* @__PURE__ */ jsx26(
|
|
12005
11741
|
"input",
|
|
12006
11742
|
{
|
|
12007
11743
|
id: "sk-portal-family-name",
|
|
@@ -12012,8 +11748,8 @@ function PortalAccountProfile({
|
|
|
12012
11748
|
onChange: (e) => setFamilyName(e.target.value)
|
|
12013
11749
|
}
|
|
12014
11750
|
),
|
|
12015
|
-
/* @__PURE__ */
|
|
12016
|
-
/* @__PURE__ */
|
|
11751
|
+
/* @__PURE__ */ jsx26("label", { className: "sk-portal-label", htmlFor: "sk-portal-phone", children: "Mobile" }),
|
|
11752
|
+
/* @__PURE__ */ jsx26(
|
|
12017
11753
|
"input",
|
|
12018
11754
|
{
|
|
12019
11755
|
id: "sk-portal-phone",
|
|
@@ -12025,15 +11761,15 @@ function PortalAccountProfile({
|
|
|
12025
11761
|
onChange: (e) => setPhone(e.target.value)
|
|
12026
11762
|
}
|
|
12027
11763
|
),
|
|
12028
|
-
/* @__PURE__ */
|
|
12029
|
-
/* @__PURE__ */
|
|
12030
|
-
/* @__PURE__ */
|
|
11764
|
+
/* @__PURE__ */ jsxs23("dl", { className: "sk-portal-account__fields", children: [
|
|
11765
|
+
/* @__PURE__ */ jsx26(Field2, { label: "Email", value: data.email }),
|
|
11766
|
+
/* @__PURE__ */ jsx26(Field2, { label: "Date of birth", value: formatPortalDate(data.dateOfBirth) })
|
|
12031
11767
|
] }),
|
|
12032
|
-
/* @__PURE__ */
|
|
12033
|
-
/* @__PURE__ */
|
|
12034
|
-
/* @__PURE__ */
|
|
12035
|
-
/* @__PURE__ */
|
|
12036
|
-
/* @__PURE__ */
|
|
11768
|
+
/* @__PURE__ */ jsx26("p", { className: "sk-portal-account__hint", children: "Your email and date of birth identify your record \u2014 call the clinic to change either." }),
|
|
11769
|
+
/* @__PURE__ */ jsx26(ErrorNote, { message: error2 }),
|
|
11770
|
+
/* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__confirm-actions", children: [
|
|
11771
|
+
/* @__PURE__ */ jsx26("button", { className: "sk-portal-button", type: "submit", disabled: saving, children: saving ? "Saving\u2026" : "Save details" }),
|
|
11772
|
+
/* @__PURE__ */ jsx26(
|
|
12037
11773
|
"button",
|
|
12038
11774
|
{
|
|
12039
11775
|
type: "button",
|
|
@@ -12047,772 +11783,9 @@ function PortalAccountProfile({
|
|
|
12047
11783
|
] });
|
|
12048
11784
|
}
|
|
12049
11785
|
function Field2({ label, value }) {
|
|
12050
|
-
return /* @__PURE__ */
|
|
12051
|
-
/* @__PURE__ */
|
|
12052
|
-
/* @__PURE__ */
|
|
12053
|
-
] });
|
|
12054
|
-
}
|
|
12055
|
-
|
|
12056
|
-
// src/store-block.client.tsx
|
|
12057
|
-
import * as React22 from "react";
|
|
12058
|
-
|
|
12059
|
-
// src/cart-storage.ts
|
|
12060
|
-
var CART_STORAGE_KEY = "patientos.cart.v1";
|
|
12061
|
-
var MAX_LINES = 50;
|
|
12062
|
-
var MAX_QUANTITY = 99;
|
|
12063
|
-
function emptyCart() {
|
|
12064
|
-
return { v: 1, lines: [] };
|
|
12065
|
-
}
|
|
12066
|
-
var EMPTY_CART = Object.freeze({
|
|
12067
|
-
v: 1,
|
|
12068
|
-
lines: Object.freeze([])
|
|
12069
|
-
});
|
|
12070
|
-
function storage() {
|
|
12071
|
-
try {
|
|
12072
|
-
if (typeof window === "undefined" || !window.localStorage) return null;
|
|
12073
|
-
return window.localStorage;
|
|
12074
|
-
} catch {
|
|
12075
|
-
return null;
|
|
12076
|
-
}
|
|
12077
|
-
}
|
|
12078
|
-
function parseLine(raw) {
|
|
12079
|
-
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
12080
|
-
const line = raw;
|
|
12081
|
-
const variantId = typeof line.variantId === "string" ? line.variantId.trim() : "";
|
|
12082
|
-
if (!variantId) return null;
|
|
12083
|
-
const kind = line.kind === "retail" ? "retail" : "fill";
|
|
12084
|
-
const n = typeof line.quantity === "number" ? line.quantity : Number(line.quantity);
|
|
12085
|
-
if (!Number.isFinite(n)) return null;
|
|
12086
|
-
const quantity = Math.min(Math.max(Math.floor(n), 1), MAX_QUANTITY);
|
|
12087
|
-
return { kind, variantId, quantity };
|
|
12088
|
-
}
|
|
12089
|
-
function readCart() {
|
|
12090
|
-
const store = storage();
|
|
12091
|
-
if (!store) return emptyCart();
|
|
12092
|
-
let raw;
|
|
12093
|
-
try {
|
|
12094
|
-
raw = store.getItem(CART_STORAGE_KEY);
|
|
12095
|
-
} catch {
|
|
12096
|
-
return emptyCart();
|
|
12097
|
-
}
|
|
12098
|
-
if (!raw) return emptyCart();
|
|
12099
|
-
try {
|
|
12100
|
-
const parsed = JSON.parse(raw);
|
|
12101
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return emptyCart();
|
|
12102
|
-
const bag = parsed;
|
|
12103
|
-
if (bag.v !== 1 || !Array.isArray(bag.lines)) return emptyCart();
|
|
12104
|
-
const lines = [];
|
|
12105
|
-
for (const entry of bag.lines.slice(0, MAX_LINES)) {
|
|
12106
|
-
const line = parseLine(entry);
|
|
12107
|
-
if (line) lines.push(line);
|
|
12108
|
-
}
|
|
12109
|
-
return { v: 1, lines };
|
|
12110
|
-
} catch {
|
|
12111
|
-
return emptyCart();
|
|
12112
|
-
}
|
|
12113
|
-
}
|
|
12114
|
-
function writeCart(cart) {
|
|
12115
|
-
const normalised = { v: 1, lines: cart.lines.slice(0, MAX_LINES) };
|
|
12116
|
-
const store = storage();
|
|
12117
|
-
if (store) {
|
|
12118
|
-
try {
|
|
12119
|
-
store.setItem(CART_STORAGE_KEY, JSON.stringify(normalised));
|
|
12120
|
-
} catch {
|
|
12121
|
-
}
|
|
12122
|
-
}
|
|
12123
|
-
notify(normalised);
|
|
12124
|
-
return normalised;
|
|
12125
|
-
}
|
|
12126
|
-
function addToCart(variantId, quantity = 1) {
|
|
12127
|
-
const cart = readCart();
|
|
12128
|
-
const add2 = Math.min(Math.max(Math.floor(quantity), 1), MAX_QUANTITY);
|
|
12129
|
-
const existing = cart.lines.find((l) => l.kind === "retail" && l.variantId === variantId);
|
|
12130
|
-
if (existing) {
|
|
12131
|
-
existing.quantity = Math.min(existing.quantity + add2, MAX_QUANTITY);
|
|
12132
|
-
} else {
|
|
12133
|
-
if (cart.lines.length >= MAX_LINES) return cart;
|
|
12134
|
-
cart.lines.push({ kind: "retail", variantId, quantity: add2 });
|
|
12135
|
-
}
|
|
12136
|
-
return writeCart(cart);
|
|
12137
|
-
}
|
|
12138
|
-
function setCartQuantity(variantId, quantity) {
|
|
12139
|
-
const cart = readCart();
|
|
12140
|
-
const next = Math.floor(quantity);
|
|
12141
|
-
if (next < 1) return removeFromCart(variantId);
|
|
12142
|
-
return writeCart({
|
|
12143
|
-
v: 1,
|
|
12144
|
-
lines: cart.lines.map(
|
|
12145
|
-
(l) => l.variantId === variantId ? { ...l, quantity: Math.min(next, MAX_QUANTITY) } : l
|
|
12146
|
-
)
|
|
12147
|
-
});
|
|
12148
|
-
}
|
|
12149
|
-
function removeFromCart(variantId) {
|
|
12150
|
-
const cart = readCart();
|
|
12151
|
-
return writeCart({ v: 1, lines: cart.lines.filter((l) => l.variantId !== variantId) });
|
|
12152
|
-
}
|
|
12153
|
-
function clearCart() {
|
|
12154
|
-
const store = storage();
|
|
12155
|
-
if (store) {
|
|
12156
|
-
try {
|
|
12157
|
-
store.removeItem(CART_STORAGE_KEY);
|
|
12158
|
-
} catch {
|
|
12159
|
-
}
|
|
12160
|
-
}
|
|
12161
|
-
const empty = emptyCart();
|
|
12162
|
-
notify(empty);
|
|
12163
|
-
return empty;
|
|
12164
|
-
}
|
|
12165
|
-
function cartItemCount(cart = readCart()) {
|
|
12166
|
-
return cart.lines.reduce((sum, l) => sum + l.quantity, 0);
|
|
12167
|
-
}
|
|
12168
|
-
function cartToWireLines(cart) {
|
|
12169
|
-
return cart.lines.map((l) => ({ kind: l.kind, variantId: l.variantId, quantity: l.quantity }));
|
|
12170
|
-
}
|
|
12171
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
12172
|
-
function notify(cart) {
|
|
12173
|
-
for (const fn of listeners) {
|
|
12174
|
-
try {
|
|
12175
|
-
fn(cart);
|
|
12176
|
-
} catch {
|
|
12177
|
-
}
|
|
12178
|
-
}
|
|
12179
|
-
}
|
|
12180
|
-
function subscribeToCart(fn) {
|
|
12181
|
-
listeners.add(fn);
|
|
12182
|
-
const onStorage = (e) => {
|
|
12183
|
-
if (e.key !== null && e.key !== CART_STORAGE_KEY) return;
|
|
12184
|
-
fn(readCart());
|
|
12185
|
-
};
|
|
12186
|
-
if (typeof window !== "undefined") window.addEventListener("storage", onStorage);
|
|
12187
|
-
return () => {
|
|
12188
|
-
listeners.delete(fn);
|
|
12189
|
-
if (typeof window !== "undefined") window.removeEventListener("storage", onStorage);
|
|
12190
|
-
};
|
|
12191
|
-
}
|
|
12192
|
-
|
|
12193
|
-
// src/store-block.client.tsx
|
|
12194
|
-
import { Fragment as Fragment12, jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
12195
|
-
function formatMoney(value) {
|
|
12196
|
-
const n = Number(value);
|
|
12197
|
-
if (!Number.isFinite(n)) return value;
|
|
12198
|
-
return `$${n.toFixed(2)}`;
|
|
12199
|
-
}
|
|
12200
|
-
function StoreClient({ categoryHandle, title, columns }) {
|
|
12201
|
-
const [catalog, setCatalog] = React22.useState(null);
|
|
12202
|
-
const [failed, setFailed] = React22.useState(false);
|
|
12203
|
-
const [count, setCount] = React22.useState(0);
|
|
12204
|
-
React22.useEffect(() => {
|
|
12205
|
-
setCount(cartItemCount(readCart()));
|
|
12206
|
-
return subscribeToCart((cart) => setCount(cartItemCount(cart)));
|
|
12207
|
-
}, []);
|
|
12208
|
-
React22.useEffect(() => {
|
|
12209
|
-
let alive = true;
|
|
12210
|
-
fetch("/api/store/catalog", { headers: { accept: "application/json" } }).then(
|
|
12211
|
-
(res) => res.ok ? res.json() : Promise.reject(new Error(String(res.status)))
|
|
12212
|
-
).then((data) => {
|
|
12213
|
-
if (alive) setCatalog(data);
|
|
12214
|
-
}).catch(() => {
|
|
12215
|
-
if (alive) setFailed(true);
|
|
12216
|
-
});
|
|
12217
|
-
return () => {
|
|
12218
|
-
alive = false;
|
|
12219
|
-
};
|
|
12220
|
-
}, []);
|
|
12221
|
-
const products = React22.useMemo(() => {
|
|
12222
|
-
if (!catalog) return [];
|
|
12223
|
-
if (!categoryHandle) return catalog.products;
|
|
12224
|
-
return catalog.products.filter((p) => p.handle.startsWith(categoryHandle));
|
|
12225
|
-
}, [catalog, categoryHandle]);
|
|
12226
|
-
if (failed) {
|
|
12227
|
-
return /* @__PURE__ */ jsxs25(Fragment12, { children: [
|
|
12228
|
-
/* @__PURE__ */ jsx28("h2", { className: "sk-store__heading", children: title ?? "Shop" }),
|
|
12229
|
-
/* @__PURE__ */ jsx28("p", { className: "sk-store__placeholder", role: "note", children: "Our shop is unavailable right now. Please contact the clinic to order." })
|
|
12230
|
-
] });
|
|
12231
|
-
}
|
|
12232
|
-
return /* @__PURE__ */ jsxs25(Fragment12, { children: [
|
|
12233
|
-
/* @__PURE__ */ jsxs25("div", { className: "sk-store__header", children: [
|
|
12234
|
-
/* @__PURE__ */ jsx28("h2", { className: "sk-store__heading", children: title ?? "Shop" }),
|
|
12235
|
-
/* @__PURE__ */ jsxs25("a", { className: "sk-store__cart-link", href: "/cart", children: [
|
|
12236
|
-
"Cart",
|
|
12237
|
-
count > 0 ? ` (${count})` : ""
|
|
12238
|
-
] })
|
|
12239
|
-
] }),
|
|
12240
|
-
!catalog ? /* @__PURE__ */ jsx28("p", { className: "sk-store__placeholder", role: "status", children: "Loading the shop\u2026" }) : products.length === 0 ? /* @__PURE__ */ jsx28("p", { className: "sk-store__placeholder", role: "status", children: "Nothing is available to order online just now." }) : /* @__PURE__ */ jsx28(
|
|
12241
|
-
"ul",
|
|
12242
|
-
{
|
|
12243
|
-
className: "sk-store__grid",
|
|
12244
|
-
style: columns ? { "--sk-store-columns": columns } : void 0,
|
|
12245
|
-
children: products.map((product) => /* @__PURE__ */ jsx28(StoreCard, { product }, product.id))
|
|
12246
|
-
}
|
|
12247
|
-
)
|
|
12248
|
-
] });
|
|
12249
|
-
}
|
|
12250
|
-
function StoreCard({ product }) {
|
|
12251
|
-
const [variantId, setVariantId] = React22.useState(
|
|
12252
|
-
() => (product.variants.find((v) => v.inStock) ?? product.variants[0]).id
|
|
12253
|
-
);
|
|
12254
|
-
const [added, setAdded] = React22.useState(false);
|
|
12255
|
-
const variant = product.variants.find((v) => v.id === variantId) ?? product.variants[0];
|
|
12256
|
-
const image2 = product.thumbnailUrl ?? product.images[0]?.url ?? null;
|
|
12257
|
-
function onAdd() {
|
|
12258
|
-
addToCart(variant.id, 1);
|
|
12259
|
-
setAdded(true);
|
|
12260
|
-
window.setTimeout(() => setAdded(false), 1600);
|
|
12261
|
-
}
|
|
12262
|
-
return /* @__PURE__ */ jsxs25("li", { className: "sk-store__card", children: [
|
|
12263
|
-
/* @__PURE__ */ jsxs25("a", { className: "sk-store__card-link", href: `/store/${product.handle}`, children: [
|
|
12264
|
-
image2 ? /* @__PURE__ */ jsx28("img", { className: "sk-store__image", src: image2, alt: product.images[0]?.alt ?? "" }) : /* @__PURE__ */ jsx28("span", { className: "sk-store__image sk-store__image--empty", "aria-hidden": true }),
|
|
12265
|
-
/* @__PURE__ */ jsx28("span", { className: "sk-store__title", children: product.title })
|
|
12266
|
-
] }),
|
|
12267
|
-
/* @__PURE__ */ jsxs25("span", { className: "sk-store__price", children: [
|
|
12268
|
-
formatMoney(variant.price),
|
|
12269
|
-
product.gstApplicable ? /* @__PURE__ */ jsx28("span", { className: "sk-store__gst", children: " incl. GST" }) : null
|
|
12270
|
-
] }),
|
|
12271
|
-
product.variants.length > 1 ? /* @__PURE__ */ jsxs25("label", { className: "sk-store__variant", children: [
|
|
12272
|
-
/* @__PURE__ */ jsx28("span", { className: "sk-store__variant-label", children: "Option" }),
|
|
12273
|
-
/* @__PURE__ */ jsx28("select", { value: variantId, onChange: (e) => setVariantId(e.target.value), children: product.variants.map((v) => /* @__PURE__ */ jsx28("option", { value: v.id, disabled: !v.inStock, children: (v.options.length ? v.options.join(" / ") : v.title) + (v.inStock ? "" : " \u2014 sold out") }, v.id)) })
|
|
12274
|
-
] }) : null,
|
|
12275
|
-
/* @__PURE__ */ jsx28(
|
|
12276
|
-
"button",
|
|
12277
|
-
{
|
|
12278
|
-
type: "button",
|
|
12279
|
-
className: "sk-store__add",
|
|
12280
|
-
onClick: onAdd,
|
|
12281
|
-
disabled: !variant.inStock,
|
|
12282
|
-
children: !variant.inStock ? "Sold out" : added ? "Added \u2713" : "Add to cart"
|
|
12283
|
-
}
|
|
12284
|
-
)
|
|
12285
|
-
] });
|
|
12286
|
-
}
|
|
12287
|
-
|
|
12288
|
-
// src/cart-block.client.tsx
|
|
12289
|
-
import * as React23 from "react";
|
|
12290
|
-
import { Fragment as Fragment13, jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
12291
|
-
function CartClient(_props) {
|
|
12292
|
-
const [cart, setCart] = React23.useState(() => readCart());
|
|
12293
|
-
const [quote, setQuote] = React23.useState(null);
|
|
12294
|
-
const [failed, setFailed] = React23.useState(false);
|
|
12295
|
-
React23.useEffect(() => subscribeToCart(setCart), []);
|
|
12296
|
-
React23.useEffect(() => {
|
|
12297
|
-
if (cart.lines.length === 0) {
|
|
12298
|
-
setQuote(null);
|
|
12299
|
-
setFailed(false);
|
|
12300
|
-
return;
|
|
12301
|
-
}
|
|
12302
|
-
let alive = true;
|
|
12303
|
-
fetch("/api/store/quote", {
|
|
12304
|
-
method: "POST",
|
|
12305
|
-
headers: { "content-type": "application/json" },
|
|
12306
|
-
body: JSON.stringify({ lines: cartToWireLines(cart) })
|
|
12307
|
-
}).then(
|
|
12308
|
-
(res) => res.ok ? res.json() : Promise.reject(new Error(String(res.status)))
|
|
12309
|
-
).then((data) => {
|
|
12310
|
-
if (!alive) return;
|
|
12311
|
-
setQuote(data);
|
|
12312
|
-
setFailed(false);
|
|
12313
|
-
}).catch(() => {
|
|
12314
|
-
if (alive) setFailed(true);
|
|
12315
|
-
});
|
|
12316
|
-
return () => {
|
|
12317
|
-
alive = false;
|
|
12318
|
-
};
|
|
12319
|
-
}, [cart]);
|
|
12320
|
-
if (cart.lines.length === 0) {
|
|
12321
|
-
return /* @__PURE__ */ jsxs26(Fragment13, { children: [
|
|
12322
|
-
/* @__PURE__ */ jsx29("h2", { className: "sk-cart__heading", children: "Your cart" }),
|
|
12323
|
-
/* @__PURE__ */ jsx29("p", { className: "sk-cart__placeholder", role: "status", children: "Your cart is empty." }),
|
|
12324
|
-
/* @__PURE__ */ jsx29("a", { className: "sk-cart__continue", href: "/store", children: "Browse the shop" })
|
|
12325
|
-
] });
|
|
12326
|
-
}
|
|
12327
|
-
return /* @__PURE__ */ jsxs26(Fragment13, { children: [
|
|
12328
|
-
/* @__PURE__ */ jsx29("h2", { className: "sk-cart__heading", children: "Your cart" }),
|
|
12329
|
-
quote && quote.problems.length > 0 ? /* @__PURE__ */ jsx29("ul", { className: "sk-cart__problems", role: "status", children: quote.problems.map((p, i) => /* @__PURE__ */ jsx29("li", { children: p.message }, `${p.code}-${p.variantId ?? i}`)) }) : null,
|
|
12330
|
-
failed ? /* @__PURE__ */ jsx29("p", { className: "sk-cart__placeholder", role: "alert", children: "We couldn't price your cart just now. Please try again in a moment." }) : null,
|
|
12331
|
-
!quote ? /* @__PURE__ */ jsx29("p", { className: "sk-cart__placeholder", role: "status", children: "Pricing your cart\u2026" }) : /* @__PURE__ */ jsxs26(Fragment13, { children: [
|
|
12332
|
-
/* @__PURE__ */ jsx29("ul", { className: "sk-cart__lines", children: quote.lines.map((line) => /* @__PURE__ */ jsxs26("li", { className: "sk-cart__line", children: [
|
|
12333
|
-
/* @__PURE__ */ jsx29("a", { className: "sk-cart__line-title", href: `/store/${line.productHandle}`, children: line.title }),
|
|
12334
|
-
/* @__PURE__ */ jsxs26("span", { className: "sk-cart__line-unit", children: [
|
|
12335
|
-
formatMoney(line.unitPrice),
|
|
12336
|
-
" each"
|
|
12337
|
-
] }),
|
|
12338
|
-
/* @__PURE__ */ jsxs26("span", { className: "sk-cart__qty", children: [
|
|
12339
|
-
/* @__PURE__ */ jsx29(
|
|
12340
|
-
"button",
|
|
12341
|
-
{
|
|
12342
|
-
type: "button",
|
|
12343
|
-
"aria-label": `Decrease quantity of ${line.title}`,
|
|
12344
|
-
onClick: () => setCartQuantity(line.variantId, line.quantity - 1),
|
|
12345
|
-
children: "\u2212"
|
|
12346
|
-
}
|
|
12347
|
-
),
|
|
12348
|
-
/* @__PURE__ */ jsx29("span", { "aria-live": "polite", children: line.quantity }),
|
|
12349
|
-
/* @__PURE__ */ jsx29(
|
|
12350
|
-
"button",
|
|
12351
|
-
{
|
|
12352
|
-
type: "button",
|
|
12353
|
-
"aria-label": `Increase quantity of ${line.title}`,
|
|
12354
|
-
onClick: () => setCartQuantity(line.variantId, line.quantity + 1),
|
|
12355
|
-
children: "+"
|
|
12356
|
-
}
|
|
12357
|
-
)
|
|
12358
|
-
] }),
|
|
12359
|
-
/* @__PURE__ */ jsx29("span", { className: "sk-cart__line-total", children: formatMoney(line.lineTotal) }),
|
|
12360
|
-
/* @__PURE__ */ jsx29(
|
|
12361
|
-
"button",
|
|
12362
|
-
{
|
|
12363
|
-
type: "button",
|
|
12364
|
-
className: "sk-cart__remove",
|
|
12365
|
-
onClick: () => removeFromCart(line.variantId),
|
|
12366
|
-
children: "Remove"
|
|
12367
|
-
}
|
|
12368
|
-
)
|
|
12369
|
-
] }, line.variantId)) }),
|
|
12370
|
-
/* @__PURE__ */ jsxs26("dl", { className: "sk-cart__totals", children: [
|
|
12371
|
-
/* @__PURE__ */ jsxs26("div", { children: [
|
|
12372
|
-
/* @__PURE__ */ jsx29("dt", { children: "Subtotal" }),
|
|
12373
|
-
/* @__PURE__ */ jsx29("dd", { children: formatMoney(quote.subtotal) })
|
|
12374
|
-
] }),
|
|
12375
|
-
/* @__PURE__ */ jsxs26("div", { className: "sk-cart__gst-row", children: [
|
|
12376
|
-
/* @__PURE__ */ jsx29("dt", { children: "GST included" }),
|
|
12377
|
-
/* @__PURE__ */ jsx29("dd", { children: formatMoney(quote.taxTotal) })
|
|
12378
|
-
] }),
|
|
12379
|
-
/* @__PURE__ */ jsxs26("div", { className: "sk-cart__total-row", children: [
|
|
12380
|
-
/* @__PURE__ */ jsx29("dt", { children: "Total" }),
|
|
12381
|
-
/* @__PURE__ */ jsx29("dd", { children: formatMoney(quote.total) })
|
|
12382
|
-
] })
|
|
12383
|
-
] }),
|
|
12384
|
-
quote.requiresShipping ? /* @__PURE__ */ jsx29("p", { className: "sk-cart__note", children: "Delivery is chosen at checkout." }) : null,
|
|
12385
|
-
/* @__PURE__ */ jsxs26("div", { className: "sk-cart__actions", children: [
|
|
12386
|
-
/* @__PURE__ */ jsx29("a", { className: "sk-cart__continue", href: "/store", children: "Keep shopping" }),
|
|
12387
|
-
/* @__PURE__ */ jsx29(
|
|
12388
|
-
"a",
|
|
12389
|
-
{
|
|
12390
|
-
className: "sk-cart__checkout",
|
|
12391
|
-
href: "/checkout",
|
|
12392
|
-
"aria-disabled": quote.lines.length === 0,
|
|
12393
|
-
children: "Checkout"
|
|
12394
|
-
}
|
|
12395
|
-
)
|
|
12396
|
-
] })
|
|
12397
|
-
] })
|
|
12398
|
-
] });
|
|
12399
|
-
}
|
|
12400
|
-
|
|
12401
|
-
// src/checkout-block.client.tsx
|
|
12402
|
-
import * as React24 from "react";
|
|
12403
|
-
import { Fragment as Fragment14, jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12404
|
-
async function searchStoreAddresses(query) {
|
|
12405
|
-
const q = query.trim();
|
|
12406
|
-
if (q.length < 3) return [];
|
|
12407
|
-
const res = await fetch(`/api/address/autocomplete?q=${encodeURIComponent(q)}`, {
|
|
12408
|
-
credentials: "same-origin",
|
|
12409
|
-
headers: { accept: "application/json" }
|
|
12410
|
-
});
|
|
12411
|
-
if (!res.ok) return [];
|
|
12412
|
-
const body = await res.json();
|
|
12413
|
-
return body.suggestions ?? [];
|
|
12414
|
-
}
|
|
12415
|
-
async function validateStoreAddress(address) {
|
|
12416
|
-
const res = await fetch("/api/address/validate", {
|
|
12417
|
-
method: "POST",
|
|
12418
|
-
credentials: "same-origin",
|
|
12419
|
-
headers: { "content-type": "application/json" },
|
|
12420
|
-
body: JSON.stringify({ address })
|
|
12421
|
-
});
|
|
12422
|
-
if (!res.ok) return null;
|
|
12423
|
-
const v = await res.json();
|
|
12424
|
-
if (v.error || !v.formattedAddress) return null;
|
|
12425
|
-
return { address: v.formattedAddress, placeId: v.googlePlaceId ?? null };
|
|
12426
|
-
}
|
|
12427
|
-
function CheckoutClient(_props) {
|
|
12428
|
-
const [stage, setStage] = React24.useState("loading");
|
|
12429
|
-
const [givenName, setGivenName] = React24.useState(null);
|
|
12430
|
-
const [cart] = React24.useState(() => readCart());
|
|
12431
|
-
const [quote, setQuote] = React24.useState(null);
|
|
12432
|
-
const [shippingOptions, setShippingOptions] = React24.useState([]);
|
|
12433
|
-
const [error2, setError] = React24.useState(null);
|
|
12434
|
-
const [fulfilment, setFulfilment] = React24.useState("pickup");
|
|
12435
|
-
const [shippingOptionId, setShippingOptionId] = React24.useState(null);
|
|
12436
|
-
const [address, setAddress] = React24.useState(null);
|
|
12437
|
-
const [card, setCard] = React24.useState({ number: "", expiry: "", name: "", cvn: "" });
|
|
12438
|
-
const orderRef = React24.useRef(null);
|
|
12439
|
-
const [iframeUrl, setIframeUrl] = React24.useState(null);
|
|
12440
|
-
const iframeOriginRef = React24.useRef(null);
|
|
12441
|
-
const iframeElRef = React24.useRef(null);
|
|
12442
|
-
React24.useEffect(() => {
|
|
12443
|
-
let alive = true;
|
|
12444
|
-
if (cart.lines.length === 0) {
|
|
12445
|
-
setStage("empty");
|
|
12446
|
-
return;
|
|
12447
|
-
}
|
|
12448
|
-
Promise.all([
|
|
12449
|
-
fetch("/api/store/session", { headers: { accept: "application/json" } }).then(
|
|
12450
|
-
(r) => r.ok ? r.json() : { signedIn: false }
|
|
12451
|
-
),
|
|
12452
|
-
fetch("/api/store/quote", {
|
|
12453
|
-
method: "POST",
|
|
12454
|
-
headers: { "content-type": "application/json" },
|
|
12455
|
-
body: JSON.stringify({ lines: cartToWireLines(cart) })
|
|
12456
|
-
}).then((r) => r.ok ? r.json() : null),
|
|
12457
|
-
fetch("/api/store/catalog", { headers: { accept: "application/json" } }).then(
|
|
12458
|
-
(r) => r.ok ? r.json() : { shippingOptions: [] }
|
|
12459
|
-
)
|
|
12460
|
-
]).then(([session, q, catalog]) => {
|
|
12461
|
-
if (!alive) return;
|
|
12462
|
-
setQuote(q);
|
|
12463
|
-
setShippingOptions(catalog.shippingOptions ?? []);
|
|
12464
|
-
setGivenName(session.givenName ?? null);
|
|
12465
|
-
setStage(session.signedIn ? "details" : "signed_out");
|
|
12466
|
-
}).catch(() => {
|
|
12467
|
-
if (alive) setError("We couldn\u2019t load your checkout. Please try again.");
|
|
12468
|
-
});
|
|
12469
|
-
return () => {
|
|
12470
|
-
alive = false;
|
|
12471
|
-
};
|
|
12472
|
-
}, [cart]);
|
|
12473
|
-
React24.useEffect(() => {
|
|
12474
|
-
if (stage !== "details" || cart.lines.length === 0) return;
|
|
12475
|
-
let alive = true;
|
|
12476
|
-
fetch("/api/store/quote", {
|
|
12477
|
-
method: "POST",
|
|
12478
|
-
headers: { "content-type": "application/json" },
|
|
12479
|
-
body: JSON.stringify({
|
|
12480
|
-
lines: cartToWireLines(cart),
|
|
12481
|
-
shippingOptionId: fulfilment === "ship" ? shippingOptionId : null
|
|
12482
|
-
})
|
|
12483
|
-
}).then((r) => r.ok ? r.json() : null).then((q) => {
|
|
12484
|
-
if (alive && q) setQuote(q);
|
|
12485
|
-
}).catch(() => void 0);
|
|
12486
|
-
return () => {
|
|
12487
|
-
alive = false;
|
|
12488
|
-
};
|
|
12489
|
-
}, [fulfilment, shippingOptionId]);
|
|
12490
|
-
React24.useEffect(() => {
|
|
12491
|
-
if (stage !== "three_ds") return;
|
|
12492
|
-
function onMessage(event) {
|
|
12493
|
-
if (iframeOriginRef.current && event.origin !== iframeOriginRef.current) return;
|
|
12494
|
-
if (iframeElRef.current && event.source !== iframeElRef.current.contentWindow) return;
|
|
12495
|
-
const data = typeof event.data === "string" ? event.data : null;
|
|
12496
|
-
if (!data) return;
|
|
12497
|
-
if (data === "AuthenticationInternalError") {
|
|
12498
|
-
setIframeUrl(null);
|
|
12499
|
-
setError("The card check could not be completed. Please try another card.");
|
|
12500
|
-
setStage("details");
|
|
12501
|
-
return;
|
|
12502
|
-
}
|
|
12503
|
-
if (data === "AuthenticationComplete" || data === "AuthenticationUserInteractionFinished") {
|
|
12504
|
-
setIframeUrl(null);
|
|
12505
|
-
void afterChallenge();
|
|
12506
|
-
}
|
|
12507
|
-
}
|
|
12508
|
-
window.addEventListener("message", onMessage);
|
|
12509
|
-
return () => window.removeEventListener("message", onMessage);
|
|
12510
|
-
}, [stage]);
|
|
12511
|
-
async function post(path, body) {
|
|
12512
|
-
const res = await fetch(path, {
|
|
12513
|
-
method: "POST",
|
|
12514
|
-
headers: { "content-type": "application/json" },
|
|
12515
|
-
body: JSON.stringify(body)
|
|
12516
|
-
});
|
|
12517
|
-
const data = await res.json().catch(() => ({}));
|
|
12518
|
-
if (!res.ok) {
|
|
12519
|
-
if (data.error === "sign_in_required") {
|
|
12520
|
-
setStage("signed_out");
|
|
12521
|
-
throw new Error("sign_in_required");
|
|
12522
|
-
}
|
|
12523
|
-
throw new Error(typeof data.message === "string" ? data.message : "Something went wrong.");
|
|
12524
|
-
}
|
|
12525
|
-
return data;
|
|
12526
|
-
}
|
|
12527
|
-
async function applyConfirm(result) {
|
|
12528
|
-
const status = result.status;
|
|
12529
|
-
if (status === "paid") {
|
|
12530
|
-
const orderId = orderRef.current?.orderId ?? "";
|
|
12531
|
-
clearCart();
|
|
12532
|
-
setStage("paid");
|
|
12533
|
-
window.location.assign(`/checkout/complete?order=${encodeURIComponent(orderId)}`);
|
|
12534
|
-
return;
|
|
12535
|
-
}
|
|
12536
|
-
if (status === "requires_action") {
|
|
12537
|
-
const artifacts = result.clientArtifacts ?? {};
|
|
12538
|
-
if (!artifacts.iframeUrl) {
|
|
12539
|
-
setError("Your bank asked for a check we couldn\u2019t show. Please try another card.");
|
|
12540
|
-
setStage("details");
|
|
12541
|
-
return;
|
|
12542
|
-
}
|
|
12543
|
-
iframeOriginRef.current = artifacts.iframeOrigin ?? null;
|
|
12544
|
-
setIframeUrl(artifacts.iframeUrl);
|
|
12545
|
-
setStage("three_ds");
|
|
12546
|
-
return;
|
|
12547
|
-
}
|
|
12548
|
-
if (status === "declined") {
|
|
12549
|
-
setError("Your card was declined. Please check the details or try another card.");
|
|
12550
|
-
setStage("details");
|
|
12551
|
-
return;
|
|
12552
|
-
}
|
|
12553
|
-
setStage("pending");
|
|
12554
|
-
}
|
|
12555
|
-
async function afterChallenge() {
|
|
12556
|
-
const orderId = orderRef.current?.orderId;
|
|
12557
|
-
if (!orderId) return;
|
|
12558
|
-
setStage("paying");
|
|
12559
|
-
try {
|
|
12560
|
-
const auth = await post("/api/store/checkout/authenticate", { orderId });
|
|
12561
|
-
if (auth.status === "payment_failed") {
|
|
12562
|
-
setError("The card check failed. Please try another card.");
|
|
12563
|
-
setStage("details");
|
|
12564
|
-
return;
|
|
12565
|
-
}
|
|
12566
|
-
if (auth.status === "requires_action") {
|
|
12567
|
-
const artifacts = auth.clientArtifacts ?? {};
|
|
12568
|
-
if (artifacts.iframeUrl) {
|
|
12569
|
-
iframeOriginRef.current = artifacts.iframeOrigin ?? null;
|
|
12570
|
-
setIframeUrl(artifacts.iframeUrl);
|
|
12571
|
-
setStage("three_ds");
|
|
12572
|
-
return;
|
|
12573
|
-
}
|
|
12574
|
-
}
|
|
12575
|
-
await applyConfirm(await post("/api/store/checkout/confirm", { orderId }));
|
|
12576
|
-
} catch (err) {
|
|
12577
|
-
if (err instanceof Error && err.message === "sign_in_required") return;
|
|
12578
|
-
setError(err instanceof Error ? err.message : "Something went wrong.");
|
|
12579
|
-
setStage("details");
|
|
12580
|
-
}
|
|
12581
|
-
}
|
|
12582
|
-
async function onPay(e) {
|
|
12583
|
-
e.preventDefault();
|
|
12584
|
-
setError(null);
|
|
12585
|
-
setStage("paying");
|
|
12586
|
-
try {
|
|
12587
|
-
const init = await post("/api/store/checkout/init", {
|
|
12588
|
-
lines: cartToWireLines(cart),
|
|
12589
|
-
fulfilmentMethod: fulfilment,
|
|
12590
|
-
shippingOptionId: fulfilment === "ship" ? shippingOptionId : null,
|
|
12591
|
-
// The REFERENCE, never components — /api/store resolves it against Google.
|
|
12592
|
-
shippingPlace: fulfilment === "ship" && address ? { address: address.address, placeId: address.placeId ?? null } : null,
|
|
12593
|
-
// A previous, abandoned attempt by this shopper — the server cancels it and
|
|
12594
|
-
// gives its stock back in the SAME tx that mints the replacement.
|
|
12595
|
-
priorOrderId: orderRef.current?.orderId ?? null
|
|
12596
|
-
});
|
|
12597
|
-
if (init.status === "cart_changed") {
|
|
12598
|
-
setQuote(init.quote);
|
|
12599
|
-
setError("Your cart changed \u2014 please review it before paying.");
|
|
12600
|
-
setStage("details");
|
|
12601
|
-
return;
|
|
12602
|
-
}
|
|
12603
|
-
const orderId = String(init.orderId);
|
|
12604
|
-
const providerKey = String(init.providerKey);
|
|
12605
|
-
orderRef.current = { orderId, providerKey };
|
|
12606
|
-
if (providerKey !== "mock") {
|
|
12607
|
-
const artifacts = init.clientArtifacts ?? {};
|
|
12608
|
-
if (!artifacts.authKey) throw new Error("We couldn\u2019t start a secure payment. Please try again.");
|
|
12609
|
-
await loadBpointScript();
|
|
12610
|
-
await attachCardToAuthKey(artifacts.authKey, card);
|
|
12611
|
-
}
|
|
12612
|
-
await applyConfirm(await post("/api/store/checkout/confirm", { orderId }));
|
|
12613
|
-
} catch (err) {
|
|
12614
|
-
if (err instanceof Error && err.message === "sign_in_required") return;
|
|
12615
|
-
setError(err instanceof Error ? err.message : "Something went wrong.");
|
|
12616
|
-
setStage("details");
|
|
12617
|
-
}
|
|
12618
|
-
}
|
|
12619
|
-
if (stage === "loading") {
|
|
12620
|
-
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
12621
|
-
/* @__PURE__ */ jsx30("h2", { className: "sk-checkout__heading", children: "Checkout" }),
|
|
12622
|
-
/* @__PURE__ */ jsx30("p", { className: "sk-checkout__placeholder", role: "status", children: "Loading your order\u2026" })
|
|
12623
|
-
] });
|
|
12624
|
-
}
|
|
12625
|
-
if (stage === "empty") {
|
|
12626
|
-
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
12627
|
-
/* @__PURE__ */ jsx30("h2", { className: "sk-checkout__heading", children: "Checkout" }),
|
|
12628
|
-
/* @__PURE__ */ jsx30("p", { className: "sk-checkout__placeholder", role: "status", children: "Your cart is empty." }),
|
|
12629
|
-
/* @__PURE__ */ jsx30("a", { className: "sk-checkout__link", href: "/store", children: "Browse the shop" })
|
|
12630
|
-
] });
|
|
12631
|
-
}
|
|
12632
|
-
if (stage === "signed_out") {
|
|
12633
|
-
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
12634
|
-
/* @__PURE__ */ jsx30("h2", { className: "sk-checkout__heading", children: "Checkout" }),
|
|
12635
|
-
/* @__PURE__ */ jsx30("p", { className: "sk-checkout__note", children: "Please sign in to finish your order. Your order is kept with your clinic record so you can see it later." }),
|
|
12636
|
-
/* @__PURE__ */ jsx30("a", { className: "sk-checkout__signin", href: "/portal/sign-in?redirect=/checkout", children: "Sign in to continue" })
|
|
12637
|
-
] });
|
|
12638
|
-
}
|
|
12639
|
-
if (stage === "paid") {
|
|
12640
|
-
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
12641
|
-
/* @__PURE__ */ jsx30("h2", { className: "sk-checkout__heading", children: "Payment received" }),
|
|
12642
|
-
/* @__PURE__ */ jsx30("p", { className: "sk-checkout__note", role: "status", children: "Taking you to your order\u2026" })
|
|
12643
|
-
] });
|
|
12644
|
-
}
|
|
12645
|
-
if (stage === "pending") {
|
|
12646
|
-
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
12647
|
-
/* @__PURE__ */ jsx30("h2", { className: "sk-checkout__heading", children: "Confirming your payment" }),
|
|
12648
|
-
/* @__PURE__ */ jsx30("p", { className: "sk-checkout__note", role: "status", children: "Your bank hasn't confirmed the result yet. We're checking with them \u2014 please don't pay again. You'll see the order in your account once it's confirmed." }),
|
|
12649
|
-
/* @__PURE__ */ jsx30("a", { className: "sk-checkout__link", href: "/portal/orders", children: "Go to my orders" })
|
|
12650
|
-
] });
|
|
12651
|
-
}
|
|
12652
|
-
if (stage === "three_ds" && iframeUrl) {
|
|
12653
|
-
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
12654
|
-
/* @__PURE__ */ jsx30("h2", { className: "sk-checkout__heading", children: "Your bank needs to check this payment" }),
|
|
12655
|
-
/* @__PURE__ */ jsx30(
|
|
12656
|
-
"iframe",
|
|
12657
|
-
{
|
|
12658
|
-
ref: iframeElRef,
|
|
12659
|
-
className: "sk-checkout__3ds",
|
|
12660
|
-
src: iframeUrl,
|
|
12661
|
-
title: "Card verification"
|
|
12662
|
-
}
|
|
12663
|
-
)
|
|
12664
|
-
] });
|
|
12665
|
-
}
|
|
12666
|
-
const busy = stage === "paying";
|
|
12667
|
-
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
12668
|
-
/* @__PURE__ */ jsx30("h2", { className: "sk-checkout__heading", children: givenName ? `Checkout \u2014 hello, ${givenName}` : "Checkout" }),
|
|
12669
|
-
error2 ? /* @__PURE__ */ jsx30("p", { className: "sk-checkout__error", role: "alert", children: error2 }) : null,
|
|
12670
|
-
quote ? /* @__PURE__ */ jsxs27("div", { className: "sk-checkout__summary", children: [
|
|
12671
|
-
/* @__PURE__ */ jsx30("ul", { className: "sk-checkout__lines", children: quote.lines.map((l) => /* @__PURE__ */ jsxs27("li", { children: [
|
|
12672
|
-
/* @__PURE__ */ jsxs27("span", { children: [
|
|
12673
|
-
l.title,
|
|
12674
|
-
" \xD7 ",
|
|
12675
|
-
l.quantity
|
|
12676
|
-
] }),
|
|
12677
|
-
/* @__PURE__ */ jsx30("span", { children: formatMoney(l.lineTotal) })
|
|
12678
|
-
] }, l.variantId)) }),
|
|
12679
|
-
/* @__PURE__ */ jsxs27("dl", { className: "sk-checkout__totals", children: [
|
|
12680
|
-
/* @__PURE__ */ jsxs27("div", { children: [
|
|
12681
|
-
/* @__PURE__ */ jsx30("dt", { children: "Subtotal" }),
|
|
12682
|
-
/* @__PURE__ */ jsx30("dd", { children: formatMoney(quote.subtotal) })
|
|
12683
|
-
] }),
|
|
12684
|
-
Number(quote.shippingTotal) > 0 ? /* @__PURE__ */ jsxs27("div", { children: [
|
|
12685
|
-
/* @__PURE__ */ jsx30("dt", { children: "Delivery" }),
|
|
12686
|
-
/* @__PURE__ */ jsx30("dd", { children: formatMoney(quote.shippingTotal) })
|
|
12687
|
-
] }) : null,
|
|
12688
|
-
/* @__PURE__ */ jsxs27("div", { children: [
|
|
12689
|
-
/* @__PURE__ */ jsx30("dt", { children: "GST included" }),
|
|
12690
|
-
/* @__PURE__ */ jsx30("dd", { children: formatMoney(quote.taxTotal) })
|
|
12691
|
-
] }),
|
|
12692
|
-
/* @__PURE__ */ jsxs27("div", { className: "sk-checkout__total-row", children: [
|
|
12693
|
-
/* @__PURE__ */ jsx30("dt", { children: "Total" }),
|
|
12694
|
-
/* @__PURE__ */ jsx30("dd", { children: formatMoney(quote.total) })
|
|
12695
|
-
] })
|
|
12696
|
-
] })
|
|
12697
|
-
] }) : null,
|
|
12698
|
-
/* @__PURE__ */ jsxs27("form", { className: "sk-checkout__form", onSubmit: onPay, children: [
|
|
12699
|
-
quote?.requiresShipping ? /* @__PURE__ */ jsxs27("fieldset", { className: "sk-checkout__fieldset", children: [
|
|
12700
|
-
/* @__PURE__ */ jsx30("legend", { children: "How would you like to get this?" }),
|
|
12701
|
-
/* @__PURE__ */ jsxs27("label", { children: [
|
|
12702
|
-
/* @__PURE__ */ jsx30(
|
|
12703
|
-
"input",
|
|
12704
|
-
{
|
|
12705
|
-
type: "radio",
|
|
12706
|
-
name: "fulfilment",
|
|
12707
|
-
checked: fulfilment === "pickup",
|
|
12708
|
-
onChange: () => setFulfilment("pickup")
|
|
12709
|
-
}
|
|
12710
|
-
),
|
|
12711
|
-
"Collect from the clinic"
|
|
12712
|
-
] }),
|
|
12713
|
-
/* @__PURE__ */ jsxs27("label", { children: [
|
|
12714
|
-
/* @__PURE__ */ jsx30(
|
|
12715
|
-
"input",
|
|
12716
|
-
{
|
|
12717
|
-
type: "radio",
|
|
12718
|
-
name: "fulfilment",
|
|
12719
|
-
checked: fulfilment === "ship",
|
|
12720
|
-
onChange: () => setFulfilment("ship")
|
|
12721
|
-
}
|
|
12722
|
-
),
|
|
12723
|
-
"Deliver to me"
|
|
12724
|
-
] }),
|
|
12725
|
-
fulfilment === "ship" ? /* @__PURE__ */ jsxs27("div", { className: "sk-checkout__ship", children: [
|
|
12726
|
-
/* @__PURE__ */ jsxs27("label", { children: [
|
|
12727
|
-
/* @__PURE__ */ jsx30("span", { children: "Delivery option" }),
|
|
12728
|
-
/* @__PURE__ */ jsxs27(
|
|
12729
|
-
"select",
|
|
12730
|
-
{
|
|
12731
|
-
required: true,
|
|
12732
|
-
value: shippingOptionId ?? "",
|
|
12733
|
-
onChange: (e) => setShippingOptionId(e.target.value || null),
|
|
12734
|
-
children: [
|
|
12735
|
-
/* @__PURE__ */ jsx30("option", { value: "", children: "Choose\u2026" }),
|
|
12736
|
-
shippingOptions.map((o) => /* @__PURE__ */ jsxs27("option", { value: o.id, children: [
|
|
12737
|
-
o.name,
|
|
12738
|
-
" \u2014 ",
|
|
12739
|
-
formatMoney(o.price)
|
|
12740
|
-
] }, o.id))
|
|
12741
|
-
]
|
|
12742
|
-
}
|
|
12743
|
-
)
|
|
12744
|
-
] }),
|
|
12745
|
-
/* @__PURE__ */ jsx30(
|
|
12746
|
-
AddressPicker,
|
|
12747
|
-
{
|
|
12748
|
-
idPrefix: "sk-checkout",
|
|
12749
|
-
label: "Delivery address",
|
|
12750
|
-
value: address,
|
|
12751
|
-
onChange: setAddress,
|
|
12752
|
-
search: searchStoreAddresses,
|
|
12753
|
-
validate: validateStoreAddress
|
|
12754
|
-
}
|
|
12755
|
-
)
|
|
12756
|
-
] }) : null
|
|
12757
|
-
] }) : null,
|
|
12758
|
-
/* @__PURE__ */ jsxs27("fieldset", { className: "sk-checkout__fieldset", children: [
|
|
12759
|
-
/* @__PURE__ */ jsx30("legend", { children: "Card details" }),
|
|
12760
|
-
/* @__PURE__ */ jsxs27("label", { children: [
|
|
12761
|
-
/* @__PURE__ */ jsx30("span", { children: "Name on card" }),
|
|
12762
|
-
/* @__PURE__ */ jsx30(
|
|
12763
|
-
"input",
|
|
12764
|
-
{
|
|
12765
|
-
required: true,
|
|
12766
|
-
autoComplete: "cc-name",
|
|
12767
|
-
value: card.name,
|
|
12768
|
-
onChange: (e) => setCard({ ...card, name: e.target.value })
|
|
12769
|
-
}
|
|
12770
|
-
)
|
|
12771
|
-
] }),
|
|
12772
|
-
/* @__PURE__ */ jsxs27("label", { children: [
|
|
12773
|
-
/* @__PURE__ */ jsx30("span", { children: "Card number" }),
|
|
12774
|
-
/* @__PURE__ */ jsx30(
|
|
12775
|
-
"input",
|
|
12776
|
-
{
|
|
12777
|
-
required: true,
|
|
12778
|
-
inputMode: "numeric",
|
|
12779
|
-
autoComplete: "cc-number",
|
|
12780
|
-
value: card.number,
|
|
12781
|
-
onChange: (e) => setCard({ ...card, number: e.target.value })
|
|
12782
|
-
}
|
|
12783
|
-
)
|
|
12784
|
-
] }),
|
|
12785
|
-
/* @__PURE__ */ jsxs27("label", { children: [
|
|
12786
|
-
/* @__PURE__ */ jsx30("span", { children: "Expiry (MM/YY)" }),
|
|
12787
|
-
/* @__PURE__ */ jsx30(
|
|
12788
|
-
"input",
|
|
12789
|
-
{
|
|
12790
|
-
required: true,
|
|
12791
|
-
inputMode: "numeric",
|
|
12792
|
-
autoComplete: "cc-exp",
|
|
12793
|
-
placeholder: "MM/YY",
|
|
12794
|
-
value: card.expiry,
|
|
12795
|
-
onChange: (e) => setCard({ ...card, expiry: e.target.value })
|
|
12796
|
-
}
|
|
12797
|
-
)
|
|
12798
|
-
] }),
|
|
12799
|
-
/* @__PURE__ */ jsxs27("label", { children: [
|
|
12800
|
-
/* @__PURE__ */ jsx30("span", { children: "Security code" }),
|
|
12801
|
-
/* @__PURE__ */ jsx30(
|
|
12802
|
-
"input",
|
|
12803
|
-
{
|
|
12804
|
-
required: true,
|
|
12805
|
-
inputMode: "numeric",
|
|
12806
|
-
autoComplete: "cc-csc",
|
|
12807
|
-
value: card.cvn,
|
|
12808
|
-
onChange: (e) => setCard({ ...card, cvn: e.target.value })
|
|
12809
|
-
}
|
|
12810
|
-
)
|
|
12811
|
-
] }),
|
|
12812
|
-
/* @__PURE__ */ jsx30("p", { className: "sk-checkout__note", children: "Your card details go straight to our payment provider \u2014 they never reach this clinic's systems." })
|
|
12813
|
-
] }),
|
|
12814
|
-
/* @__PURE__ */ jsx30("button", { type: "submit", className: "sk-checkout__pay", disabled: busy, children: busy ? "Processing\u2026" : quote ? `Pay ${formatMoney(quote.total)}` : "Pay" })
|
|
12815
|
-
] })
|
|
11786
|
+
return /* @__PURE__ */ jsxs23("div", { className: "sk-portal-account__field", children: [
|
|
11787
|
+
/* @__PURE__ */ jsx26("dt", { className: "sk-portal-account__field-label", children: label }),
|
|
11788
|
+
/* @__PURE__ */ jsx26("dd", { className: "sk-portal-account__field-value", children: value || "Not recorded" })
|
|
12816
11789
|
] });
|
|
12817
11790
|
}
|
|
12818
11791
|
|
|
@@ -12830,8 +11803,5 @@ export {
|
|
|
12830
11803
|
getPublicApi,
|
|
12831
11804
|
getThemeTokens,
|
|
12832
11805
|
PortalAccount,
|
|
12833
|
-
PortalAccountClient
|
|
12834
|
-
StoreClient,
|
|
12835
|
-
CartClient,
|
|
12836
|
-
CheckoutClient
|
|
11806
|
+
PortalAccountClient
|
|
12837
11807
|
};
|