@apextelemed/partner-core 0.5.0 → 0.5.2

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 (39) 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/{Z2CR6WKF.jsx → 2UWULNSX.jsx} +2 -2
  5. package/dist/chunk/{ITK5F5AI.js → 5D7SGF46.js} +2 -2
  6. package/dist/chunk/{ITK5F5AI.js.map → 5D7SGF46.js.map} +1 -1
  7. package/dist/chunk/{4YUUZ532.js → 7ZESUC4Q.js} +3 -3
  8. package/dist/chunk/{4YUUZ532.js.map → 7ZESUC4Q.js.map} +1 -1
  9. package/dist/chunk/{NNTB7KL5.js → C7TELVJF.js} +3 -3
  10. package/dist/chunk/{NNTB7KL5.js.map → C7TELVJF.js.map} +1 -1
  11. package/dist/chunk/{B5RBZKAK.jsx → DQE4K55D.jsx} +1 -1
  12. package/dist/chunk/{GGY7VMZ2.jsx → FUOUTRAO.jsx} +2 -2
  13. package/dist/chunk/{CXBPVQ7W.jsx → GNG53L37.jsx} +2 -2
  14. package/dist/chunk/{4W5ONAFF.js → GPVYUP3H.js} +5 -5
  15. package/dist/chunk/{4W5ONAFF.js.map → GPVYUP3H.js.map} +1 -1
  16. package/dist/chunk/{YPZVHEBG.jsx → I322BQIU.jsx} +68 -22
  17. package/dist/chunk/{6QC4BETO.jsx → JTG4H4I5.jsx} +4 -4
  18. package/dist/chunk/{7COJH6FZ.js → KO2JPCIP.js} +196 -133
  19. package/dist/chunk/KO2JPCIP.js.map +1 -0
  20. package/dist/chunk/{O4V2YXBF.js → XHOD3HUQ.js} +3 -3
  21. package/dist/chunk/{O4V2YXBF.js.map → XHOD3HUQ.js.map} +1 -1
  22. package/dist/chunk/{6MDLP62Y.js → ZD2MMEXL.js} +6 -6
  23. package/dist/chunk/{6MDLP62Y.js.map → ZD2MMEXL.js.map} +1 -1
  24. package/dist/chunk/{5CXUPFZU.jsx → ZJENZPAM.jsx} +5 -5
  25. package/dist/{client-Cm6n4V0r.d.ts → client-BD9_HCZY.d.ts} +8 -0
  26. package/dist/flows/index.d.ts +1 -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/7COJH6FZ.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { disqualificationReasonText, qualifiedDrugIds } from './LZWA44KD.js';
2
- import { useSurveyFlow, resolveSurveyV2DrugIntent, emailGateAnswered, redeemResumeLink, useSurveyV2Flow, availableStateOptions, US_STATE_OPTIONS, useCheckoutFlow, useCartCheckoutFlow, useSignupFlow, useRegisterFlow, useSubscribeFlow, useDashboardData, useUpdatePaymentMethodFlow, useMemberPortalData, useMessagesThread, captureFunnelEmail, markEmailGateAnswered, useAffiliateStats, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, stateAvailabilityNote, hasStateRestrictions, uploadPrescriptionPhoto, deriveAttention, deriveJourney, buildTimeline, lifecycleReason, accountSource, LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, formatConversationTime, buildTrackerView, ACCOUNT_SOURCE_LABEL, fmtDay, formatCalendarDate, formatMessageTime, formatEventDate, formatStageDate, LIFECYCLE_TONE, buildTrackingUrl, isImageAttachment, buildRefillView, toTrackerRequest } from './4W5ONAFF.js';
3
- import { fetchFunnelConfig } from './4YUUZ532.js';
2
+ import { useSurveyFlow, resolveSurveyV2DrugIntent, emailGateAnswered, redeemResumeLink, useSurveyV2Flow, availableStateOptions, US_STATE_OPTIONS, useCheckoutFlow, useCartCheckoutFlow, useSignupFlow, useRegisterFlow, useSubscribeFlow, useDashboardData, useUpdatePaymentMethodFlow, useMemberPortalData, useMessagesThread, captureFunnelEmail, markEmailGateAnswered, useAffiliateStats, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, stateAvailabilityNote, hasStateRestrictions, uploadPrescriptionPhoto, deriveAttention, deriveJourney, buildTimeline, lifecycleReason, accountSource, LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, formatConversationTime, buildTrackerView, ACCOUNT_SOURCE_LABEL, fmtDay, formatCalendarDate, formatMessageTime, formatEventDate, formatStageDate, LIFECYCLE_TONE, buildTrackingUrl, isImageAttachment, buildRefillView, toTrackerRequest } from './GPVYUP3H.js';
3
+ import { fetchFunnelConfig } from './7ZESUC4Q.js';
4
4
  import { usePrimitives } from './67KHO66G.js';
5
- import { auth_default, cart_default, affiliateAuth_default } from './NNTB7KL5.js';
6
- import { usersApi, adminApi, membersApi, affiliatePortalApi, authApi, adminAffiliatesApi, SUPPORT_ATTACHMENT_MIME_TYPES, SUPPORT_ATTACHMENT_MAX_BYTES, apiFetch, apexApi, subscriptionsApi, ApiError } from './ITK5F5AI.js';
5
+ import { auth_default, cart_default, affiliateAuth_default } from './C7TELVJF.js';
6
+ import { usersApi, adminApi, membersApi, affiliatePortalApi, authApi, adminAffiliatesApi, SUPPORT_ATTACHMENT_MIME_TYPES, SUPPORT_ATTACHMENT_MAX_BYTES, apiFetch, apexApi, subscriptionsApi, ApiError } from './5D7SGF46.js';
7
7
  import { delegateEvents, createComponent, insert, memo, effect, setStyleProperty, mergeProps, use, setAttribute, addEventListener, style, className, Dynamic, template } from 'solid-js/web';
