@apextelemed/partner-core 0.11.0 → 0.12.0-dev.29

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.
Files changed (41) hide show
  1. package/dist/api/index.d.ts +1 -1
  2. package/dist/api/index.js +3 -3
  3. package/dist/api/index.jsx +3 -3
  4. package/dist/chunk/{ALS5FXNC.jsx → 2KT2KDH2.jsx} +2 -2
  5. package/dist/chunk/{WO4H2CXD.jsx → 2YG6QASH.jsx} +269 -102
  6. package/dist/chunk/{A3XK3UAQ.jsx → BJXNZYUF.jsx} +2 -2
  7. package/dist/chunk/{A56QXD45.js → FTCGYXXP.js} +3 -3
  8. package/dist/chunk/{A56QXD45.js.map → FTCGYXXP.js.map} +1 -1
  9. package/dist/chunk/{RYISMGS2.jsx → GDKKCH5S.jsx} +5 -5
  10. package/dist/chunk/{6K2CMG26.js → GKVOO7MO.js} +3 -3
  11. package/dist/chunk/{6K2CMG26.js.map → GKVOO7MO.js.map} +1 -1
  12. package/dist/chunk/{6OP52OQK.jsx → HGPLI3DF.jsx} +2 -2
  13. package/dist/chunk/{SIXC23N6.jsx → JBYV7POQ.jsx} +25 -4
  14. package/dist/chunk/{POIS4SBW.js → JZS2FNNX.js} +415 -240
  15. package/dist/chunk/JZS2FNNX.js.map +1 -0
  16. package/dist/chunk/{OBFYSGB6.jsx → KIT35L4T.jsx} +22 -4
  17. package/dist/chunk/{PT6E3DLE.js → NHKEFETN.js} +3 -3
  18. package/dist/chunk/{PT6E3DLE.js.map → NHKEFETN.js.map} +1 -1
  19. package/dist/chunk/{WL6HP6BE.js → YNSFBOWV.js} +26 -5
  20. package/dist/chunk/YNSFBOWV.js.map +1 -0
  21. package/dist/chunk/{5W6SC6JO.js → ZGRTE3DX.js} +6 -6
  22. package/dist/chunk/{5W6SC6JO.js.map → ZGRTE3DX.js.map} +1 -1
  23. package/dist/chunk/{CLPOTUII.js → ZTLXI4Y4.js} +23 -5
  24. package/dist/chunk/ZTLXI4Y4.js.map +1 -0
  25. package/dist/{client-DsIvVM5a.d.ts → client-5akRVYcz.d.ts} +35 -1
  26. package/dist/flows/index.d.ts +10 -1
  27. package/dist/flows/index.js +6 -6
  28. package/dist/flows/index.jsx +6 -6
  29. package/dist/index/index.d.ts +1 -1
  30. package/dist/index/index.js +7 -7
  31. package/dist/index/index.jsx +7 -7
  32. package/dist/pages/index.d.ts +1 -1
  33. package/dist/pages/index.js +5 -5
  34. package/dist/pages/index.jsx +5 -5
  35. package/dist/stores/index.d.ts +1 -1
  36. package/dist/stores/index.js +2 -2
  37. package/dist/stores/index.jsx +2 -2
  38. package/package.json +1 -1
  39. package/dist/chunk/CLPOTUII.js.map +0 -1
  40. package/dist/chunk/POIS4SBW.js.map +0 -1
  41. package/dist/chunk/WL6HP6BE.js.map +0 -1
@@ -70,10 +70,10 @@ import {
70
70
  useSurveyFlow,
71
71
  useSurveyV2Flow,
72
72
  useUpdatePaymentMethodFlow
73
- } from "./SIXC23N6.jsx";
73
+ } from "./JBYV7POQ.jsx";
74
74
  import {
75
75
  fetchFunnelConfig
76
- } from "./ALS5FXNC.jsx";
76
+ } from "./2KT2KDH2.jsx";
77
77
  import {
78
78
  usePrimitives
79
79
  } from "./J63XPQP4.jsx";
@@ -81,7 +81,7 @@ import {
81
81
  affiliateAuth_default,
82
82
  auth_default,
83
83
  cart_default
84
- } from "./6OP52OQK.jsx";
84
+ } from "./HGPLI3DF.jsx";
85
85
  import {
86
86
  ApiError,
87
87
  SUPPORT_ATTACHMENT_MAX_BYTES,
@@ -97,7 +97,7 @@ import {
97
97
  offersApi,
98
98
  subscriptionsApi,
99
99
  usersApi
100
- } from "./OBFYSGB6.jsx";
100
+ } from "./KIT35L4T.jsx";
101
101
 
102
102
  // src/pages/Survey.tsx
103
103
  import { Show, For, createEffect, on } from "solid-js";
@@ -4093,7 +4093,7 @@ var US_STATES3 = [
4093
4093
  var US_STATE_OPTIONS3 = US_STATES3.map((s) => ({ value: s, label: s }));
4094
4094
 
4095
4095
  // src/pages/AdminDashboard.tsx
4096
- import { createEffect as createEffect13, createSignal as createSignal37, ErrorBoundary, Match as Match3, Show as Show55, Switch as Switch3, For as For43 } from "solid-js";
4096
+ import { createEffect as createEffect13, createSignal as createSignal38, ErrorBoundary, Match as Match3, Show as Show55, Switch as Switch3, For as For43 } from "solid-js";
4097
4097
 
4098
4098
  // src/pages/admin/Affiliates.tsx
4099
4099
  import { createSignal as createSignal10, For as For14, Match, Switch } from "solid-js";
@@ -19570,7 +19570,13 @@ function SequenceResults() {
19570
19570
  }
19571
19571
 
19572
19572
  // src/pages/admin/EmailNotifications.tsx
19573
- import { createResource as createResource26, createSignal as createSignal35, For as For41, Show as Show53 } from "solid-js";
19573
+ import { createResource as createResource26, createSignal as createSignal36, For as For41, Show as Show53 } from "solid-js";
19574
+
19575
+ // src/pages/admin/supportChannelState.ts
19576
+ import { createSignal as createSignal35 } from "solid-js";
19577
+ var [supportChannelMode, setSupportChannelMode] = createSignal35(null);
19578
+
19579
+ // src/pages/admin/EmailNotifications.tsx
19574
19580
  function humanize2(key) {
19575
19581
  return key.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/^\w/, (c) => c.toUpperCase()).trim();
19576
19582
  }