8
8
  import { createContext, createEffect, on, Show, For, createResource, createSignal, createMemo, Index, ErrorBoundary, Switch, Match, onMount, onCleanup, useContext } from 'solid-js';
9
9
  import { isQuestionVisible } from '@apextelemed/survey-core';
@@ -11166,6 +11166,41 @@ function RequestCard(props) {
11166
11166
  return _el$;
11167
11167
  })();
11168
11168
  }
11169
+
11170
+ // src/pages/admin/customers/subscriptionTerms.ts
11171
+ function nextChargeCents(s) {
11172
+ return s.nextChargeCents ?? s.amountCents;
11173
+ }
11174
+ function charges(n) {
11175
+ return `${n} more ${n === 1 ? "charge" : "charges"}`;
11176
+ }
11177
+ function priceChange(s) {
11178
+ const next = nextChargeCents(s);
11179
+ const base = s.baseAmountCents;
11180
+ if (next == null || base == null || base <= next) return null;
11181
+ if (s.discountRecurringIndefinite) return `${centsToUsd(base - next)} off ongoing`;
11182
+ const remaining = s.discountRecurringRemaining ?? 0;
11183
+ if (s.billingMode !== "gateway" && remaining > 0) return `then ${centsToUsd(base)} after ${charges(remaining)}`;
11184
+ return `then ${centsToUsd(base)}`;
11185
+ }
11186
+ function priceLine(s) {
11187
+ const every = `${centsToUsd(nextChargeCents(s))} every ${s.intervalDays ?? 30} days`;
11188
+ const change = priceChange(s);
11189
+ return change ? `${every}, ${change}` : every;
11190
+ }
11191
+ function discountTerms(s) {
11192
+ const amount = s.amountCents;
11193
+ const base = s.baseAmountCents;
11194
+ const off = amount != null && base != null && base > amount ? `${centsToUsd(base - amount)} off` : null;
11195
+ const remaining = s.discountRecurringRemaining ?? 0;
11196
+ if (s.discountRecurringIndefinite) return off ? `${off}, ongoing` : "Recurring, ongoing";
11197
+ if (remaining > 0) return off ? `${off}, ${charges(remaining)}` : `Recurring, ${charges(remaining)}`;
11198
+ if (!off || base == null) return null;
11199
+ const next = nextChargeCents(s);
11200
+ return next != null && next >= base ? `${off}, ended` : `${off}, first charge only`;
11201
+ }
11202
+
11203
+ // src/pages/admin/customers/sections/SubscriptionCard.tsx
11169
11204
  var _tmpl$161 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11170
11205
  var _tmpl$257 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change amount`);
11171
11206
  var _tmpl$340 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change schedule`);
@@ -11174,7 +11209,7 @@ var _tmpl$527 = /* @__PURE__ */ template(`<button type=button class="app-admin-b
11174
11209
  var _tmpl$626 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-danger">`);
11175
11210
  var _tmpl$724 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap style=margin-top:0.5rem><table class=app-admin-table style=font-size:0.8125rem><thead><tr><th>When</th><th>Period</th><th>Amount</th><th>Outcome</th><th>Reason</th><th></th></tr></thead><tbody>`);
11176
11211
  var _tmpl$821 = /* @__PURE__ */ template(`<div style=margin-top:0.875rem><button type=button class=app-admin-link-btn> billing attempts (<!>)`);
11177
- var _tmpl$918 = /* @__PURE__ */ template(`<article class=app-admin-card-soft style="padding:1rem 1.25rem"><div style=display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:0.75rem><div style=min-width:0><div style=display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap><span style=font-weight:600></span></div><div class=app-admin-text-muted style=font-size:0.875rem;margin-top:0.25rem> every <!> days<!> \xB7 </div></div><div style=display:flex;flex-wrap:wrap;gap:0.375rem></div></div><div style=margin-top:0.875rem>`);
11212
+ var _tmpl$918 = /* @__PURE__ */ template(`<article class=app-admin-card-soft style="padding:1rem 1.25rem"><div style=display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:0.75rem><div style=min-width:0><div style=display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap><span style=font-weight:600></span></div><div class=app-admin-text-muted style=font-size:0.875rem;margin-top:0.25rem> \xB7 </div></div><div style=display:flex;flex-wrap:wrap;gap:0.375rem></div></div><div style=margin-top:0.875rem>`);
11178
11213
  var _tmpl$015 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11179
11214
  var _tmpl$169 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">Resolve`);
11180
11215
  var _tmpl$1010 = /* @__PURE__ */ template(`<tr><td data-label=When class=app-admin-text-muted></td><td data-label=Period class=app-admin-text-muted></td><td data-label=Amount></td><td data-label=Outcome><span></span></td><td data-label=Reason class=app-admin-text-muted></td><td data-label class=app-admin-table-cell--no-label>`);
@@ -11191,13 +11226,8 @@ function SubscriptionCard(props) {
11191
11226
  const [showAttempts, setShowAttempts] = createSignal(s().status === "past_due" || s().status === "incomplete" || (s().billingAttempts ?? []).some((a) => a.status === "indeterminate"));
11192
11227
  const attempts = () => [...s().billingAttempts ?? []].sort((a, b) => Date.parse(b.createdAt ?? "") - Date.parse(a.createdAt ?? ""));
11193
11228
  const busy = (key) => props.busy === `${key}-${s().id}`;
11194
- const discount = () => {
11195
- if (s().discountRecurringIndefinite) return "Recurring discount, indefinite";
11196
- if ((s().discountRecurringRemaining ?? 0) > 0) return `Recurring discount, ${s().discountRecurringRemaining} charge${s().discountRecurringRemaining === 1 ? "" : "s"} left`;
11197
- return null;
11198
- };
11199
11229
  return (() => {
11200
- var _el$ = _tmpl$918(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$1 = _el$8.nextSibling, _el$9 = _el$1.nextSibling, _el$10 = _el$9.nextSibling; _el$10.nextSibling; var _el$11 = _el$3.nextSibling, _el$17 = _el$2.nextSibling;
11230
+ var _el$ = _tmpl$918(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$3.nextSibling, _el$13 = _el$2.nextSibling;
11201
11231
  insert(_el$5, () => subscriptionLabel(s()));
11202
11232
  insert(_el$4, createComponent(Show, {
11203
11233
  get when() {
@@ -11214,79 +11244,70 @@ function SubscriptionCard(props) {
11214
11244
  return s().status;
11215
11245
  }
11216
11246
  }), null);
11217
- insert(_el$7, () => centsToUsd(s().amountCents), _el$8);
11218
- insert(_el$7, () => s().intervalDays ?? 30, _el$1);
11219
- insert(_el$7, createComponent(Show, {
11220
- get when() {
11221
- return memo(() => s().baseAmountCents != null)() && s().baseAmountCents !== s().amountCents;
11222
- },
11223
- get children() {
11224
- return ` (then ${centsToUsd(s().baseAmountCents)})`;
11225
- }
11226
- }), _el$10);
11247
+ insert(_el$7, () => priceLine(s()), _el$8);
11227
11248
  insert(_el$7, () => gateway() ? "billed by the gateway" : "billed by the platform", null);
11228
- insert(_el$11, createComponent(Show, {
11249
+ insert(_el$9, createComponent(Show, {
11229
11250
  get when() {
11230
11251
  return live();
11231
11252
  },
11232
11253
  get children() {
11233
11254
  return [(() => {
11234
- var _el$12 = _tmpl$257();
11235
- _el$12.$$click = () => props.onEditAmount(s());
11255
+ var _el$0 = _tmpl$257();
11256
+ _el$0.$$click = () => props.onEditAmount(s());
11236
11257
  effect((_p$) => {
11237
11258
  var _v$ = gateway(), _v$2 = gateway() ? "The gateway holds this price; move the subscription to platform billing first." : void 0;
11238
- _v$ !== _p$.e && (_el$12.disabled = _p$.e = _v$);
11239
- _v$2 !== _p$.t && setAttribute(_el$12, "title", _p$.t = _v$2);
11259
+ _v$ !== _p$.e && (_el$0.disabled = _p$.e = _v$);
11260
+ _v$2 !== _p$.t && setAttribute(_el$0, "title", _p$.t = _v$2);
11240
11261
  return _p$;
11241
11262
  }, {
11242
11263
  e: void 0,
11243
11264
  t: void 0
11244
11265
  });
11245
- return _el$12;
11266
+ return _el$0;
11246
11267
  })(), (() => {
11247
- var _el$13 = _tmpl$340();
11248
- _el$13.$$click = () => props.onEditSchedule(s());
11249
- return _el$13;
11268
+ var _el$1 = _tmpl$340();
11269
+ _el$1.$$click = () => props.onEditSchedule(s());
11270
+ return _el$1;
11250
11271
  })()];
11251
11272
  }
11252
11273
  }), null);
11253
- insert(_el$11, createComponent(Show, {
11274
+ insert(_el$9, createComponent(Show, {
11254
11275
  get when() {
11255
11276
  return s().status === "active";
11256
11277
  },
11257
11278
  get children() {
11258
- var _el$14 = _tmpl$430();
11259
- _el$14.$$click = () => props.onPause(s());
11260
- insert(_el$14, () => busy("pause") ? "Pausing\u2026" : "Pause");
11261
- effect(() => _el$14.disabled = busy("pause"));
11262
- return _el$14;
11279
+ var _el$10 = _tmpl$430();
11280
+ _el$10.$$click = () => props.onPause(s());
11281
+ insert(_el$10, () => busy("pause") ? "Pausing\u2026" : "Pause");
11282
+ effect(() => _el$10.disabled = busy("pause"));
11283
+ return _el$10;
11263
11284
  }
11264
11285
  }), null);
11265
- insert(_el$11, createComponent(Show, {
11286
+ insert(_el$9, createComponent(Show, {
11266
11287
  get when() {
11267
11288
  return s().status === "paused";
11268
11289
  },
11269
11290
  get children() {
11270
- var _el$15 = _tmpl$527();
11271
- _el$15.$$click = () => props.onResume(s());
11272
- insert(_el$15, () => busy("resume") ? "Resuming\u2026" : "Resume");
11273
- effect(() => _el$15.disabled = busy("resume"));
11274
- return _el$15;
11291
+ var _el$11 = _tmpl$527();
11292
+ _el$11.$$click = () => props.onResume(s());
11293
+ insert(_el$11, () => busy("resume") ? "Resuming\u2026" : "Resume");
11294
+ effect(() => _el$11.disabled = busy("resume"));
11295
+ return _el$11;
11275
11296
  }
11276
11297
  }), null);
11277
- insert(_el$11, createComponent(Show, {
11298
+ insert(_el$9, createComponent(Show, {
11278
11299
  get when() {
11279
11300
  return live();
11280
11301
  },
11281
11302
  get children() {
11282
- var _el$16 = _tmpl$626();
11283
- _el$16.$$click = () => props.onCancel(s());
11284
- insert(_el$16, () => busy("cancel") ? "\u2026" : "Cancel");
11285
- effect(() => _el$16.disabled = busy("cancel"));
11286
- return _el$16;
11303
+ var _el$12 = _tmpl$626();
11304
+ _el$12.$$click = () => props.onCancel(s());
11305
+ insert(_el$12, () => busy("cancel") ? "\u2026" : "Cancel");
11306
+ effect(() => _el$12.disabled = busy("cancel"));
11307
+ return _el$12;
11287
11308
  }
11288
11309
  }), null);
11289
- insert(_el$17, createComponent(KeyValueList, {
11310
+ insert(_el$13, createComponent(KeyValueList, {
11290
11311
  get items() {
11291
11312
  return [{
11292
11313
  label: "Next charge",
@@ -11306,15 +11327,21 @@ function SubscriptionCard(props) {
11306
11327
  }, {
11307
11328
  label: "Retries",
11308
11329
  value: s().retryCount ? `${s().retryCount}${s().lastAttemptAt ? `, last ${fmtDate(s().lastAttemptAt)}` : ""}` : null
11330
+ }, {
11331
+ label: "Promo code",
11332
+ value: s().promoCode ?? null
11333
+ }, {
11334
+ label: "Sale",
11335
+ value: s().saleName ?? null
11309
11336
  }, {
11310
11337
  label: "Discount",
11311
- value: discount()
11338
+ value: discountTerms(s())
11312
11339
  }, {
11313
11340
  label: "Gateway id",
11314
11341
  value: s().gatewaySubscriptionId ? (() => {
11315
- var _el$27 = _tmpl$015();
11316
- insert(_el$27, () => s().gatewaySubscriptionId);
11317
- return _el$27;
11342
+ var _el$23 = _tmpl$015();
11343
+ insert(_el$23, () => s().gatewaySubscriptionId);
11344
+ return _el$23;
11318
11345
  })() : null
11319
11346
  }].filter((i) => i.value !== null && i.value !== void 0);
11320
11347
  }
@@ -11324,25 +11351,25 @@ function SubscriptionCard(props) {
11324
11351
  return attempts().length > 0;
11325
11352
  },
11326
11353
  get children() {
11327
- var _el$18 = _tmpl$821(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$20.nextSibling; _el$22.nextSibling;
11328
- _el$19.$$click = () => setShowAttempts((v) => !v);
11329
- insert(_el$19, () => showAttempts() ? "Hide" : "Show", _el$20);
11330
- insert(_el$19, () => attempts().length, _el$22);
11331
- insert(_el$18, createComponent(Show, {
11354
+ var _el$14 = _tmpl$821(), _el$15 = _el$14.firstChild, _el$16 = _el$15.firstChild, _el$18 = _el$16.nextSibling; _el$18.nextSibling;
11355
+ _el$15.$$click = () => setShowAttempts((v) => !v);
11356
+ insert(_el$15, () => showAttempts() ? "Hide" : "Show", _el$16);
11357
+ insert(_el$15, () => attempts().length, _el$18);
11358
+ insert(_el$14, createComponent(Show, {
11332
11359
  get when() {
11333
11360
  return showAttempts();
11334
11361
  },
11335
11362
  get children() {
11336
- var _el$23 = _tmpl$724(), _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
11337
- insert(_el$26, createComponent(For, {
11363
+ var _el$19 = _tmpl$724(), _el$20 = _el$19.firstChild, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling;
11364
+ insert(_el$22, createComponent(For, {
11338
11365
  get each() {
11339
11366
  return attempts();
11340
11367
  },
11341
11368
  children: (a) => (() => {
11342
- var _el$28 = _tmpl$1010(), _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$30.nextSibling, _el$32 = _el$31.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$32.nextSibling, _el$35 = _el$34.nextSibling;
11343
- insert(_el$29, () => fmtDate(a.createdAt));
11344
- insert(_el$30, () => (a.billingPeriod ?? 0) + 1, null);
11345
- insert(_el$30, createComponent(Show, {
11369
+ var _el$24 = _tmpl$1010(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling, _el$27 = _el$26.nextSibling, _el$28 = _el$27.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$28.nextSibling, _el$31 = _el$30.nextSibling;
11370
+ insert(_el$25, () => fmtDate(a.createdAt));
11371
+ insert(_el$26, () => (a.billingPeriod ?? 0) + 1, null);
11372
+ insert(_el$26, createComponent(Show, {
11346
11373
  get when() {
11347
11374
  return (a.attemptNo ?? 1) > 1;
11348
11375
  },
@@ -11350,29 +11377,29 @@ function SubscriptionCard(props) {
11350
11377
  return ` (try ${a.attemptNo})`;
11351
11378
  }
11352
11379
  }), null);
11353
- insert(_el$31, () => centsToUsd(a.amountCents));
11354
- insert(_el$33, () => a.status);
11355
- insert(_el$34, () => a.errorMessage ?? a.errorCode ?? "\u2014");
11356
- insert(_el$35, createComponent(Show, {
11380
+ insert(_el$27, () => centsToUsd(a.amountCents));
11381
+ insert(_el$29, () => a.status);
11382
+ insert(_el$30, () => a.errorMessage ?? a.errorCode ?? "\u2014");
11383
+ insert(_el$31, createComponent(Show, {
11357
11384
  get when() {
11358
11385
  return a.status === "pending" || a.status === "indeterminate";
11359
11386
  },
11360
11387
  get children() {
11361
- var _el$36 = _tmpl$169();
11362
- _el$36.$$click = () => props.onResolveAttempt(s(), a);
11363
- effect(() => _el$36.disabled = props.busy === `resolve-${a.id}`);
11364
- return _el$36;
11388
+ var _el$32 = _tmpl$169();
11389
+ _el$32.$$click = () => props.onResolveAttempt(s(), a);
11390
+ effect(() => _el$32.disabled = props.busy === `resolve-${a.id}`);
11391
+ return _el$32;
11365
11392
  }
11366
11393
  }));
11367
- effect(() => className(_el$33, `app-admin-badge app-admin-badge--${attemptTone(a.status)}`));
11368
- return _el$28;
11394
+ effect(() => className(_el$29, `app-admin-badge app-admin-badge--${attemptTone(a.status)}`));
11395
+ return _el$24;
11369
11396
  })()
11370
11397
  }));
11371
- return _el$23;
11398
+ return _el$19;
11372
11399
  }
11373
11400
  }), null);
11374
- effect(() => setAttribute(_el$19, "aria-expanded", showAttempts()));
11375
- return _el$18;
11401
+ effect(() => setAttribute(_el$15, "aria-expanded", showAttempts()));
11402
+ return _el$14;
11376
11403
  }
11377
11404
  }), null);
11378
11405
  effect(() => setAttribute(_el$, "id", `sub-${s().id}`));
@@ -15054,14 +15081,15 @@ var _tmpl$1312 = /* @__PURE__ */ template(`<div style="display:grid;grid-templat
15054
15081
  var _tmpl$1412 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style="padding:1rem 1.25rem;display:grid;gap:0.625rem">`);
15055
15082
  var _tmpl$1512 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style=padding:1.25rem;display:flex;align-items:flex-end;gap:0.375rem;height:9rem>`);
15056
15083
  var _tmpl$1612 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Track</th><th>Sent</th><th>Recovered</th></tr></thead><tbody><tr><td data-label=Track>Finish signup (completed surveys)</td><td data-label=Sent></td><td data-label=Recovered></td></tr><tr><td data-label=Track>Finish questionnaire (mid-survey)</td><td data-label=Sent></td><td data-label=Recovered></td></tr><tr><td data-label=Track class=app-admin-text-muted>Unsubscribes</td><td data-label=Count colspan=2>`);
15057
- var _tmpl$1712 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:10rem 1fr 7rem;align-items:center;gap:0.75rem"><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)></span><div style=background:var(--app-admin-border-soft);border-radius:4px;height:1.125rem><div style=height:100%;background:var(--app-admin-primary);border-radius:4px></div></div><span style=font-size:0.8125rem;text-align:right><span style=color:var(--app-admin-fg-subtle);margin-left:0.375rem>`);
15058
- var _tmpl$1811 = /* @__PURE__ */ template(`<span style=font-size:0.6875rem;color:var(--app-admin-fg-muted)>`);
15059
- var _tmpl$1911 = /* @__PURE__ */ template(`<div style=flex:1;display:flex;flex-direction:column;align-items:center;gap:0.25rem;height:100%;justify-content:flex-end><div style="width:100%;max-width:1.75rem;border-radius:4px 4px 0 0"></div><span style=font-size:0.625rem;color:var(--app-admin-fg-subtle)>`);
15060
- var _tmpl$2010 = /* @__PURE__ */ template(`<tr><td colspan=4>`);
15061
- var _tmpl$2115 = /* @__PURE__ */ template(`<tr><td data-label="Last seen"class=app-admin-text-muted></td><td data-label=Progress></td><td data-label=Email></td><td data-label=Reminders>`);
15062
- var _tmpl$2212 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>not captured`);
15063
- var _tmpl$2311 = /* @__PURE__ */ template(`<tr><td colspan=5>`);
15064
- var _tmpl$2411 = /* @__PURE__ */ template(`<tr><td data-label=Captured class=app-admin-text-muted></td><td data-label=Name></td><td data-label=Email></td><td data-label=Qualified></td><td data-label=Reminders>`);
15084
+ var _tmpl$1712 = /* @__PURE__ */ template(`<div class=app-admin-funnel-stage style="display:grid;grid-template-columns:10rem 1fr 7rem;align-items:center;gap:0.75rem"><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)></span><div style=background:var(--app-admin-border-soft);border-radius:4px;height:1.125rem><div style=height:100%;background:var(--app-admin-primary);border-radius:4px></div></div><span style=font-size:0.8125rem;text-align:right><span style=color:var(--app-admin-fg-subtle);margin-left:0.375rem>`);
15085
+ var _tmpl$1811 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style="font-size:0.75rem;margin:0.25rem 0 0">Step-by-step tracking saw <!> of <!> completed visits in this window \u2014 the rest finished before telemetry was switched on, or from a browser that never reported.`);
15086
+ var _tmpl$1911 = /* @__PURE__ */ template(`<span style=font-size:0.6875rem;color:var(--app-admin-fg-muted)>`);
15087
+ var _tmpl$2010 = /* @__PURE__ */ template(`<div style=flex:1;display:flex;flex-direction:column;align-items:center;gap:0.25rem;height:100%;justify-content:flex-end><div style="width:100%;max-width:1.75rem;border-radius:4px 4px 0 0"></div><span style=font-size:0.625rem;color:var(--app-admin-fg-subtle)>`);
15088
+ var _tmpl$2115 = /* @__PURE__ */ template(`<tr><td colspan=4>`);
15089
+ var _tmpl$2212 = /* @__PURE__ */ template(`<tr><td data-label="Last seen"class=app-admin-text-muted></td><td data-label=Progress></td><td data-label=Email></td><td data-label=Reminders>`);
15090
+ var _tmpl$2311 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>not captured`);
15091
+ var _tmpl$2411 = /* @__PURE__ */ template(`<tr><td colspan=5>`);
15092
+ var _tmpl$2511 = /* @__PURE__ */ template(`<tr><td data-label=Captured class=app-admin-text-muted></td><td data-label=Name></td><td data-label=Email></td><td data-label=Qualified></td><td data-label=Reminders>`);
15065
15093
  var MODE_HELP = {
15066
15094
  off: "Nothing is sent and nothing is queued.",
15067
15095
  review: 'The schedule decides who is due; nothing leaves until you send it. Due reminders appear under "Waiting for approval" below.',
@@ -15373,18 +15401,39 @@ function Funnel() {
15373
15401
  if (!s) return [];
15374
15402
  return [{
15375
15403
  label: "Surveys started",
15376
- value: s.sessions.started
15404
+ value: s.sessions.started,
15405
+ of: null,
15406
+ group: "tracked"
15377
15407
  }, {
15378
15408
  label: "Surveys completed",
15379
- value: s.captures.total
15409
+ value: s.sessions.completed,
15410
+ of: s.sessions.started,
15411
+ group: "tracked"
15412
+ }, {
15413
+ label: "Visits completed",
15414
+ value: s.captures.total,
15415
+ of: null,
15416
+ group: "visits"
15380
15417
  }, {
15381
15418
  label: "Qualified",
15382
- value: s.captures.qualified
15419
+ value: s.captures.qualified,
15420
+ of: s.captures.total,
15421
+ group: "visits"
15383
15422
  }, {
15384
15423
  label: "Signed up",
15385
- value: s.captures.converted
15424
+ value: s.captures.converted,
15425
+ of: s.captures.leads,
15426
+ group: "visits"
15386
15427
  }];
15387
15428
  };
15429
+ const trackingGap = () => {
15430
+ const s = summary();
15431
+ if (!s) return null;
15432
+ return s.captures.total > s.sessions.completed ? {
15433
+ tracked: s.sessions.completed,
15434
+ total: s.captures.total
15435
+ } : null;
15436
+ };
15388
15437
  const stageMax = () => Math.max(1, ...stages().map((s) => s.value));
15389
15438
  const dropoffMax = () => Math.max(1, ...(summary()?.stepDropoff ?? []).map((b) => b.count));
15390
15439
  const totalRecovered = () => (summary()?.recovery.captureRecovered ?? 0) + (summary()?.recovery.sessionRecovered ?? 0);
@@ -15413,7 +15462,7 @@ function Funnel() {
15413
15462
  insert(_el$51, createComponent(StatCard, {
15414
15463
  label: "Completion Rate",
15415
15464
  get value() {
15416
- return pct(s().captures.total, s().sessions.started);
15465
+ return pct(s().sessions.completed, s().sessions.started);
15417
15466
  }
15418
15467
  }), null);
15419
15468
  insert(_el$51, createComponent(StatCard, {
@@ -15438,7 +15487,8 @@ function Funnel() {
15438
15487
  })(), (() => {
15439
15488
  var _el$52 = _tmpl$1412(), _el$53 = _el$52.firstChild;
15440
15489
  insert(_el$52, createComponent(CardHeader, {
15441
- title: "Funnel stages"
15490
+ title: "Funnel stages",
15491
+ note: "Step tracking covers visits since telemetry was switched on; completed visits are recorded independently, so the two counts are read separately."
15442
15492
  }), _el$53);
15443
15493
  insert(_el$53, createComponent(For, {
15444
15494
  get each() {
@@ -15449,23 +15499,36 @@ function Funnel() {
15449
15499
  insert(_el$72, () => stage.label);
15450
15500
  insert(_el$75, () => stage.value, _el$76);
15451
15501
  insert(_el$76, (() => {
15452
- var _c$ = memo(() => i() > 0);
15453
- return () => _c$() ? pct(stage.value, stages()[i() - 1].value) : "";
15502
+ var _c$ = memo(() => stage.of != null);
15503
+ return () => _c$() ? pct(stage.value, stage.of) : "";
15454
15504
  })());
15455
15505
  effect((_p$) => {
15456
- var _v$4 = `${stage.label}: ${stage.value}`, _v$5 = `${stage.value / stageMax() * 100}%`, _v$6 = stage.value > 0 ? "4px" : "0";
15506
+ var _v$4 = `${stage.label}: ${stage.value}`, _v$5 = stage.group, _v$6 = `${stage.value / stageMax() * 100}%`, _v$7 = stage.value > 0 ? "4px" : "0";
15457
15507
  _v$4 !== _p$.e && setAttribute(_el$71, "title", _p$.e = _v$4);
15458
- _v$5 !== _p$.t && setStyleProperty(_el$74, "width", _p$.t = _v$5);
15459
- _v$6 !== _p$.a && setStyleProperty(_el$74, "min-width", _p$.a = _v$6);
15508
+ _v$5 !== _p$.t && setAttribute(_el$71, "data-group", _p$.t = _v$5);
15509
+ _v$6 !== _p$.a && setStyleProperty(_el$74, "width", _p$.a = _v$6);
15510
+ _v$7 !== _p$.o && setStyleProperty(_el$74, "min-width", _p$.o = _v$7);
15460
15511
  return _p$;
15461
15512
  }, {
15462
15513
  e: void 0,
15463
15514
  t: void 0,
15464
- a: void 0
15515
+ a: void 0,
15516
+ o: void 0
15465
15517
  });
15466
15518
  return _el$71;
15467
15519
  })()
15468
- }));
15520
+ }), null);
15521
+ insert(_el$53, createComponent(Show, {
15522
+ get when() {
15523
+ return trackingGap();
15524
+ },
15525
+ children: (gap) => (() => {
15526
+ var _el$77 = _tmpl$1811(), _el$78 = _el$77.firstChild, _el$81 = _el$78.nextSibling, _el$79 = _el$81.nextSibling, _el$82 = _el$79.nextSibling; _el$82.nextSibling;
15527
+ insert(_el$77, () => gap().tracked, _el$81);
15528
+ insert(_el$77, () => gap().total, _el$82);
15529
+ return _el$77;
15530
+ })()
15531
+ }), null);
15469
15532
  return _el$52;
15470
15533
  })(), (() => {
15471
15534
  var _el$54 = _tmpl$1512(), _el$55 = _el$54.firstChild;
@@ -15480,33 +15543,33 @@ function Funnel() {
15480
15543
  return s().stepDropoff;
15481
15544
  },
15482
15545
  children: (b) => (() => {
15483
- var _el$77 = _tmpl$1911(), _el$79 = _el$77.firstChild, _el$80 = _el$79.nextSibling;
15484
- insert(_el$77, createComponent(Show, {
15546
+ var _el$83 = _tmpl$2010(), _el$85 = _el$83.firstChild, _el$86 = _el$85.nextSibling;
15547
+ insert(_el$83, createComponent(Show, {
15485
15548
  get when() {
15486
15549
  return b.count > 0;
15487
15550
  },
15488
15551
  get children() {
15489
- var _el$78 = _tmpl$1811();
15490
- insert(_el$78, () => b.count);
15491
- return _el$78;
15552
+ var _el$84 = _tmpl$1911();
15553
+ insert(_el$84, () => b.count);
15554
+ return _el$84;
15492
15555
  }
15493
- }), _el$79);
15494
- insert(_el$80, (() => {
15556
+ }), _el$85);
15557
+ insert(_el$86, (() => {
15495
15558
  var _c$2 = memo(() => b.bucket === 0);
15496
15559
  return () => _c$2() ? "Start" : memo(() => b.bucket === 10)() ? "Info" : b.bucket === 5 ? "50%" : "";
15497
15560
  })());
15498
15561
  effect((_p$) => {
15499
- var _v$7 = `${b.bucket * 10}% through: ${b.count} abandon${b.count === 1 ? "" : "s"}`, _v$8 = `${Math.max(b.count > 0 ? 6 : 2, b.count / dropoffMax() * 100)}px`, _v$9 = b.count > 0 ? "var(--app-admin-primary)" : "var(--app-admin-border-soft)";
15500
- _v$7 !== _p$.e && setAttribute(_el$77, "title", _p$.e = _v$7);
15501
- _v$8 !== _p$.t && setStyleProperty(_el$79, "height", _p$.t = _v$8);
15502
- _v$9 !== _p$.a && setStyleProperty(_el$79, "background", _p$.a = _v$9);
15562
+ var _v$8 = `${b.bucket * 10}% through: ${b.count} abandon${b.count === 1 ? "" : "s"}`, _v$9 = `${Math.max(b.count > 0 ? 6 : 2, b.count / dropoffMax() * 100)}px`, _v$0 = b.count > 0 ? "var(--app-admin-primary)" : "var(--app-admin-border-soft)";
15563
+ _v$8 !== _p$.e && setAttribute(_el$83, "title", _p$.e = _v$8);
15564
+ _v$9 !== _p$.t && setStyleProperty(_el$85, "height", _p$.t = _v$9);
15565
+ _v$0 !== _p$.a && setStyleProperty(_el$85, "background", _p$.a = _v$0);
15503
15566
  return _p$;
15504
15567
  }, {
15505
15568
  e: void 0,
15506
15569
  t: void 0,
15507
15570
  a: void 0
15508
15571
  });
15509
- return _el$77;
15572
+ return _el$83;
15510
15573
  })()
15511
15574
  }));
15512
15575
  return _el$54;
@@ -15534,11 +15597,11 @@ function Funnel() {
15534
15597
  },
15535
15598
  get fallback() {
15536
15599
  return (() => {
15537
- var _el$81 = _tmpl$2010(), _el$82 = _el$81.firstChild;
15538
- insert(_el$82, createComponent(EmptyState, {
15600
+ var _el$87 = _tmpl$2115(), _el$88 = _el$87.firstChild;
15601
+ insert(_el$88, createComponent(EmptyState, {
15539
15602
  message: "No abandoned sessions"
15540
15603
  }));
15541
- return _el$81;
15604
+ return _el$87;
15542
15605
  })();
15543
15606
  },
15544
15607
  get children() {
@@ -15547,15 +15610,15 @@ function Funnel() {
15547
15610
  return abandons()?.sessions;
15548
15611
  },
15549
15612
  children: (sess) => (() => {
15550
- var _el$83 = _tmpl$2115(), _el$84 = _el$83.firstChild, _el$85 = _el$84.nextSibling, _el$86 = _el$85.nextSibling, _el$87 = _el$86.nextSibling;
15551
- insert(_el$84, () => formatDate(sess.last_seen_at));
15552
- insert(_el$85, (() => {
15613
+ var _el$89 = _tmpl$2212(), _el$90 = _el$89.firstChild, _el$91 = _el$90.nextSibling, _el$92 = _el$91.nextSibling, _el$93 = _el$92.nextSibling;
15614
+ insert(_el$90, () => formatDate(sess.last_seen_at));
15615
+ insert(_el$91, (() => {
15553
15616
  var _c$3 = memo(() => !!(sess.last_step != null && sess.step_count));
15554
15617
  return () => _c$3() ? `Step ${Math.min(sess.last_step + 1, sess.step_count)} of ${sess.step_count}` : "\u2014";
15555
15618
  })());
15556
- insert(_el$86, () => sess.email ?? _tmpl$2212());
15557
- insert(_el$87, () => sess.reminders_sent);
15558
- return _el$83;
15619
+ insert(_el$92, () => sess.email ?? _tmpl$2311());
15620
+ insert(_el$93, () => sess.reminders_sent);
15621
+ return _el$89;
15559
15622
  })()
15560
15623
  });
15561
15624
  }
@@ -15569,11 +15632,11 @@ function Funnel() {
15569
15632
  },
15570
15633
  get fallback() {
15571
15634
  return (() => {
15572
- var _el$89 = _tmpl$2311(), _el$90 = _el$89.firstChild;
15573
- insert(_el$90, createComponent(EmptyState, {
15635
+ var _el$95 = _tmpl$2411(), _el$96 = _el$95.firstChild;
15636
+ insert(_el$96, createComponent(EmptyState, {
15574
15637
  message: "No unconverted captures"
15575
15638
  }));
15576
- return _el$89;
15639
+ return _el$95;
15577
15640
  })();
15578
15641
  },
15579
15642
  get children() {
@@ -15582,13 +15645,13 @@ function Funnel() {
15582
15645
  return leads()?.captures;
15583
15646
  },
15584
15647
  children: (c) => (() => {
15585
- var _el$91 = _tmpl$2411(), _el$92 = _el$91.firstChild, _el$93 = _el$92.nextSibling, _el$94 = _el$93.nextSibling, _el$95 = _el$94.nextSibling, _el$96 = _el$95.nextSibling;
15586
- insert(_el$92, () => formatDate(c.captured_at));
15587
- insert(_el$93, () => c.patient_name ?? "\u2014");
15588
- insert(_el$94, () => c.email ?? "\u2014");
15589
- insert(_el$95, () => c.qualified ? "Yes" : "No");
15590
- insert(_el$96, () => c.reminders_sent);
15591
- return _el$91;
15648
+ var _el$97 = _tmpl$2511(), _el$98 = _el$97.firstChild, _el$99 = _el$98.nextSibling, _el$100 = _el$99.nextSibling, _el$101 = _el$100.nextSibling, _el$102 = _el$101.nextSibling;
15649
+ insert(_el$98, () => formatDate(c.captured_at));
15650
+ insert(_el$99, () => c.patient_name ?? "\u2014");
15651
+ insert(_el$100, () => c.email ?? "\u2014");
15652
+ insert(_el$101, () => c.qualified ? "Yes" : "No");
15653
+ insert(_el$102, () => c.reminders_sent);
15654
+ return _el$97;
15592
15655
  })()
15593
15656
  });
15594
15657
  }
@@ -17164,7 +17227,7 @@ var _tmpl$2116 = /* @__PURE__ */ template(`<div class=msg-compose__staged>`);
17164
17227
  var _tmpl$2213 = /* @__PURE__ */ template(`<label class=msg-compose__attach title="Attach a file"><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-compose__attach-label>Attach a file</span><input class=msg-compose__file-input type=file data-testid=messages-attach>`);
17165
17228
  var _tmpl$2312 = /* @__PURE__ */ template(`<div class=msg-compose><textarea class=msg-compose__input rows=1 placeholder="Type a message\u2026"aria-label=Message></textarea><button type=button class=msg-compose__send data-testid=messages-send>`);
17166
17229
  var _tmpl$2412 = /* @__PURE__ */ template(`<span class=msg-compose__staged-file data-testid=staged-file><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-attachment__file-size></span><button type=button class=msg-compose__staged-remove aria-label="Remove attachment">\xD7`);
17167
- var _tmpl$2511 = /* @__PURE__ */ template(`<div class=msg-panel data-testid=messages-panel><div class=msg-panel__layout><div></div><div>`);
17230
+ var _tmpl$2512 = /* @__PURE__ */ template(`<div class=msg-panel data-testid=messages-panel><div class=msg-panel__layout><div></div><div>`);
17168
17231
  var _tmpl$2610 = /* @__PURE__ */ template(`<div class=msg-panel__placeholder data-testid=messages-placeholder><p>Select a conversation to read and reply.`);
17169
17232
  function sanitizeMessageHtml(html) {
17170
17233
  return DOMPurify.sanitize(html, {
@@ -17596,7 +17659,7 @@ function MessagesPanel(props) {
17596
17659
  return _el$54;
17597
17660
  })()];
17598
17661
  return (() => {
17599
- var _el$65 = _tmpl$2511(), _el$66 = _el$65.firstChild, _el$67 = _el$66.firstChild, _el$68 = _el$67.nextSibling;
17662
+ var _el$65 = _tmpl$2512(), _el$66 = _el$65.firstChild, _el$67 = _el$66.firstChild, _el$68 = _el$67.nextSibling;
17600
17663
  insert(_el$67, createComponent(ConversationList, {}));
17601
17664
  insert(_el$68, createComponent(Show, {
17602
17665
  get when() {
@@ -19715,5 +19778,5 @@ function primaryButtonStyle2(submitting) {
19715
19778
  }
19716
19779
 
19717
19780
  export { AddressFields, AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod };
19718
- //# sourceMappingURL=7COJH6FZ.js.map
19719
- //# sourceMappingURL=7COJH6FZ.js.map
19781
+ //# sourceMappingURL=KO2JPCIP.js.map
19782
+ //# sourceMappingURL=KO2JPCIP.js.map