@@ -19606,9 +19612,9 @@ function Toggle(props) {
19606
19612
  }
19607
19613
  function NotificationsCard() {
19608
19614
  const [saved, { mutate }] = createResource26(() => adminApi.getEmailNotifications());
19609
- const [draft, setDraft] = createSignal35(null);
19610
- const [newEmail, setNewEmail] = createSignal35("");
19611
- const [saving, setSaving] = createSignal35(false);
19615
+ const [draft, setDraft] = createSignal36(null);
19616
+ const [newEmail, setNewEmail] = createSignal36("");
19617
+ const [saving, setSaving] = createSignal36(false);
19612
19618
  const current2 = () => draft() ?? saved() ?? null;
19613
19619
  const update = (patch) => setDraft({ ...current2(), ...patch });
19614
19620
  const dirty = () => !!draft() && JSON.stringify(draft()) !== JSON.stringify(saved());
@@ -19691,9 +19697,9 @@ function NotificationsCard() {
19691
19697
  }
19692
19698
  function BillingRemindersCard() {
19693
19699
  const [saved, { mutate }] = createResource26(() => adminApi.getBillingReminders());
19694
- const [draft, setDraft] = createSignal35(null);
19695
- const [newDay, setNewDay] = createSignal35("");
19696
- const [saving, setSaving] = createSignal35(false);
19700
+ const [draft, setDraft] = createSignal36(null);
19701
+ const [newDay, setNewDay] = createSignal36("");
19702
+ const [saving, setSaving] = createSignal36(false);
19697
19703
  const current2 = () => draft() ?? saved() ?? null;
19698
19704
  const update = (patch) => setDraft({ ...current2(), ...patch });
19699
19705
  const dirty = () => !!draft() && JSON.stringify(draft()) !== JSON.stringify(saved());
@@ -19772,16 +19778,108 @@ function BillingRemindersCard() {
19772
19778
  </Show53>
19773
19779
  </Card>;
19774
19780
  }
19781
+ function SupportChannelCard() {
19782
+ const [saved, { mutate }] = createResource26(async () => {
19783
+ try {
19784
+ return await adminApi.getSupportChannel();
19785
+ } catch {
19786
+ return null;
19787
+ }
19788
+ });
19789
+ const [draft, setDraft] = createSignal36(null);
19790
+ const [saving, setSaving] = createSignal36(false);
19791
+ const current2 = () => draft() ?? saved() ?? null;
19792
+ const update = (patch) => setDraft({ ...current2(), ...patch });
19793
+ const dirty = () => !!draft() && JSON.stringify(draft()) !== JSON.stringify(saved());
19794
+ const inbox = () => (current2()?.email ?? "").trim();
19795
+ const needsInbox = () => current2()?.mode === "email" && !inbox().includes("@");
19796
+ const save = async () => {
19797
+ const d = draft();
19798
+ if (!d || needsInbox()) return;
19799
+ const next = { mode: d.mode, email: (d.email ?? "").trim() || null };
19800
+ setSaving(true);
19801
+ try {
19802
+ await adminApi.saveSupportChannel(next);
19803
+ mutate(next);
19804
+ setSupportChannelMode(next.mode);
19805
+ setDraft(null);
19806
+ toastSuccess("Support channel saved");
19807
+ } catch (err) {
19808
+ toastError(err instanceof Error ? err.message : "Failed to save");
19809
+ } finally {
19810
+ setSaving(false);
19811
+ }
19812
+ };
19813
+ const option = (mode, title, note) => <label style={{ display: "flex", gap: "0.5rem", "align-items": "flex-start", cursor: "pointer" }}>
19814
+ <input
19815
+ type="radio"
19816
+ name="support-channel-mode"
19817
+ data-testid={`support-channel-${mode}`}
19818
+ checked={current2()?.mode === mode}
19819
+ onChange={() => update({ mode })}
19820
+ style={{ "margin-top": "0.1875rem" }}
19821
+ />
19822
+ <span>
19823
+ <span style={{ "font-size": "0.875rem", display: "block" }}>{title}</span>
19824
+ <span style={{ ...label2, "font-size": "0.75rem" }}>{note}</span>
19825
+ </span>
19826
+ </label>;
19827
+ return <Show53 when={saved.loading || saved()}>
19828
+ <Card
19829
+ title="Customer support messages"
19830
+ note="Where messages from the member portal's Support form go. Care-team messages are not affected."
19831
+ aside={<button
19832
+ type="button"
19833
+ class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"
19834
+ data-testid="support-channel-save"
19835
+ disabled={!dirty() || saving() || needsInbox()}
19836
+ onClick={save}
19837
+ >
19838
+ {saving() ? "Saving\u2026" : "Save"}
19839
+ </button>}
19840
+ >
19841
+ <Show53 when={current2()} fallback={<LoadingSpinner />}>
19842
+ {option(
19843
+ "portal",
19844
+ "Admin portal",
19845
+ "Customers get a two-way conversation in their portal, and you reply from the Support tab."
19846
+ )}
19847
+ {option(
19848
+ "email",
19849
+ "Email inbox",
19850
+ "Customers see only the Support form. Each message is emailed to the address below; reply to that email to answer them. The Support tab is hidden and nothing is kept in the portal."
19851
+ )}
19852
+ <label style={{ display: "grid", gap: "0.25rem", "max-width": "24rem" }}>
19853
+ <span style={label2}>Support inbox</span>
19854
+ <input
19855
+ type="email"
19856
+ class="app-admin-input"
19857
+ data-testid="support-channel-email-input"
19858
+ placeholder="help@example.com"
19859
+ value={current2()?.email ?? ""}
19860
+ onInput={(ev) => update({ email: ev.currentTarget.value })}
19861
+ />
19862
+ <Show53 when={needsInbox()}>
19863
+ <span style={{ ...label2, "font-size": "0.75rem", color: "var(--app-admin-danger-fg)" }}>
19864
+ Enter the inbox that should receive support messages.
19865
+ </span>
19866
+ </Show53>
19867
+ </label>
19868
+ </Show53>
19869
+ </Card>
19870
+ </Show53>;
19871
+ }
19775
19872
  function EmailNotifications() {
19776
19873
  return <div>
19777
19874
  <PageTitle subtitle="Who gets admin copies, and when the automated billing reminders go out">Notifications</PageTitle>
19778
19875
  <NotificationsCard />
19779
19876
  <BillingRemindersCard />
19877
+ <SupportChannelCard />
19780
19878
  </div>;
19781
19879
  }
19782
19880
 
19783
19881
  // src/pages/admin/Features.tsx
19784
- import { createResource as createResource27, createSignal as createSignal36, For as For42, Show as Show54 } from "solid-js";
19882
+ import { createResource as createResource27, createSignal as createSignal37, For as For42, Show as Show54 } from "solid-js";
19785
19883
  var muted2 = { "font-size": "0.8125rem", color: "var(--app-admin-fg-muted)" };
19786
19884
  var MAX_NOTE_LENGTH = 1e3;
19787
19885
  function formatDate2(iso) {
@@ -19823,10 +19921,10 @@ function Row(props) {
19823
19921
  }
19824
19922
  function Features() {
19825
19923
  const [data, { mutate }] = createResource27(() => adminApi.getFeatures());
19826
- const [busyKey, setBusyKey] = createSignal36(null);
19827
- const [requesting, setRequesting] = createSignal36(null);
19828
- const [note, setNote] = createSignal36("");
19829
- const [sending, setSending] = createSignal36(false);
19924
+ const [busyKey, setBusyKey] = createSignal37(null);
19925
+ const [requesting, setRequesting] = createSignal37(null);
19926
+ const [note, setNote] = createSignal37("");
19927
+ const [sending, setSending] = createSignal37(false);
19830
19928
  const features = () => data.error ? [] : data()?.features ?? [];
19831
19929
  const selfServe = () => features().filter((f) => f.access === "self_serve");
19832
19930
  const onRequest = () => features().filter((f) => f.access === "request");
@@ -20027,8 +20125,9 @@ var DEFAULT_TAB_GROUPS = [
20027
20125
  ];
20028
20126
  var filterEnabled = (tabs, enabled) => enabled ? tabs.filter((t) => enabled.includes(t)) : tabs;
20029
20127
  function AdminDashboard(props) {
20030
- const visibleTopTabs = () => filterEnabled(props.topTabs ?? DEFAULT_TOP_TABS, props.enabledTabs);
20031
- const visibleGroups = () => (props.tabGroups ?? DEFAULT_TAB_GROUPS).map((g) => ({ label: g.label, tabs: filterEnabled(g.tabs, props.enabledTabs) })).filter((g) => g.tabs.length > 0);
20128
+ const withoutHidden = (tabs) => supportChannelMode() === "email" ? tabs.filter((t) => t !== "support") : tabs;
20129
+ const visibleTopTabs = () => withoutHidden(filterEnabled(props.topTabs ?? DEFAULT_TOP_TABS, props.enabledTabs));
20130
+ const visibleGroups = () => (props.tabGroups ?? DEFAULT_TAB_GROUPS).map((g) => ({ label: g.label, tabs: withoutHidden(filterEnabled(g.tabs, props.enabledTabs)) })).filter((g) => g.tabs.length > 0);
20032
20131
  const orderedTabs = () => [
20033
20132
  ...visibleTopTabs(),
20034
20133
  ...visibleGroups().flatMap((g) => g.tabs)
@@ -20036,9 +20135,9 @@ function AdminDashboard(props) {
20036
20135
  const isTabEnabled = (tab) => orderedTabs().includes(tab);
20037
20136
  const affiliatesEnabled = () => props.enabledTabs ? props.enabledTabs.includes("affiliates") : true;
20038
20137
  const fallbackTab = () => props.defaultTab ?? orderedTabs()[0] ?? "dashboard";
20039
- const [internalTab, setInternalTab] = createSignal37(fallbackTab());
20138
+ const [internalTab, setInternalTab] = createSignal38(fallbackTab());
20040
20139
  const currentTab = () => props.activeTab ?? internalTab();
20041
- const [drawerOpen, setDrawerOpen] = createSignal37(false);
20140
+ const [drawerOpen, setDrawerOpen] = createSignal38(false);
20042
20141
  createEffect13(() => {
20043
20142
  setAdminToast(props.toast);
20044
20143
  });
@@ -20058,9 +20157,14 @@ function AdminDashboard(props) {
20058
20157
  if (!auth) return true;
20059
20158
  return auth.isAuthenticated() && auth.isHydrated() && auth.isAdmin();
20060
20159
  };
20061
- const [pendingCustomerUid, setPendingCustomerUid] = createSignal37(null);
20062
- const [pendingThreadId, setPendingThreadId] = createSignal37(null);
20063
- const [pendingTemplateId, setPendingTemplateId] = createSignal37(null);
20160
+ createEffect13(() => {
20161
+ if (!adminAllowed()) return;
20162
+ void adminApi.getSupportChannel().then((s) => setSupportChannelMode(s.mode)).catch(() => {
20163
+ });
20164
+ });
20165
+ const [pendingCustomerUid, setPendingCustomerUid] = createSignal38(null);
20166
+ const [pendingThreadId, setPendingThreadId] = createSignal38(null);
20167
+ const [pendingTemplateId, setPendingTemplateId] = createSignal38(null);
20064
20168
  const handleTabClick = (tab, opts) => {
20065
20169
  if (!opts?.keepPending) {
20066
20170
  setPendingCustomerUid(null);
@@ -20808,13 +20912,13 @@ function UpdatePaymentMethod(props) {
20808
20912
  }
20809
20913
 
20810
20914
  // src/pages/MemberPortal.tsx
20811
- import { Show as Show65, Switch as Switch5, Match as Match5, For as For50, createSignal as createSignal44, onMount as onMount7 } from "solid-js";
20915
+ import { Show as Show65, Switch as Switch5, Match as Match5, For as For50, createSignal as createSignal45, onMount as onMount7 } from "solid-js";
20812
20916
 
20813
20917
  // src/pages/member/OrderTracker.tsx
20814
- import { Show as Show58, For as For45, createSignal as createSignal38 } from "solid-js";
20918
+ import { Show as Show58, For as For45, createSignal as createSignal39 } from "solid-js";
20815
20919
  function TrackingChip(props) {
20816
20920
  let copied;
20817
- const [announce, setAnnounce] = createSignal38("");
20921
+ const [announce, setAnnounce] = createSignal39("");
20818
20922
  const copy = async () => {
20819
20923
  try {
20820
20924
  await navigator.clipboard.writeText(props.number);
@@ -21022,7 +21126,7 @@ function OrderTracker(props) {
21022
21126
  }
21023
21127
 
21024
21128
  // src/pages/member/RxRow.tsx
21025
- import { Show as Show59, createSignal as createSignal39 } from "solid-js";
21129
+ import { Show as Show59, createSignal as createSignal40 } from "solid-js";
21026
21130
  var STATUS_LABEL = {
21027
21131
  pending: "Under review",
21028
21132
  approved: "Approved",
@@ -21033,7 +21137,7 @@ var STATUS_LABEL = {
21033
21137
  denied: "Not approved"
21034
21138
  };
21035
21139
  function RxRow(props) {
21036
- const [open, setOpen] = createSignal39(false);
21140
+ const [open, setOpen] = createSignal40(false);
21037
21141
  const label3 = () => {
21038
21142
  if (props.rx.status === "approved" && props.rx.delivery?.trackingNumber) return "On its way";
21039
21143
  return STATUS_LABEL[props.rx.status] ?? props.rx.status;
@@ -21072,7 +21176,7 @@ function RxRow(props) {
21072
21176
  }
21073
21177
 
21074
21178
  // src/pages/member/PlanBilling.tsx
21075
- import { Show as Show60, createSignal as createSignal40 } from "solid-js";
21179
+ import { Show as Show60, createSignal as createSignal41 } from "solid-js";
21076
21180
  function formatCents(cents) {
21077
21181
  if (cents == null || Number.isNaN(cents)) return "\u2014";
21078
21182
  return `$${(cents / 100).toFixed(2)}`;
@@ -21093,9 +21197,9 @@ var STATUS_COPY = {
21093
21197
  };
21094
21198
  var LIVE_STATUSES = /* @__PURE__ */ new Set(["active", "paused", "past_due"]);
21095
21199
  function PlanBilling(props) {
21096
- const [action, setAction] = createSignal40(null);
21097
- const [confirmCancel, setConfirmCancel] = createSignal40(false);
21098
- const [error, setError] = createSignal40(null);
21200
+ const [action, setAction] = createSignal41(null);
21201
+ const [confirmCancel, setConfirmCancel] = createSignal41(false);
21202
+ const [error, setError] = createSignal41(null);
21099
21203
  const primary = () => {
21100
21204
  const subs = props.subscriptions;
21101
21205
  return subs.find((s) => LIVE_STATUSES.has(s.status)) ?? subs[0] ?? null;
@@ -21322,13 +21426,13 @@ function AccountPanel(props) {
21322
21426
  }
21323
21427
 
21324
21428
  // src/pages/member/MedicationGuide.tsx
21325
- import { Show as Show62, For as For47, createSignal as createSignal41 } from "solid-js";
21429
+ import { Show as Show62, For as For47, createSignal as createSignal42 } from "solid-js";
21326
21430
  function firstNumber(s) {
21327
21431
  const m = (s || "").match(/\d+(\.\d+)?/);
21328
21432
  return m ? m[0] : null;
21329
21433
  }
21330
21434
  function MedicationGuide(props) {
21331
- const [showDisclaimers, setShowDisclaimers] = createSignal41(false);
21435
+ const [showDisclaimers, setShowDisclaimers] = createSignal42(false);
21332
21436
  const activeTitrationIndex = () => {
21333
21437
  const dose = firstNumber(props.currentDose);
21334
21438
  if (!dose) return -1;
@@ -21479,7 +21583,7 @@ function MedicationGuide(props) {
21479
21583
  }
21480
21584
 
21481
21585
  // src/pages/member/MessagesPanel.tsx
21482
- import { Show as Show63, For as For48, Switch as Switch4, Match as Match4, createEffect as createEffect14, createSignal as createSignal42, on as on8 } from "solid-js";
21586
+ import { Show as Show63, For as For48, Switch as Switch4, Match as Match4, createEffect as createEffect14, createSignal as createSignal43, on as on8 } from "solid-js";
21483
21587
  import DOMPurify from "dompurify";
21484
21588
  function sanitizeMessageHtml(html) {
21485
21589
  return DOMPurify.sanitize(html, {
@@ -21534,11 +21638,14 @@ function rejectionReason(file) {
21534
21638
  }
21535
21639
  function MessagesPanel(props) {
21536
21640
  const thread = () => props.thread;
21537
- const [channel, setChannel] = createSignal42("gate");
21538
- const [threadNotFound, setThreadNotFound] = createSignal42(false);
21539
- const [pendingThreadIntentId, setPendingThreadIntentId] = createSignal42(null);
21641
+ const [channel, setChannel] = createSignal43("gate");
21642
+ const [threadNotFound, setThreadNotFound] = createSignal43(false);
21643
+ const [pendingThreadIntentId, setPendingThreadIntentId] = createSignal43(null);
21644
+ const emailSupport = () => thread().supportChannel() === "email";
21645
+ const [emailSent, setEmailSent] = createSignal43(false);
21540
21646
  function switchChannel(next) {
21541
21647
  thread().clearSelection();
21648
+ setEmailSent(false);
21542
21649
  setChannel(next);
21543
21650
  }
21544
21651
  function goToGate() {
@@ -21547,17 +21654,17 @@ function MessagesPanel(props) {
21547
21654
  setThreadNotFound(false);
21548
21655
  setPendingThreadIntentId(null);
21549
21656
  }
21550
- const [composing, setComposing] = createSignal42(false);
21551
- const [composeStep, setComposeStep] = createSignal42(
21657
+ const [composing, setComposing] = createSignal43(false);
21658
+ const [composeStep, setComposeStep] = createSignal43(
21552
21659
  "support"
21553
21660
  );
21554
- const [newSubject, setNewSubject] = createSignal42("");
21555
- const [newBody, setNewBody] = createSignal42("");
21556
- const [newCategory, setNewCategory] = createSignal42(null);
21557
- const [composeError, setComposeError] = createSignal42(null);
21558
- const [pendingFile, setPendingFile] = createSignal42(null);
21559
- const [newFile, setNewFile] = createSignal42(null);
21560
- const [attachError, setAttachError] = createSignal42(null);
21661
+ const [newSubject, setNewSubject] = createSignal43("");
21662
+ const [newBody, setNewBody] = createSignal43("");
21663
+ const [newCategory, setNewCategory] = createSignal43(null);
21664
+ const [composeError, setComposeError] = createSignal43(null);
21665
+ const [pendingFile, setPendingFile] = createSignal43(null);
21666
+ const [newFile, setNewFile] = createSignal43(null);
21667
+ const [attachError, setAttachError] = createSignal43(null);
21561
21668
  function stageFile(input, set) {
21562
21669
  const file = input.files?.[0];
21563
21670
  input.value = "";
@@ -21650,6 +21757,24 @@ function MessagesPanel(props) {
21650
21757
  async function submitCompose(e) {
21651
21758
  e.preventDefault();
21652
21759
  setComposeError(null);
21760
+ if (emailSupport()) {
21761
+ const sent = await thread().sendSupportEmail(
21762
+ newSubject(),
21763
+ newBody(),
21764
+ newFile() ?? void 0,
21765
+ newCategory()
21766
+ );
21767
+ if (!sent) {
21768
+ setComposeError("That didn't send. Please try again.");
21769
+ return;
21770
+ }
21771
+ setNewSubject("");
21772
+ setNewBody("");
21773
+ setNewCategory(null);
21774
+ setNewFile(null);
21775
+ setEmailSent(true);
21776
+ return;
21777
+ }
21653
21778
  const result = await thread().startSupportThread(
21654
21779
  newSubject(),
21655
21780
  newBody(),
@@ -21790,8 +21915,8 @@ function MessagesPanel(props) {
21790
21915
  </div>
21791
21916
  </>;
21792
21917
  const Attachment = (p) => {
21793
- const [url, setUrl] = createSignal42(p.attachment.url ?? null);
21794
- const [failed, setFailed] = createSignal42(false);
21918
+ const [url, setUrl] = createSignal43(p.attachment.url ?? null);
21919
+ const [failed, setFailed] = createSignal43(false);
21795
21920
  let retried = false;
21796
21921
  const resolve = async (force = false) => {
21797
21922
  const next = await thread().resolveAttachmentUrl(p.attachment.id, force);
@@ -21899,13 +22024,15 @@ function MessagesPanel(props) {
21899
22024
  class="msg-thread__back-btn"
21900
22025
  aria-label="Back"
21901
22026
  data-testid="support-compose-back"
21902
- onClick={() => setComposing(false)}
22027
+ onClick={() => emailSupport() ? goToGate() : setComposing(false)}
21903
22028
  >
21904
22029
  <i class="ph-thin ph-arrow-left" aria-hidden="true" />
21905
22030
  </button>
21906
22031
  <div>
21907
22032
  <h3 class="msg-thread__name">Message support</h3>
21908
- <p class="msg-thread__role">We usually reply within one business day</p>
22033
+ <p class="msg-thread__role" data-testid="support-compose-reply-note">
22034
+ {emailSupport() ? "We'll reply by email, usually within one business day" : "We usually reply within one business day"}
22035
+ </p>
21909
22036
  </div>
21910
22037
  </div>
21911
22038
 
@@ -22115,7 +22242,7 @@ function MessagesPanel(props) {
22115
22242
  data-testid="gate-support-loading"
22116
22243
  />}
22117
22244
  >
22118
- <Show63 when={supportUnreadCount() > 0}>
22245
+ <Show63 when={supportUnreadCount() > 0 && !emailSupport()}>
22119
22246
  <span class="msg-choice__option-badge" data-testid="gate-support-badge">
22120
22247
  {supportUnreadCount()}
22121
22248
  </span>
@@ -22164,6 +22291,32 @@ function MessagesPanel(props) {
22164
22291
  </button>
22165
22292
  </div>
22166
22293
  </div>;
22294
+ const SupportEmailSent = () => <div class="msg-thread msg-choice" data-testid="support-email-sent">
22295
+ <div class="msg-thread__header">
22296
+ <button type="button" class="msg-thread__back-btn" aria-label="Back" onClick={goToGate}>
22297
+ <i class="ph-thin ph-arrow-left" aria-hidden="true" />
22298
+ </button>
22299
+ <div>
22300
+ <h3 class="msg-thread__name">Message sent</h3>
22301
+ <p class="msg-thread__role">Support</p>
22302
+ </div>
22303
+ </div>
22304
+
22305
+ <div class="msg-choice__notice">
22306
+ <p class="msg-choice__notice-text">
22307
+ Thanks, your message is on its way to our support team. We'll reply by email, usually
22308
+ within one business day.
22309
+ </p>
22310
+ <button
22311
+ type="button"
22312
+ class="portal-btn portal-btn--primary"
22313
+ data-testid="support-email-another"
22314
+ onClick={() => setEmailSent(false)}
22315
+ >
22316
+ Send another message
22317
+ </button>
22318
+ </div>
22319
+ </div>;
22167
22320
  const Thread = () => <>
22168
22321
  <div class="msg-thread__header">
22169
22322
  <button
@@ -22307,6 +22460,19 @@ function MessagesPanel(props) {
22307
22460
  fallback={<div class="msg-panel__layout msg-panel__layout--gate">
22308
22461
  <ChannelGate />
22309
22462
  </div>}
22463
+ >
22464
+ <Show63
22465
+ when={!(channel() === "support" && emailSupport() && thread().selectedId() == null)}
22466
+ fallback={
22467
+ // Email-channel support: the form (or its confirmation) and nothing
22468
+ // else. A deep-linked thread that predates the switch still opens
22469
+ // in the normal layout below, since it has a selection.
22470
+ <div class="msg-panel__layout msg-panel__layout--gate">
22471
+ <Show63 when={!emailSent()} fallback={<SupportEmailSent />}>
22472
+ <NewSupportThread />
22473
+ </Show63>
22474
+ </div>
22475
+ }
22310
22476
  >
22311
22477
  <div class="msg-panel__layout">
22312
22478
  <div class={`msg-panel__sidebar${threadOpen() ? " msg-panel__sidebar--hidden-mobile" : ""}`}>
@@ -22338,12 +22504,13 @@ function MessagesPanel(props) {
22338
22504
  </Show63>
22339
22505
  </div>
22340
22506
  </div>
22507
+ </Show63>
22341
22508
  </Show63>
22342
22509
  </div>;
22343
22510
  }
22344
22511
 
22345
22512
  // src/pages/member/SurveyHistory.tsx
22346
- import { createSignal as createSignal43, createResource as createResource29, For as For49, Show as Show64 } from "solid-js";
22513
+ import { createSignal as createSignal44, createResource as createResource29, For as For49, Show as Show64 } from "solid-js";
22347
22514
  var MODE_LABELS = {
22348
22515
  initial: "Intake questionnaire",
22349
22516
  refill: "Refill check-in"
@@ -22362,7 +22529,7 @@ function SurveyHistory() {
22362
22529
  const [list] = createResource29(
22363
22530
  () => membersApi.getSurveyResponses().then((r) => r.responses).catch(asEmptyOn404([]))
22364
22531
  );
22365
- const [selectedId, setSelectedId] = createSignal43(null);
22532
+ const [selectedId, setSelectedId] = createSignal44(null);
22366
22533
  const [detail] = createResource29(
22367
22534
  selectedId,
22368
22535
  (id) => membersApi.getSurveyResponse(id).catch(asEmptyOn404(null))
@@ -22515,15 +22682,15 @@ function MemberPortal(props) {
22515
22682
  }
22516
22683
  return null;
22517
22684
  };
22518
- const [tab, setTab] = createSignal44(resolveTabFromUrl() ?? "tracker");
22519
- const [intent, setIntent] = createSignal44(resolveIntentFromUrl());
22685
+ const [tab, setTab] = createSignal45(resolveTabFromUrl() ?? "tracker");
22686
+ const [intent, setIntent] = createSignal45(resolveIntentFromUrl());
22520
22687
  onMount7(() => {
22521
22688
  const resolved = resolveTabFromUrl();
22522
22689
  if (resolved && resolved !== tab()) setTab(resolved);
22523
22690
  const resolvedIntent = resolveIntentFromUrl();
22524
22691
  if (resolvedIntent) setIntent(resolvedIntent);
22525
22692
  });
22526
- const [offers, setOffers] = createSignal44([]);
22693
+ const [offers, setOffers] = createSignal45([]);
22527
22694
  onMount7(() => {
22528
22695
  if (!props.auth.isAuthenticated()) return;
22529
22696
  offersApi.mine().then((r) => setOffers(r.offers ?? [])).catch(() => setOffers([]));
@@ -22735,7 +22902,7 @@ function MemberPortal(props) {
22735
22902
  }
22736
22903
 
22737
22904
  // src/pages/AffiliatePortal.tsx
22738
- import { createEffect as createEffect15, createSignal as createSignal46, Match as Match6, Show as Show71, Switch as Switch6, For as For55 } from "solid-js";
22905
+ import { createEffect as createEffect15, createSignal as createSignal47, Match as Match6, Show as Show71, Switch as Switch6, For as For55 } from "solid-js";
22739
22906
 
22740
22907
  // src/pages/affiliate/Overview.tsx
22741
22908
  import { Show as Show66, For as For51 } from "solid-js";
@@ -23087,10 +23254,10 @@ function td2() {
23087
23254
  }
23088
23255
 
23089
23256
  // src/pages/affiliate/ReferralLink.tsx
23090
- import { Show as Show69, createSignal as createSignal45, createMemo as createMemo16 } from "solid-js";
23257
+ import { Show as Show69, createSignal as createSignal46, createMemo as createMemo16 } from "solid-js";
23091
23258
  function AffiliateReferralLink() {
23092
23259
  const { links } = useAffiliateLinks();
23093
- const [copied, setCopied] = createSignal45(false);
23260
+ const [copied, setCopied] = createSignal46(false);
23094
23261
  const homepageLink = createMemo16(() => {
23095
23262
  const l = links();
23096
23263
  const affiliate = affiliateAuth_default.affiliate();
@@ -23318,9 +23485,9 @@ var TAB_ORDER = [
23318
23485
  function AffiliatePortal(props) {
23319
23486
  const orderedTabs = () => props.enabledTabs ? TAB_ORDER.filter((t) => props.enabledTabs.includes(t)) : TAB_ORDER;
23320
23487
  const fallbackTab = () => props.defaultTab ?? orderedTabs()[0] ?? "overview";
23321
- const [internalTab, setInternalTab] = createSignal46(fallbackTab());
23488
+ const [internalTab, setInternalTab] = createSignal47(fallbackTab());
23322
23489
  const currentTab = () => props.activeTab ?? internalTab();
23323
- const [drawerOpen, setDrawerOpen] = createSignal46(false);
23490
+ const [drawerOpen, setDrawerOpen] = createSignal47(false);
23324
23491
  createEffect15(() => {
23325
23492
  const auth = props.auth;
23326
23493
  if (!auth) return;
@@ -23472,12 +23639,12 @@ function AffiliateGateSpinner(props) {
23472
23639
  }
23473
23640
 
23474
23641
  // src/pages/AffiliateRegister.tsx
23475
- import { createSignal as createSignal48, Show as Show72 } from "solid-js";
23642
+ import { createSignal as createSignal49, Show as Show72 } from "solid-js";
23476
23643
 
23477
23644
  // src/pages/AffiliatePasswordInput.tsx
23478
- import { createSignal as createSignal47 } from "solid-js";
23645
+ import { createSignal as createSignal48 } from "solid-js";
23479
23646
  function AffiliatePasswordInput(props) {
23480
- const [visible, setVisible] = createSignal47(false);
23647
+ const [visible, setVisible] = createSignal48(false);
23481
23648
  return <div style={{ position: "relative" }}>
23482
23649
  <input
23483
23650
  type={visible() ? "text" : "password"}
@@ -23530,14 +23697,14 @@ function inputStyle() {
23530
23697
 
23531
23698
  // src/pages/AffiliateRegister.tsx
23532
23699
  function AffiliateRegister(props) {
23533
- const [firstName, setFirstName] = createSignal48("");
23534
- const [lastName, setLastName] = createSignal48("");
23535
- const [email, setEmail] = createSignal48("");
23536
- const [password, setPassword] = createSignal48("");
23537
- const [affiliateCode, setAffiliateCode] = createSignal48("");
23538
- const [submitting, setSubmitting] = createSignal48(false);
23539
- const [submitted, setSubmitted] = createSignal48(false);
23540
- const [error, setError] = createSignal48(null);
23700
+ const [firstName, setFirstName] = createSignal49("");
23701
+ const [lastName, setLastName] = createSignal49("");
23702
+ const [email, setEmail] = createSignal49("");
23703
+ const [password, setPassword] = createSignal49("");
23704
+ const [affiliateCode, setAffiliateCode] = createSignal49("");
23705
+ const [submitting, setSubmitting] = createSignal49(false);
23706
+ const [submitted, setSubmitted] = createSignal49(false);
23707
+ const [error, setError] = createSignal49(null);
23541
23708
  async function handleSubmit(e) {
23542
23709
  e.preventDefault();
23543
23710
  setError(null);
@@ -23792,12 +23959,12 @@ function linkStyle() {
23792
23959
  }
23793
23960
 
23794
23961
  // src/pages/AffiliateLogin.tsx
23795
- import { createSignal as createSignal49, Show as Show73 } from "solid-js";
23962
+ import { createSignal as createSignal50, Show as Show73 } from "solid-js";
23796
23963
  function AffiliateLogin(props) {
23797
- const [email, setEmail] = createSignal49("");
23798
- const [password, setPassword] = createSignal49("");
23799
- const [submitting, setSubmitting] = createSignal49(false);
23800
- const [error, setError] = createSignal49(null);
23964
+ const [email, setEmail] = createSignal50("");
23965
+ const [password, setPassword] = createSignal50("");
23966
+ const [submitting, setSubmitting] = createSignal50(false);
23967
+ const [error, setError] = createSignal50(null);
23801
23968
  async function handleSubmit(e) {
23802
23969
  e.preventDefault();
23803
23970
  setError(null);
@@ -23967,12 +24134,12 @@ function inputStyle3() {
23967
24134
  }
23968
24135
 
23969
24136
  // src/pages/ForgotPassword.tsx
23970
- import { createSignal as createSignal50, Show as Show74 } from "solid-js";
24137
+ import { createSignal as createSignal51, Show as Show74 } from "solid-js";
23971
24138
  function ForgotPasswordPage(props) {
23972
- const [email, setEmail] = createSignal50("");
23973
- const [submitting, setSubmitting] = createSignal50(false);
23974
- const [error, setError] = createSignal50(null);
23975
- const [message, setMessage] = createSignal50(null);
24139
+ const [email, setEmail] = createSignal51("");
24140
+ const [submitting, setSubmitting] = createSignal51(false);
24141
+ const [error, setError] = createSignal51(null);
24142
+ const [message, setMessage] = createSignal51(null);
23976
24143
  async function handleSubmit(e) {
23977
24144
  e.preventDefault();
23978
24145
  setError(null);
@@ -24133,7 +24300,7 @@ function inputStyle4() {
24133
24300
  }
24134
24301
 
24135
24302
  // src/pages/ResetPassword.tsx
24136
- import { createSignal as createSignal51, Show as Show75 } from "solid-js";
24303
+ import { createSignal as createSignal52, Show as Show75 } from "solid-js";
24137
24304
  function queryParam(name) {
24138
24305
  if (typeof window === "undefined") return "";
24139
24306
  return new URLSearchParams(window.location.search).get(name) ?? "";
@@ -24141,11 +24308,11 @@ function queryParam(name) {
24141
24308
  function ResetPasswordPage(props) {
24142
24309
  const token = () => props.token ?? queryParam("token");
24143
24310
  const email = () => props.email ?? queryParam("email");
24144
- const [password, setPassword] = createSignal51("");
24145
- const [confirm2, setConfirm] = createSignal51("");
24146
- const [submitting, setSubmitting] = createSignal51(false);
24147
- const [error, setError] = createSignal51(null);
24148
- const [message, setMessage] = createSignal51(null);
24311
+ const [password, setPassword] = createSignal52("");
24312
+ const [confirm2, setConfirm] = createSignal52("");
24313
+ const [submitting, setSubmitting] = createSignal52(false);
24314
+ const [error, setError] = createSignal52(null);
24315
+ const [message, setMessage] = createSignal52(null);
24149
24316
  async function handleSubmit(e) {
24150
24317
  e.preventDefault();
24151
24318
  setError(null);
@@ -24306,12 +24473,12 @@ function inputStyle5() {
24306
24473
  }
24307
24474
 
24308
24475
  // src/pages/AffiliateForgotPassword.tsx
24309
- import { createSignal as createSignal52, Show as Show76 } from "solid-js";
24476
+ import { createSignal as createSignal53, Show as Show76 } from "solid-js";
24310
24477
  function AffiliateForgotPassword(props) {
24311
- const [email, setEmail] = createSignal52("");
24312
- const [submitting, setSubmitting] = createSignal52(false);
24313
- const [error, setError] = createSignal52(null);
24314
- const [message, setMessage] = createSignal52(null);
24478
+ const [email, setEmail] = createSignal53("");
24479
+ const [submitting, setSubmitting] = createSignal53(false);
24480
+ const [error, setError] = createSignal53(null);
24481
+ const [message, setMessage] = createSignal53(null);
24315
24482
  async function handleSubmit(e) {
24316
24483
  e.preventDefault();
24317
24484
  setError(null);
@@ -24457,7 +24624,7 @@ function linkStyle2() {
24457
24624
  }
24458
24625
 
24459
24626
  // src/pages/AffiliateResetPassword.tsx
24460
- import { createSignal as createSignal53, Show as Show77 } from "solid-js";
24627
+ import { createSignal as createSignal54, Show as Show77 } from "solid-js";
24461
24628
  function queryParam2(name) {
24462
24629
  if (typeof window === "undefined") return "";
24463
24630
  return new URLSearchParams(window.location.search).get(name) ?? "";
@@ -24465,11 +24632,11 @@ function queryParam2(name) {
24465
24632
  function AffiliateResetPassword(props) {
24466
24633
  const token = () => props.token ?? queryParam2("token");
24467
24634
  const email = () => props.email ?? queryParam2("email");
24468
- const [password, setPassword] = createSignal53("");
24469
- const [confirm2, setConfirm] = createSignal53("");
24470
- const [submitting, setSubmitting] = createSignal53(false);
24471
- const [error, setError] = createSignal53(null);
24472
- const [done, setDone] = createSignal53(false);
24635
+ const [password, setPassword] = createSignal54("");
24636
+ const [confirm2, setConfirm] = createSignal54("");
24637
+ const [submitting, setSubmitting] = createSignal54(false);
24638
+ const [error, setError] = createSignal54(null);
24639
+ const [done, setDone] = createSignal54(false);
24473
24640
  async function handleSubmit(e) {
24474
24641
  e.preventDefault();
24475
24642
  setError(null);
@@ -24637,4 +24804,4 @@ export {
24637
24804
  AffiliateForgotPassword,
24638
24805
  AffiliateResetPassword
24639
24806
  };
24640
- //# sourceMappingURL=WO4H2CXD.jsx.map
24807
+ //# sourceMappingURL=2YG6QASH.jsx.map