@apextelemed/partner-core 0.4.0 → 0.4.1

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.
@@ -10134,239 +10134,25 @@ var AdminNavContext = createContext();
10134
10134
  function useAdminNav() {
10135
10135
  return useContext(AdminNavContext);
10136
10136
  }
10137
- var _tmpl$139 = /* @__PURE__ */ template(`<div class=app-admin-modal-backdrop><div class="app-admin-card app-admin-modal"style=max-width:32rem><div class=app-admin-modal-header><h3 class=app-admin-heading style=font-size:1rem;margin:0>Customer dashboard preview</h3><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div class=app-admin-modal-body><div style="padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);background:var(--app-admin-warning-bg);color:var(--app-admin-warning-fg);font-size:0.75rem;font-weight:500">Viewing as <!> \u2014 read-only`);
10138
- var _tmpl$246 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);font-size:0.75rem;font-weight:500"><span></span><button type=button class="app-admin-btn app-admin-btn-ghost"style="padding:0.25rem 0.75rem">Retry`);
10139
- var _tmpl$333 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>Could not load this customer's dashboard.`);
10140
- var _tmpl$423 = /* @__PURE__ */ template(`<div><h3>Profile</h3><div class=app-admin-card-soft style=padding:0.75rem><p style=font-weight:600;font-size:0.9375rem;margin:0></p><p style="font-size:0.8125rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
10141
- var _tmpl$520 = /* @__PURE__ */ template(`<div><h3>Subscription`);
10142
- var _tmpl$619 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem>`);
10143
- var _tmpl$718 = /* @__PURE__ */ template(`<div><h3>Prescription requests`);
10144
- var _tmpl$818 = /* @__PURE__ */ template(`<div><h3>Pending surveys`);
10145
- var _tmpl$917 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No active subscription.`);
10146
- var _tmpl$015 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">Next charge `);
10147
- var _tmpl$140 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><span style=font-size:0.875rem;font-weight:500>`);
10148
- var _tmpl$1010 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
10149
- var _tmpl$1113 = /* @__PURE__ */ template(`<div><h3>Prescription status</h3><div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><span style=font-size:0.875rem;font-weight:500>Current request`);
10150
- var _tmpl$1210 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No prescription requests.`);
10151
- var _tmpl$1310 = /* @__PURE__ */ template(`<span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>`);
10152
- var _tmpl$149 = /* @__PURE__ */ template(`<span> \xB7 `);
10153
- var _tmpl$159 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><div><span style=font-size:0.875rem;font-weight:500></span></div></div><div style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-top:0.25rem>`);
10154
- var _tmpl$169 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No pending surveys.`);
10155
- var _tmpl$179 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><span style=font-size:0.875rem;font-weight:500></span><span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>Cycle `);
10156
- function PatientDashboardPreview(props) {
10157
- const data = useDashboardData({
10158
- authToken: () => props.token
10159
- });
10160
- return (() => {
10161
- var _el$ = _tmpl$139(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$3.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$0 = _el$8.nextSibling; _el$0.nextSibling;
10162
- _el$.$$click = (e) => {
10163
- if (e.target === e.currentTarget) props.onClose();
10164
- };
10165
- addEventListener(_el$5, "click", props.onClose, true);
10166
- insert(_el$7, () => props.customerName || "customer", _el$0);
10167
- insert(_el$6, createComponent(Show, {
10168
- get when() {
10169
- return data.error();
10170
- },
10171
- keyed: true,
10172
- children: (msg) => (() => {
10173
- var _el$1 = _tmpl$246(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
10174
- insert(_el$10, msg);
10175
- _el$11.$$click = () => data.retry();
10176
- return _el$1;
10177
- })()
10178
- }), null);
10179
- insert(_el$6, createComponent(Show, {
10180
- get when() {
10181
- return !data.profile.loading;
10182
- },
10183
- get fallback() {
10184
- return createComponent(LoadingSpinner, {});
10185
- },
10186
- get children() {
10187
- return createComponent(Show, {
10188
- get when() {
10189
- return data.profile();
10190
- },
10191
- get fallback() {
10192
- return _tmpl$333();
10193
- },
10194
- children: (profile) => [(() => {
10195
- var _el$13 = _tmpl$423(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling;
10196
- insert(_el$16, () => [profile().firstName, profile().lastName].filter(Boolean).join(" ") || "Member");
10197
- insert(_el$17, () => profile().email);
10198
- effect((_$p) => style(_el$14, panelSectionHeader, _$p));
10199
- return _el$13;
10200
- })(), (() => {
10201
- var _el$18 = _tmpl$520(), _el$19 = _el$18.firstChild;
10202
- insert(_el$18, createComponent(Show, {
10203
- get when() {
10204
- return data.subscription();
10205
- },
10206
- get fallback() {
10207
- return _tmpl$917();
10208
- },
10209
- children: (sub) => (() => {
10210
- var _el$27 = _tmpl$140(), _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild;
10211
- insert(_el$29, createComponent(Show, {
10212
- get when() {
10213
- return sub().amount != null;
10214
- },
10215
- fallback: "Subscription",
10216
- get children() {
10217
- return [memo(() => centsToUsd(sub().amount)), "/mo"];
10218
- }
10219
- }));
10220
- insert(_el$28, createComponent(StatusBadge, {
10221
- get status() {
10222
- return sub().status;
10223
- }
10224
- }), null);
10225
- insert(_el$27, createComponent(Show, {
10226
- get when() {
10227
- return sub().nextBillingDate;
10228
- },
10229
- get children() {
10230
- var _el$30 = _tmpl$015(); _el$30.firstChild;
10231
- insert(_el$30, () => fmtDate(sub().nextBillingDate), null);
10232
- return _el$30;
10233
- }
10234
- }), null);
10235
- return _el$27;
10236
- })()
10237
- }), null);
10238
- effect((_$p) => style(_el$19, panelSectionHeader, _$p));
10239
- return _el$18;
10240
- })(), createComponent(Show, {
10241
- get when() {
10242
- return data.rxStatus();
10243
- },
10244
- children: (rx) => (() => {
10245
- var _el$32 = _tmpl$1113(), _el$33 = _el$32.firstChild, _el$34 = _el$33.nextSibling, _el$35 = _el$34.firstChild; _el$35.firstChild;
10246
- insert(_el$35, createComponent(StatusBadge, {
10247
- get status() {
10248
- return rx().status;
10249
- }
10250
- }), null);
10251
- insert(_el$34, createComponent(Show, {
10252
- get when() {
10253
- return rx().reason;
10254
- },
10255
- get children() {
10256
- var _el$37 = _tmpl$1010();
10257
- insert(_el$37, () => rx().reason);
10258
- return _el$37;
10259
- }
10260
- }), null);
10261
- effect((_$p) => style(_el$33, panelSectionHeader, _$p));
10262
- return _el$32;
10263
- })()
10264
- }), (() => {
10265
- var _el$20 = _tmpl$718(), _el$21 = _el$20.firstChild;
10266
- insert(_el$20, createComponent(Show, {
10267
- get when() {
10268
- return (data.rxList() ?? []).length > 0;
10269
- },
10270
- get fallback() {
10271
- return _tmpl$1210();
10272
- },
10273
- get children() {
10274
- var _el$22 = _tmpl$619();
10275
- insert(_el$22, createComponent(For, {
10276
- get each() {
10277
- return data.rxList();
10278
- },
10279
- children: (req) => (() => {
10280
- var _el$39 = _tmpl$159(), _el$40 = _el$39.firstChild, _el$41 = _el$40.firstChild, _el$42 = _el$41.firstChild, _el$44 = _el$40.nextSibling;
10281
- insert(_el$42, () => req.drugName || req.drugId || "Prescription");
10282
- insert(_el$41, createComponent(Show, {
10283
- get when() {
10284
- return req.dosage;
10285
- },
10286
- get children() {
10287
- var _el$43 = _tmpl$1310();
10288
- insert(_el$43, () => req.dosage);
10289
- return _el$43;
10290
- }
10291
- }), null);
10292
- insert(_el$40, createComponent(StatusBadge, {
10293
- get status() {
10294
- return req.status;
10295
- }
10296
- }), null);
10297
- insert(_el$44, createComponent(Show, {
10298
- get when() {
10299
- return req.priceCents != null;
10300
- },
10301
- get children() {
10302
- var _el$45 = _tmpl$149(), _el$46 = _el$45.firstChild;
10303
- insert(_el$45, () => centsToUsd(req.priceCents), _el$46);
10304
- return _el$45;
10305
- }
10306
- }), null);
10307
- insert(_el$44, () => fmtDate(req.createdAt), null);
10308
- return _el$39;
10309
- })()
10310
- }));
10311
- return _el$22;
10312
- }
10313
- }), null);
10314
- effect((_$p) => style(_el$21, panelSectionHeader, _$p));
10315
- return _el$20;
10316
- })(), (() => {
10317
- var _el$23 = _tmpl$818(), _el$24 = _el$23.firstChild;
10318
- insert(_el$23, createComponent(Show, {
10319
- get when() {
10320
- return (data.pendingSurveys() ?? []).length > 0;
10321
- },
10322
- get fallback() {
10323
- return _tmpl$169();
10324
- },
10325
- get children() {
10326
- var _el$25 = _tmpl$619();
10327
- insert(_el$25, createComponent(For, {
10328
- get each() {
10329
- return data.pendingSurveys();
10330
- },
10331
- children: (survey) => (() => {
10332
- var _el$48 = _tmpl$179(), _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling; _el$50.firstChild;
10333
- insert(_el$49, () => survey.drugName || survey.drugId || "Renewal survey");
10334
- insert(_el$50, () => survey.cycleNumber, null);
10335
- return _el$48;
10336
- })()
10337
- }));
10338
- return _el$25;
10339
- }
10340
- }), null);
10341
- effect((_$p) => style(_el$24, panelSectionHeader, _$p));
10342
- return _el$23;
10343
- })()]
10344
- });
10345
- }
10346
- }), null);
10347
- return _el$;
10348
- })();
10349
- }
10350
- delegateEvents(["click"]);
10351
- var _tmpl$141 = /* @__PURE__ */ template(`<span style=text-transform:none>`);
10137
+ var _tmpl$139 = /* @__PURE__ */ template(`<span style=text-transform:none>`);
10352
10138
  function LifecycleBadge(props) {
10353
10139
  const bucket = () => props.lifecycle?.bucket ?? props.bucket ?? null;
10354
10140
  const label = () => props.lifecycle?.label || (bucket() ? LIFECYCLE_LABEL[bucket()] : "Unknown");
10355
10141
  const tone = () => bucket() ? LIFECYCLE_TONE[bucket()] : "neutral";
10356
10142
  return (() => {
10357
- var _el$ = _tmpl$141();
10143
+ var _el$ = _tmpl$139();
10358
10144
  insert(_el$, label);
10359
10145
  effect(() => className(_el$, `app-admin-badge app-admin-badge--${tone()}`));
10360
10146
  return _el$;
10361
10147
  })();
10362
10148
  }
10363
- var _tmpl$150 = /* @__PURE__ */ template(`<input class=app-admin-input type=number inputmode=decimal min=0 step=0.01 autofocus>`);
10364
- var _tmpl$247 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>A recurring discount is still running on this subscription. Saving a new amount replaces it: the customer pays the new amount every period.`);
10365
- var _tmpl$334 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>This subscription is billed by the payment gateway, which holds the price. The change will be refused until it is moved to platform billing.`);
10366
- var _tmpl$424 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>`);
10367
- var _tmpl$521 = /* @__PURE__ */ template(`<form id=edit-amount-form style=display:flex;flex-direction:column;gap:0.75rem><p class=app-admin-text-muted style=margin:0;font-size:0.875rem> currently charges <!> every <!> days. The new amount applies to the next charge and every charge after it.`);
10368
- var _tmpl$620 = /* @__PURE__ */ template(`<button type=submit form=edit-amount-form class="app-admin-btn app-admin-btn-primary">`);
10369
- var _tmpl$719 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10149
+ var _tmpl$140 = /* @__PURE__ */ template(`<input class=app-admin-input type=number inputmode=decimal min=0 step=0.01 autofocus>`);
10150
+ var _tmpl$246 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>A recurring discount is still running on this subscription. Saving a new amount replaces it: the customer pays the new amount every period.`);
10151
+ var _tmpl$333 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>This subscription is billed by the payment gateway, which holds the price. The change will be refused until it is moved to platform billing.`);
10152
+ var _tmpl$423 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>`);
10153
+ var _tmpl$520 = /* @__PURE__ */ template(`<form id=edit-amount-form style=display:flex;flex-direction:column;gap:0.75rem><p class=app-admin-text-muted style=margin:0;font-size:0.875rem> currently charges <!> every <!> days. The new amount applies to the next charge and every charge after it.`);
10154
+ var _tmpl$619 = /* @__PURE__ */ template(`<button type=submit form=edit-amount-form class="app-admin-btn app-admin-btn-primary">`);
10155
+ var _tmpl$718 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10370
10156
  function EditAmountModal(props) {
10371
10157
  const current2 = () => props.subscription.amountCents ?? 0;
10372
10158
  const [dollars, setDollars] = createSignal((current2() / 100).toFixed(2));
@@ -10404,19 +10190,19 @@ function EditAmountModal(props) {
10404
10190
  },
10405
10191
  get footer() {
10406
10192
  return [(() => {
10407
- var _el$11 = _tmpl$620();
10193
+ var _el$11 = _tmpl$619();
10408
10194
  insert(_el$11, () => saving() ? "Saving\u2026" : "Save new amount");
10409
10195
  effect(() => _el$11.disabled = saving() || !valid());
10410
10196
  return _el$11;
10411
10197
  })(), (() => {
10412
- var _el$12 = _tmpl$719();
10198
+ var _el$12 = _tmpl$718();
10413
10199
  addEventListener(_el$12, "click", props.onClose, true);
10414
10200
  effect(() => _el$12.disabled = saving());
10415
10201
  return _el$12;
10416
10202
  })()];
10417
10203
  },
10418
10204
  get children() {
10419
- var _el$ = _tmpl$521(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$7 = _el$3.nextSibling, _el$4 = _el$7.nextSibling, _el$8 = _el$4.nextSibling; _el$8.nextSibling;
10205
+ var _el$ = _tmpl$520(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$7 = _el$3.nextSibling, _el$4 = _el$7.nextSibling, _el$8 = _el$4.nextSibling; _el$8.nextSibling;
10420
10206
  _el$.addEventListener("submit", submit);
10421
10207
  insert(_el$2, () => props.subscription.medication || "Subscription", _el$3);
10422
10208
  insert(_el$2, () => centsToUsd(current2()), _el$7);
@@ -10424,7 +10210,7 @@ function EditAmountModal(props) {
10424
10210
  insert(_el$, createComponent(FormRow, {
10425
10211
  label: "New amount (USD)",
10426
10212
  get children() {
10427
- var _el$9 = _tmpl$150();
10213
+ var _el$9 = _tmpl$140();
10428
10214
  _el$9.$$input = (e) => setDollars(e.currentTarget.value);
10429
10215
  effect(() => _el$9.value = dollars());
10430
10216
  return _el$9;
@@ -10435,7 +10221,7 @@ function EditAmountModal(props) {
10435
10221
  return discountActive();
10436
10222
  },
10437
10223
  get children() {
10438
- return _tmpl$247();
10224
+ return _tmpl$246();
10439
10225
  }
10440
10226
  }), null);
10441
10227
  insert(_el$, createComponent(Show, {
@@ -10443,7 +10229,7 @@ function EditAmountModal(props) {
10443
10229
  return props.subscription.billingMode === "gateway";
10444
10230
  },
10445
10231
  get children() {
10446
- return _tmpl$334();
10232
+ return _tmpl$333();
10447
10233
  }
10448
10234
  }), null);
10449
10235
  insert(_el$, createComponent(Show, {
@@ -10451,7 +10237,7 @@ function EditAmountModal(props) {
10451
10237
  return error();
10452
10238
  },
10453
10239
  get children() {
10454
- var _el$10 = _tmpl$424();
10240
+ var _el$10 = _tmpl$423();
10455
10241
  insert(_el$10, error);
10456
10242
  return _el$10;
10457
10243
  }
@@ -10461,14 +10247,14 @@ function EditAmountModal(props) {
10461
10247
  });
10462
10248
  }
10463
10249
  delegateEvents(["input", "click"]);
10464
- var _tmpl$151 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>This subscription is billed by the payment gateway. The gateway decides when to charge; these dates only change what the admin displays.`);
10465
- var _tmpl$248 = /* @__PURE__ */ template(`<input class=app-admin-input type=datetime-local autofocus>`);
10466
- var _tmpl$335 = /* @__PURE__ */ template(`<input class=app-admin-input type=datetime-local>`);
10467
- var _tmpl$425 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>The period end must be after its start.`);
10468
- var _tmpl$522 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>`);
10469
- var _tmpl$621 = /* @__PURE__ */ template(`<form id=edit-schedule-form style=display:flex;flex-direction:column;gap:0.75rem>`);
10470
- var _tmpl$720 = /* @__PURE__ */ template(`<button type=submit form=edit-schedule-form class="app-admin-btn app-admin-btn-primary">`);
10471
- var _tmpl$819 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10250
+ var _tmpl$141 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>This subscription is billed by the payment gateway. The gateway decides when to charge; these dates only change what the admin displays.`);
10251
+ var _tmpl$247 = /* @__PURE__ */ template(`<input class=app-admin-input type=datetime-local autofocus>`);
10252
+ var _tmpl$334 = /* @__PURE__ */ template(`<input class=app-admin-input type=datetime-local>`);
10253
+ var _tmpl$424 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>The period end must be after its start.`);
10254
+ var _tmpl$521 = /* @__PURE__ */ template(`<p role=alert style=margin:0;font-size:0.875rem;color:var(--app-admin-danger-fg)>`);
10255
+ var _tmpl$620 = /* @__PURE__ */ template(`<form id=edit-schedule-form style=display:flex;flex-direction:column;gap:0.75rem>`);
10256
+ var _tmpl$719 = /* @__PURE__ */ template(`<button type=submit form=edit-schedule-form class="app-admin-btn app-admin-btn-primary">`);
10257
+ var _tmpl$818 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10472
10258
  function EditScheduleModal(props) {
10473
10259
  const [nextCharge, setNextCharge] = createSignal(isoToDatetimeLocal(props.subscription.nextChargeAt));
10474
10260
  const [periodStart, setPeriodStart] = createSignal(isoToDatetimeLocal(props.subscription.currentPeriodStart));
@@ -10514,26 +10300,26 @@ function EditScheduleModal(props) {
10514
10300
  },
10515
10301
  get footer() {
10516
10302
  return [(() => {
10517
- var _el$8 = _tmpl$720();
10303
+ var _el$8 = _tmpl$719();
10518
10304
  insert(_el$8, () => saving() ? "Saving\u2026" : "Save schedule");
10519
10305
  effect(() => _el$8.disabled = saving() || !dirty() || windowInverted());
10520
10306
  return _el$8;
10521
10307
  })(), (() => {
10522
- var _el$9 = _tmpl$819();
10308
+ var _el$9 = _tmpl$818();
10523
10309
  addEventListener(_el$9, "click", props.onClose, true);
10524
10310
  effect(() => _el$9.disabled = saving());
10525
10311
  return _el$9;
10526
10312
  })()];
10527
10313
  },
10528
10314
  get children() {
10529
- var _el$ = _tmpl$621();
10315
+ var _el$ = _tmpl$620();
10530
10316
  _el$.addEventListener("submit", submit);
10531
10317
  insert(_el$, createComponent(Show, {
10532
10318
  get when() {
10533
10319
  return props.subscription.billingMode === "gateway";
10534
10320
  },
10535
10321
  get children() {
10536
- return _tmpl$151();
10322
+ return _tmpl$141();
10537
10323
  }
10538
10324
  }), null);
10539
10325
  insert(_el$, createComponent(FormRow, {
@@ -10542,7 +10328,7 @@ function EditScheduleModal(props) {
10542
10328
  return memo(() => !!props.subscription.nextChargeAt)() ? `Currently ${fmtDate(props.subscription.nextChargeAt)}. Moving it later gives the customer more time; moving it earlier charges sooner.` : "No next charge is scheduled. Setting one restarts billing on that date.";
10543
10329
  },
10544
10330
  get children() {
10545
- var _el$3 = _tmpl$248();
10331
+ var _el$3 = _tmpl$247();
10546
10332
  _el$3.$$input = (e) => setNextCharge(e.currentTarget.value);
10547
10333
  effect(() => _el$3.value = nextCharge());
10548
10334
  return _el$3;
@@ -10551,7 +10337,7 @@ function EditScheduleModal(props) {
10551
10337
  insert(_el$, createComponent(FormRow, {
10552
10338
  label: "Current period start",
10553
10339
  get children() {
10554
- var _el$4 = _tmpl$335();
10340
+ var _el$4 = _tmpl$334();
10555
10341
  _el$4.$$input = (e) => setPeriodStart(e.currentTarget.value);
10556
10342
  effect(() => _el$4.value = periodStart());
10557
10343
  return _el$4;
@@ -10561,7 +10347,7 @@ function EditScheduleModal(props) {
10561
10347
  label: "Current period end",
10562
10348
  hint: "Shown to the customer as the end of their paid period.",
10563
10349
  get children() {
10564
- var _el$5 = _tmpl$335();
10350
+ var _el$5 = _tmpl$334();
10565
10351
  _el$5.$$input = (e) => setPeriodEnd(e.currentTarget.value);
10566
10352
  effect(() => _el$5.value = periodEnd());
10567
10353
  return _el$5;
@@ -10572,7 +10358,7 @@ function EditScheduleModal(props) {
10572
10358
  return windowInverted();
10573
10359
  },
10574
10360
  get children() {
10575
- return _tmpl$425();
10361
+ return _tmpl$424();
10576
10362
  }
10577
10363
  }), null);
10578
10364
  insert(_el$, createComponent(Show, {
@@ -10580,7 +10366,7 @@ function EditScheduleModal(props) {
10580
10366
  return error();
10581
10367
  },
10582
10368
  get children() {
10583
- var _el$7 = _tmpl$522();
10369
+ var _el$7 = _tmpl$521();
10584
10370
  insert(_el$7, error);
10585
10371
  return _el$7;
10586
10372
  }
@@ -10590,15 +10376,15 @@ function EditScheduleModal(props) {
10590
10376
  });
10591
10377
  }
10592
10378
  delegateEvents(["input", "click"]);
10593
- var _tmpl$160 = /* @__PURE__ */ template(`<input class=app-admin-input type=number inputmode=decimal min=0.01 step=0.01 autofocus>`);
10594
- var _tmpl$249 = /* @__PURE__ */ template(`<input class=app-admin-input type=text placeholder="e.g. duplicate charge">`);
10595
- var _tmpl$336 = /* @__PURE__ */ template(`<div class="app-admin-alert app-admin-alert--warning"style=flex-direction:column;gap:0.5rem><p class=app-admin-alert__title>This customer still has <!>. A refund does not stop billing.</p><ul style=margin:0;padding-left:1.25rem;font-size:0.8125rem;color:var(--app-admin-fg-muted)></ul><label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem><input type=checkbox>Also cancel <!> so they are not billed again`);
10596
- var _tmpl$426 = /* @__PURE__ */ template(`<form id=refund-form style=display:flex;flex-direction:column;gap:0.75rem><p class=app-admin-text-muted style=margin:0;font-size:0.875rem> paid<!>.`);
10597
- var _tmpl$523 = /* @__PURE__ */ template(`<button type=submit form=refund-form class="app-admin-btn app-admin-btn-primary">`);
10598
- var _tmpl$622 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10599
- var _tmpl$721 = /* @__PURE__ */ template(`<li> \u2014 `);
10600
- var _tmpl$820 = /* @__PURE__ */ template(`<div><p class=app-admin-alert__detail style=margin-bottom:0.5rem>The gateway has not settled this charge yet, so it can only be reversed in full right now. Partial refunds work once it settles, usually the next business day.</p><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Refund the full <!> instead`);
10601
- var _tmpl$918 = /* @__PURE__ */ template(`<div class="app-admin-alert app-admin-alert--danger"role=alert style=flex-direction:column;gap:0.5rem><p class=app-admin-alert__title>`);
10379
+ var _tmpl$149 = /* @__PURE__ */ template(`<input class=app-admin-input type=number inputmode=decimal min=0.01 step=0.01 autofocus>`);
10380
+ var _tmpl$248 = /* @__PURE__ */ template(`<input class=app-admin-input type=text placeholder="e.g. duplicate charge">`);
10381
+ var _tmpl$335 = /* @__PURE__ */ template(`<div class="app-admin-alert app-admin-alert--warning"style=flex-direction:column;gap:0.5rem><p class=app-admin-alert__title>This customer still has <!>. A refund does not stop billing.</p><ul style=margin:0;padding-left:1.25rem;font-size:0.8125rem;color:var(--app-admin-fg-muted)></ul><label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem><input type=checkbox>Also cancel <!> so they are not billed again`);
10382
+ var _tmpl$425 = /* @__PURE__ */ template(`<form id=refund-form style=display:flex;flex-direction:column;gap:0.75rem><p class=app-admin-text-muted style=margin:0;font-size:0.875rem> paid<!>.`);
10383
+ var _tmpl$522 = /* @__PURE__ */ template(`<button type=submit form=refund-form class="app-admin-btn app-admin-btn-primary">`);
10384
+ var _tmpl$621 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">Cancel`);
10385
+ var _tmpl$720 = /* @__PURE__ */ template(`<li> \u2014 `);
10386
+ var _tmpl$819 = /* @__PURE__ */ template(`<div><p class=app-admin-alert__detail style=margin-bottom:0.5rem>The gateway has not settled this charge yet, so it can only be reversed in full right now. Partial refunds work once it settles, usually the next business day.</p><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Refund the full <!> instead`);
10387
+ var _tmpl$917 = /* @__PURE__ */ template(`<div class="app-admin-alert app-admin-alert--danger"role=alert style=flex-direction:column;gap:0.5rem><p class=app-admin-alert__title>`);
10602
10388
  function RefundModal(props) {
10603
10389
  const remaining = () => Math.max(0, props.payment.amountCents - (props.payment.refundedAmountCents ?? 0));
10604
10390
  const [dollars, setDollars] = createSignal((remaining() / 100).toFixed(2));
@@ -10654,7 +10440,7 @@ function RefundModal(props) {
10654
10440
  },
10655
10441
  get footer() {
10656
10442
  return [(() => {
10657
- var _el$17 = _tmpl$523();
10443
+ var _el$17 = _tmpl$522();
10658
10444
  insert(_el$17, (() => {
10659
10445
  var _c$4 = memo(() => !!busy());
10660
10446
  return () => _c$4() ? "Refunding\u2026" : memo(() => !!isFull())() ? `Refund ${centsToUsd(remaining())}` : `Refund ${centsToUsd(cents() ?? 0)} of ${centsToUsd(remaining())}`;
@@ -10662,14 +10448,14 @@ function RefundModal(props) {
10662
10448
  effect(() => _el$17.disabled = busy() || !valid());
10663
10449
  return _el$17;
10664
10450
  })(), (() => {
10665
- var _el$18 = _tmpl$622();
10451
+ var _el$18 = _tmpl$621();
10666
10452
  addEventListener(_el$18, "click", props.onClose, true);
10667
10453
  effect(() => _el$18.disabled = busy());
10668
10454
  return _el$18;
10669
10455
  })()];
10670
10456
  },
10671
10457
  get children() {
10672
- var _el$ = _tmpl$426(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$5 = _el$3.nextSibling; _el$5.nextSibling;
10458
+ var _el$ = _tmpl$425(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$5 = _el$3.nextSibling; _el$5.nextSibling;
10673
10459
  _el$.addEventListener("submit", submit);
10674
10460
  insert(_el$2, () => centsToUsd(props.payment.amountCents), _el$3);
10675
10461
  insert(_el$2, (() => {
@@ -10694,7 +10480,7 @@ function RefundModal(props) {
10694
10480
  return `Up to ${centsToUsd(remaining())}.`;
10695
10481
  },
10696
10482
  get children() {
10697
- var _el$6 = _tmpl$160();
10483
+ var _el$6 = _tmpl$149();
10698
10484
  _el$6.$$input = (e) => setDollars(e.currentTarget.value);
10699
10485
  effect(() => setAttribute(_el$6, "max", (remaining() / 100).toFixed(2)));
10700
10486
  effect(() => _el$6.value = dollars());
@@ -10705,7 +10491,7 @@ function RefundModal(props) {
10705
10491
  label: "Reason (optional)",
10706
10492
  hint: "Kept on the payment record; not shown to the customer.",
10707
10493
  get children() {
10708
- var _el$7 = _tmpl$249();
10494
+ var _el$7 = _tmpl$248();
10709
10495
  _el$7.$$input = (e) => setReason(e.currentTarget.value);
10710
10496
  effect(() => _el$7.value = reason());
10711
10497
  return _el$7;
@@ -10716,7 +10502,7 @@ function RefundModal(props) {
10716
10502
  return props.liveSubscriptions.length > 0;
10717
10503
  },
10718
10504
  get children() {
10719
- var _el$8 = _tmpl$336(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$10 = _el$0.nextSibling; _el$10.nextSibling; var _el$11 = _el$9.nextSibling, _el$12 = _el$11.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling; _el$16.nextSibling;
10505
+ var _el$8 = _tmpl$335(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$10 = _el$0.nextSibling; _el$10.nextSibling; var _el$11 = _el$9.nextSibling, _el$12 = _el$11.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling; _el$16.nextSibling;
10720
10506
  insert(_el$9, (() => {
10721
10507
  var _c$3 = memo(() => props.liveSubscriptions.length === 1);
10722
10508
  return () => _c$3() ? "a live subscription" : `${props.liveSubscriptions.length} live subscriptions`;
@@ -10726,7 +10512,7 @@ function RefundModal(props) {
10726
10512
  return props.liveSubscriptions;
10727
10513
  },
10728
10514
  children: (s) => (() => {
10729
- var _el$19 = _tmpl$721(), _el$20 = _el$19.firstChild;
10515
+ var _el$19 = _tmpl$720(), _el$20 = _el$19.firstChild;
10730
10516
  insert(_el$19, () => s.medication || "Subscription", _el$20);
10731
10517
  insert(_el$19, () => centsToUsd(s.amountCents), null);
10732
10518
  insert(_el$19, (() => {
@@ -10751,14 +10537,14 @@ function RefundModal(props) {
10751
10537
  return error();
10752
10538
  },
10753
10539
  children: (err) => (() => {
10754
- var _el$21 = _tmpl$918(), _el$22 = _el$21.firstChild;
10540
+ var _el$21 = _tmpl$917(), _el$22 = _el$21.firstChild;
10755
10541
  insert(_el$22, () => err().message);
10756
10542
  insert(_el$21, createComponent(Show, {
10757
10543
  get when() {
10758
10544
  return memo(() => err().code === "unsettled_requires_void")() && !isFull();
10759
10545
  },
10760
10546
  get children() {
10761
- var _el$23 = _tmpl$820(), _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$25.firstChild, _el$28 = _el$26.nextSibling; _el$28.nextSibling;
10547
+ var _el$23 = _tmpl$819(), _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$25.firstChild, _el$28 = _el$26.nextSibling; _el$28.nextSibling;
10762
10548
  _el$25.$$click = () => run({
10763
10549
  amountCents: void 0,
10764
10550
  reason: reason().trim() || void 0,
@@ -10777,18 +10563,18 @@ function RefundModal(props) {
10777
10563
  });
10778
10564
  }
10779
10565
  delegateEvents(["input", "click"]);
10780
- var _tmpl$161 = /* @__PURE__ */ template(`<ul style=margin:0;padding-left:1.1rem;font-size:0.8125rem>`);
10781
- var _tmpl$250 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
10782
- var _tmpl$337 = /* @__PURE__ */ template(`<li>Completed <!> \xB7 `);
10783
- var _tmpl$427 = /* @__PURE__ */ template(`<li>Started `);
10784
- var _tmpl$524 = /* @__PURE__ */ template(`<li> item<!> \xB7 `);
10785
- var _tmpl$623 = /* @__PURE__ */ template(`<div><div style=font-size:0.75rem;font-weight:600;color:var(--app-admin-fg-muted);margin-bottom:0.25rem>`);
10786
- var _tmpl$722 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>`);
10566
+ var _tmpl$150 = /* @__PURE__ */ template(`<ul style=margin:0;padding-left:1.1rem;font-size:0.8125rem>`);
10567
+ var _tmpl$249 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
10568
+ var _tmpl$336 = /* @__PURE__ */ template(`<li>Completed <!> \xB7 `);
10569
+ var _tmpl$426 = /* @__PURE__ */ template(`<li>Started `);
10570
+ var _tmpl$523 = /* @__PURE__ */ template(`<li> item<!> \xB7 `);
10571
+ var _tmpl$622 = /* @__PURE__ */ template(`<div><div style=font-size:0.75rem;font-weight:600;color:var(--app-admin-fg-muted);margin-bottom:0.25rem>`);
10572
+ var _tmpl$721 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>`);
10787
10573
  function FunnelActivity(props) {
10788
10574
  const f = () => props.funnel;
10789
10575
  const nothing = () => f().captures.length === 0 && f().sessions.length === 0 && f().carts.length === 0;
10790
10576
  return (() => {
10791
- var _el$ = _tmpl$250();
10577
+ var _el$ = _tmpl$249();
10792
10578
  insert(_el$, createComponent(Block, {
10793
10579
  title: "Intake survey",
10794
10580
  get children() {
@@ -10802,13 +10588,13 @@ function FunnelActivity(props) {
10802
10588
  });
10803
10589
  },
10804
10590
  get children() {
10805
- var _el$2 = _tmpl$161();
10591
+ var _el$2 = _tmpl$150();
10806
10592
  insert(_el$2, createComponent(For, {
10807
10593
  get each() {
10808
10594
  return f().captures;
10809
10595
  },
10810
10596
  children: (c) => (() => {
10811
- var _el$5 = _tmpl$337(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling; _el$8.nextSibling;
10597
+ var _el$5 = _tmpl$336(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling; _el$8.nextSibling;
10812
10598
  insert(_el$5, () => fmtDate(c.capturedAt), _el$8);
10813
10599
  insert(_el$5, () => c.qualified ? "qualified" : "did not qualify", null);
10814
10600
  insert(_el$5, createComponent(Show, {
@@ -10858,13 +10644,13 @@ function FunnelActivity(props) {
10858
10644
  });
10859
10645
  },
10860
10646
  get children() {
10861
- var _el$3 = _tmpl$161();
10647
+ var _el$3 = _tmpl$150();
10862
10648
  insert(_el$3, createComponent(For, {
10863
10649
  get each() {
10864
10650
  return f().sessions;
10865
10651
  },
10866
10652
  children: (s) => (() => {
10867
- var _el$9 = _tmpl$427(); _el$9.firstChild;
10653
+ var _el$9 = _tmpl$426(); _el$9.firstChild;
10868
10654
  insert(_el$9, () => fmtDate(s.startedAt), null);
10869
10655
  insert(_el$9, createComponent(Show, {
10870
10656
  get when() {
@@ -10931,13 +10717,13 @@ function FunnelActivity(props) {
10931
10717
  });
10932
10718
  },
10933
10719
  get children() {
10934
- var _el$4 = _tmpl$161();
10720
+ var _el$4 = _tmpl$150();
10935
10721
  insert(_el$4, createComponent(For, {
10936
10722
  get each() {
10937
10723
  return f().carts;
10938
10724
  },
10939
10725
  children: (c) => (() => {
10940
- var _el$1 = _tmpl$524(), _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling; _el$12.nextSibling;
10726
+ var _el$1 = _tmpl$523(), _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling; _el$12.nextSibling;
10941
10727
  insert(_el$1, () => c.itemCount, _el$10);
10942
10728
  insert(_el$1, () => c.itemCount === 1 ? "" : "s", _el$12);
10943
10729
  insert(_el$1, () => centsToUsd(c.subtotalCents), null);
@@ -10974,7 +10760,7 @@ function FunnelActivity(props) {
10974
10760
  }
10975
10761
  function Block(props) {
10976
10762
  return (() => {
10977
- var _el$13 = _tmpl$623(), _el$14 = _el$13.firstChild;
10763
+ var _el$13 = _tmpl$622(), _el$14 = _el$13.firstChild;
10978
10764
  insert(_el$14, () => props.title);
10979
10765
  insert(_el$13, () => props.children, null);
10980
10766
  return _el$13;
@@ -10982,18 +10768,18 @@ function Block(props) {
10982
10768
  }
10983
10769
  function Muted(props) {
10984
10770
  return (() => {
10985
- var _el$15 = _tmpl$722();
10771
+ var _el$15 = _tmpl$721();
10986
10772
  insert(_el$15, () => props.children);
10987
10773
  return _el$15;
10988
10774
  })();
10989
10775
  }
10990
- var _tmpl$170 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Amount</th><th>Status</th><th>Type</th><th>Detail</th><th style=width:6rem>Actions</th></tr></thead><tbody>`);
10991
- var _tmpl$251 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem> refunded`);
10992
- var _tmpl$338 = /* @__PURE__ */ template(`<div>`);
10993
- var _tmpl$428 = /* @__PURE__ */ template(`<div class=app-admin-text-mono style=font-size:0.75rem>`);
10994
- var _tmpl$525 = /* @__PURE__ */ template(`<div>Refunded `);
10995
- var _tmpl$624 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">`);
10996
- var _tmpl$723 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Amount></td><td data-label=Status></td><td data-label=Type class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Detail class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Actions>`);
10776
+ var _tmpl$151 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Amount</th><th>Status</th><th>Type</th><th>Detail</th><th style=width:6rem>Actions</th></tr></thead><tbody>`);
10777
+ var _tmpl$250 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem> refunded`);
10778
+ var _tmpl$337 = /* @__PURE__ */ template(`<div>`);
10779
+ var _tmpl$427 = /* @__PURE__ */ template(`<div class=app-admin-text-mono style=font-size:0.75rem>`);
10780
+ var _tmpl$524 = /* @__PURE__ */ template(`<div>Refunded `);
10781
+ var _tmpl$623 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">`);
10782
+ var _tmpl$722 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Amount></td><td data-label=Status></td><td data-label=Type class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Detail class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Actions>`);
10997
10783
  function typeWord(p) {
10998
10784
  if (p.detached) return "checkout (declined)";
10999
10785
  if (!p.type) return p.orderId ? "order" : p.subscriptionId ? "subscription" : "\u2014";
@@ -11012,13 +10798,13 @@ function PaymentsTable(props) {
11012
10798
  });
11013
10799
  },
11014
10800
  get children() {
11015
- var _el$ = _tmpl$170(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling; _el$9.nextSibling; var _el$1 = _el$3.nextSibling;
10801
+ var _el$ = _tmpl$151(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling; _el$9.nextSibling; var _el$1 = _el$3.nextSibling;
11016
10802
  insert(_el$1, createComponent(For, {
11017
10803
  get each() {
11018
10804
  return sorted();
11019
10805
  },
11020
10806
  children: (p) => (() => {
11021
- var _el$10 = _tmpl$723(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$15 = _el$12.nextSibling, _el$16 = _el$15.nextSibling, _el$17 = _el$16.nextSibling, _el$22 = _el$17.nextSibling;
10807
+ var _el$10 = _tmpl$722(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$15 = _el$12.nextSibling, _el$16 = _el$15.nextSibling, _el$17 = _el$16.nextSibling, _el$22 = _el$17.nextSibling;
11022
10808
  insert(_el$11, () => fmtDate(p.createdAt));
11023
10809
  insert(_el$12, () => centsToUsd(p.amountCents), null);
11024
10810
  insert(_el$12, createComponent(Show, {
@@ -11026,7 +10812,7 @@ function PaymentsTable(props) {
11026
10812
  return memo(() => (p.refundedAmountCents ?? 0) > 0)() && p.status !== "refunded";
11027
10813
  },
11028
10814
  get children() {
11029
- var _el$13 = _tmpl$251(), _el$14 = _el$13.firstChild;
10815
+ var _el$13 = _tmpl$250(), _el$14 = _el$13.firstChild;
11030
10816
  insert(_el$13, () => centsToUsd(p.refundedAmountCents), _el$14);
11031
10817
  return _el$13;
11032
10818
  }
@@ -11042,7 +10828,7 @@ function PaymentsTable(props) {
11042
10828
  return p.failureReason;
11043
10829
  },
11044
10830
  get children() {
11045
- var _el$18 = _tmpl$338();
10831
+ var _el$18 = _tmpl$337();
11046
10832
  insert(_el$18, () => p.failureReason);
11047
10833
  return _el$18;
11048
10834
  }
@@ -11052,7 +10838,7 @@ function PaymentsTable(props) {
11052
10838
  return p.transactionId;
11053
10839
  },
11054
10840
  get children() {
11055
- var _el$19 = _tmpl$428();
10841
+ var _el$19 = _tmpl$427();
11056
10842
  insert(_el$19, () => p.transactionId);
11057
10843
  return _el$19;
11058
10844
  }
@@ -11062,7 +10848,7 @@ function PaymentsTable(props) {
11062
10848
  return memo(() => !!p.refundedAt)() && p.status === "refunded";
11063
10849
  },
11064
10850
  get children() {
11065
- var _el$20 = _tmpl$525(); _el$20.firstChild;
10851
+ var _el$20 = _tmpl$524(); _el$20.firstChild;
11066
10852
  insert(_el$20, () => fmtDate(p.refundedAt), null);
11067
10853
  return _el$20;
11068
10854
  }
@@ -11072,7 +10858,7 @@ function PaymentsTable(props) {
11072
10858
  return refundable(p);
11073
10859
  },
11074
10860
  get children() {
11075
- var _el$23 = _tmpl$624();
10861
+ var _el$23 = _tmpl$623();
11076
10862
  _el$23.$$click = () => props.onRefund(p);
11077
10863
  insert(_el$23, (() => {
11078
10864
  var _c$ = memo(() => props.busyId === p.id);
@@ -11091,12 +10877,12 @@ function PaymentsTable(props) {
11091
10877
  });
11092
10878
  }
11093
10879
  delegateEvents(["click"]);
11094
- var _tmpl$171 = /* @__PURE__ */ template(`<input class=app-admin-input>`);
11095
- var _tmpl$256 = /* @__PURE__ */ template(`<form style="display:grid;grid-template-columns:1fr 1fr;gap:0.5rem"><div style="grid-column:1 / -1;display:flex;gap:0.5rem"><button type=submit class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"></button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Cancel`);
11096
- var _tmpl$339 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
11097
- var _tmpl$429 = /* @__PURE__ */ template(`<div style=display:flex;align-items:center;justify-content:space-between;gap:0.5rem><span style=font-size:0.875rem></span><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Edit name`);
11098
- var _tmpl$526 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>No name on file`);
11099
- var _tmpl$625 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
10880
+ var _tmpl$159 = /* @__PURE__ */ template(`<input class=app-admin-input>`);
10881
+ var _tmpl$251 = /* @__PURE__ */ template(`<form style="display:grid;grid-template-columns:1fr 1fr;gap:0.5rem"><div style="grid-column:1 / -1;display:flex;gap:0.5rem"><button type=submit class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"></button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Cancel`);
10882
+ var _tmpl$338 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
10883
+ var _tmpl$428 = /* @__PURE__ */ template(`<div style=display:flex;align-items:center;justify-content:space-between;gap:0.5rem><span style=font-size:0.875rem></span><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Edit name`);
10884
+ var _tmpl$525 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>No name on file`);
10885
+ var _tmpl$624 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11100
10886
  function ProfileCard(props) {
11101
10887
  const c = () => props.customer;
11102
10888
  const [editing, setEditing] = createSignal(false);
@@ -11129,26 +10915,26 @@ function ProfileCard(props) {
11129
10915
  return lines.length ? lines.join(" \xB7 ") : null;
11130
10916
  };
11131
10917
  return (() => {
11132
- var _el$ = _tmpl$339();
10918
+ var _el$ = _tmpl$338();
11133
10919
  insert(_el$, createComponent(Show, {
11134
10920
  get when() {
11135
10921
  return editing();
11136
10922
  },
11137
10923
  get fallback() {
11138
10924
  return (() => {
11139
- var _el$8 = _tmpl$429(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
11140
- insert(_el$9, () => [c().firstName, c().lastName].filter(Boolean).join(" ") || _tmpl$526());
10925
+ var _el$8 = _tmpl$428(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
10926
+ insert(_el$9, () => [c().firstName, c().lastName].filter(Boolean).join(" ") || _tmpl$525());
11141
10927
  _el$0.$$click = start;
11142
10928
  return _el$8;
11143
10929
  })();
11144
10930
  },
11145
10931
  get children() {
11146
- var _el$2 = _tmpl$256(), _el$5 = _el$2.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
10932
+ var _el$2 = _tmpl$251(), _el$5 = _el$2.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
11147
10933
  _el$2.addEventListener("submit", save);
11148
10934
  insert(_el$2, createComponent(FormRow, {
11149
10935
  label: "First name",
11150
10936
  get children() {
11151
- var _el$3 = _tmpl$171();
10937
+ var _el$3 = _tmpl$159();
11152
10938
  _el$3.$$input = (e) => setFirst(e.currentTarget.value);
11153
10939
  effect(() => _el$3.disabled = saving());
11154
10940
  effect(() => _el$3.value = first());
@@ -11158,7 +10944,7 @@ function ProfileCard(props) {
11158
10944
  insert(_el$2, createComponent(FormRow, {
11159
10945
  label: "Last name",
11160
10946
  get children() {
11161
- var _el$4 = _tmpl$171();
10947
+ var _el$4 = _tmpl$159();
11162
10948
  _el$4.$$input = (e) => setLast(e.currentTarget.value);
11163
10949
  effect(() => _el$4.disabled = saving());
11164
10950
  effect(() => _el$4.value = last());
@@ -11199,21 +10985,21 @@ function ProfileCard(props) {
11199
10985
  }, {
11200
10986
  label: "Savings member",
11201
10987
  value: c().savingsMemberId ? (() => {
11202
- var _el$10 = _tmpl$625();
10988
+ var _el$10 = _tmpl$624();
11203
10989
  insert(_el$10, () => c().savingsMemberId);
11204
10990
  return _el$10;
11205
10991
  })() : null
11206
10992
  }, {
11207
10993
  label: "Apex member",
11208
10994
  value: c().apexMemberId ? (() => {
11209
- var _el$11 = _tmpl$625();
10995
+ var _el$11 = _tmpl$624();
11210
10996
  insert(_el$11, () => c().apexMemberId);
11211
10997
  return _el$11;
11212
10998
  })() : null
11213
10999
  }, {
11214
11000
  label: "Customer id",
11215
11001
  value: (() => {
11216
- var _el$12 = _tmpl$625();
11002
+ var _el$12 = _tmpl$624();
11217
11003
  insert(_el$12, () => c().uid);
11218
11004
  return _el$12;
11219
11005
  })()
@@ -11224,14 +11010,14 @@ function ProfileCard(props) {
11224
11010
  })();
11225
11011
  }
11226
11012
  delegateEvents(["input", "click"]);
11227
- var _tmpl$180 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11228
- var _tmpl$257 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"title="Apex could not be reached; showing the last status we stored.">cached`);
11229
- var _tmpl$340 = /* @__PURE__ */ template(`<article class=app-admin-card-soft style="padding:1rem 1.25rem"><div style="display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0.5rem 0.75rem"><div style=display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;min-width:0><span style=font-weight:600></span></div><span class=app-admin-text-muted style=font-size:0.8125rem> \xB7 submitted </span></div><div style=margin-top:1rem></div><div style=margin-top:0.875rem>`);
11230
- var _tmpl$430 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"class=app-admin-text-mono style=color:var(--app-admin-primary-soft-fg)>`);
11231
- var _tmpl$527 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>`);
11232
- var _tmpl$626 = /* @__PURE__ */ template(`<span>`);
11233
- var _tmpl$724 = /* @__PURE__ */ template(`<span class=app-admin-text-mono>`);
11234
- var _tmpl$821 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11013
+ var _tmpl$160 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11014
+ var _tmpl$256 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--neutral"title="Apex could not be reached; showing the last status we stored.">cached`);
11015
+ var _tmpl$339 = /* @__PURE__ */ template(`<article class=app-admin-card-soft style="padding:1rem 1.25rem"><div style="display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0.5rem 0.75rem"><div style=display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;min-width:0><span style=font-weight:600></span></div><span class=app-admin-text-muted style=font-size:0.8125rem> \xB7 submitted </span></div><div style=margin-top:1rem></div><div style=margin-top:0.875rem>`);
11016
+ var _tmpl$429 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer"class=app-admin-text-mono style=color:var(--app-admin-primary-soft-fg)>`);
11017
+ var _tmpl$526 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>`);
11018
+ var _tmpl$625 = /* @__PURE__ */ template(`<span>`);
11019
+ var _tmpl$723 = /* @__PURE__ */ template(`<span class=app-admin-text-mono>`);
11020
+ var _tmpl$820 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11235
11021
  var STAGE_TO_STEP = {
11236
11022
  done: "done",
11237
11023
  active: "active",
@@ -11273,14 +11059,14 @@ function RequestCard(props) {
11273
11059
  };
11274
11060
  const deliveryStatus = () => r().tracking?.deliveryStatus ?? r().delivery?.status ?? null;
11275
11061
  return (() => {
11276
- var _el$ = _tmpl$340(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$2.nextSibling, _el$0 = _el$9.nextSibling;
11062
+ var _el$ = _tmpl$339(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$2.nextSibling, _el$0 = _el$9.nextSibling;
11277
11063
  insert(_el$4, () => r().drugName || "Prescription request");
11278
11064
  insert(_el$3, createComponent(Show, {
11279
11065
  get when() {
11280
11066
  return r().dosage;
11281
11067
  },
11282
11068
  get children() {
11283
- var _el$5 = _tmpl$180();
11069
+ var _el$5 = _tmpl$160();
11284
11070
  insert(_el$5, () => r().dosage);
11285
11071
  return _el$5;
11286
11072
  }
@@ -11295,7 +11081,7 @@ function RequestCard(props) {
11295
11081
  return !r().live;
11296
11082
  },
11297
11083
  get children() {
11298
- return _tmpl$257();
11084
+ return _tmpl$256();
11299
11085
  }
11300
11086
  }), null);
11301
11087
  insert(_el$7, () => STATUS_WORD[r().status] ?? r().status.replace(/_/g, " "), _el$8);
@@ -11313,7 +11099,7 @@ function RequestCard(props) {
11313
11099
  return [{
11314
11100
  label: "Tracking",
11315
11101
  value: tracking() ? (() => {
11316
- var _el$1 = _tmpl$626();
11102
+ var _el$1 = _tmpl$625();
11317
11103
  insert(_el$1, (() => {
11318
11104
  var _c$ = memo(() => !!carrier());
11319
11105
  return () => _c$() ? `${carrier()} ` : "";
@@ -11324,13 +11110,13 @@ function RequestCard(props) {
11324
11110
  },
11325
11111
  get fallback() {
11326
11112
  return (() => {
11327
- var _el$12 = _tmpl$724();
11113
+ var _el$12 = _tmpl$723();
11328
11114
  insert(_el$12, tracking);
11329
11115
  return _el$12;
11330
11116
  })();
11331
11117
  },
11332
11118
  get children() {
11333
- var _el$10 = _tmpl$430();
11119
+ var _el$10 = _tmpl$429();
11334
11120
  insert(_el$10, tracking);
11335
11121
  effect(() => setAttribute(_el$10, "href", trackingUrl()));
11336
11122
  return _el$10;
@@ -11341,7 +11127,7 @@ function RequestCard(props) {
11341
11127
  return deliveryStatus();
11342
11128
  },
11343
11129
  get children() {
11344
- var _el$11 = _tmpl$527();
11130
+ var _el$11 = _tmpl$526();
11345
11131
  insert(_el$11, () => ` \xB7 ${deliveryStatus().replace(/_/g, " ")}`);
11346
11132
  return _el$11;
11347
11133
  }
@@ -11366,7 +11152,7 @@ function RequestCard(props) {
11366
11152
  }, {
11367
11153
  label: "Request id",
11368
11154
  value: (() => {
11369
- var _el$13 = _tmpl$821();
11155
+ var _el$13 = _tmpl$820();
11370
11156
  insert(_el$13, () => r().requestId);
11371
11157
  return _el$13;
11372
11158
  })()
@@ -11377,18 +11163,18 @@ function RequestCard(props) {
11377
11163
  return _el$;
11378
11164
  })();
11379
11165
  }
11380
- var _tmpl$181 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11381
- var _tmpl$258 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change amount`);
11382
- var _tmpl$341 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change schedule`);
11383
- var _tmpl$431 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">`);
11384
- var _tmpl$528 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">`);
11385
- var _tmpl$627 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-danger">`);
11386
- var _tmpl$725 = /* @__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>`);
11387
- var _tmpl$822 = /* @__PURE__ */ template(`<div style=margin-top:0.875rem><button type=button class=app-admin-link-btn> billing attempts (<!>)`);
11388
- var _tmpl$919 = /* @__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>`);
11389
- var _tmpl$016 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11390
- var _tmpl$188 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">Resolve`);
11391
- var _tmpl$1011 = /* @__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>`);
11166
+ var _tmpl$161 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.875rem>`);
11167
+ var _tmpl$257 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change amount`);
11168
+ var _tmpl$340 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Change schedule`);
11169
+ var _tmpl$430 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">`);
11170
+ var _tmpl$527 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm">`);
11171
+ var _tmpl$626 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-danger">`);
11172
+ 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>`);
11173
+ var _tmpl$821 = /* @__PURE__ */ template(`<div style=margin-top:0.875rem><button type=button class=app-admin-link-btn> billing attempts (<!>)`);
11174
+ 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>`);
11175
+ var _tmpl$015 = /* @__PURE__ */ template(`<span class=app-admin-text-mono style=font-size:0.8125rem>`);
11176
+ var _tmpl$169 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">Resolve`);
11177
+ 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>`);
11392
11178
  function attemptTone(status) {
11393
11179
  if (status === "succeeded") return "success";
11394
11180
  if (status === "failed") return "danger";
@@ -11408,14 +11194,14 @@ function SubscriptionCard(props) {
11408
11194
  return null;
11409
11195
  };
11410
11196
  return (() => {
11411
- var _el$ = _tmpl$919(), _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;
11197
+ 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;
11412
11198
  insert(_el$5, () => s().medication || "Subscription");
11413
11199
  insert(_el$4, createComponent(Show, {
11414
11200
  get when() {
11415
11201
  return s().dosage;
11416
11202
  },
11417
11203
  get children() {
11418
- var _el$6 = _tmpl$181();
11204
+ var _el$6 = _tmpl$161();
11419
11205
  insert(_el$6, () => s().dosage);
11420
11206
  return _el$6;
11421
11207
  }
@@ -11442,7 +11228,7 @@ function SubscriptionCard(props) {
11442
11228
  },
11443
11229
  get children() {
11444
11230
  return [(() => {
11445
- var _el$12 = _tmpl$258();
11231
+ var _el$12 = _tmpl$257();
11446
11232
  _el$12.$$click = () => props.onEditAmount(s());
11447
11233
  effect((_p$) => {
11448
11234
  var _v$ = gateway(), _v$2 = gateway() ? "The gateway holds this price; move the subscription to platform billing first." : void 0;
@@ -11455,7 +11241,7 @@ function SubscriptionCard(props) {
11455
11241
  });
11456
11242
  return _el$12;
11457
11243
  })(), (() => {
11458
- var _el$13 = _tmpl$341();
11244
+ var _el$13 = _tmpl$340();
11459
11245
  _el$13.$$click = () => props.onEditSchedule(s());
11460
11246
  return _el$13;
11461
11247
  })()];
@@ -11466,7 +11252,7 @@ function SubscriptionCard(props) {
11466
11252
  return s().status === "active";
11467
11253
  },
11468
11254
  get children() {
11469
- var _el$14 = _tmpl$431();
11255
+ var _el$14 = _tmpl$430();
11470
11256
  _el$14.$$click = () => props.onPause(s());
11471
11257
  insert(_el$14, () => busy("pause") ? "Pausing\u2026" : "Pause");
11472
11258
  effect(() => _el$14.disabled = busy("pause"));
@@ -11478,7 +11264,7 @@ function SubscriptionCard(props) {
11478
11264
  return s().status === "paused";
11479
11265
  },
11480
11266
  get children() {
11481
- var _el$15 = _tmpl$528();
11267
+ var _el$15 = _tmpl$527();
11482
11268
  _el$15.$$click = () => props.onResume(s());
11483
11269
  insert(_el$15, () => busy("resume") ? "Resuming\u2026" : "Resume");
11484
11270
  effect(() => _el$15.disabled = busy("resume"));
@@ -11490,7 +11276,7 @@ function SubscriptionCard(props) {
11490
11276
  return live();
11491
11277
  },
11492
11278
  get children() {
11493
- var _el$16 = _tmpl$627();
11279
+ var _el$16 = _tmpl$626();
11494
11280
  _el$16.$$click = () => props.onCancel(s());
11495
11281
  insert(_el$16, () => busy("cancel") ? "\u2026" : "Cancel");
11496
11282
  effect(() => _el$16.disabled = busy("cancel"));
@@ -11523,7 +11309,7 @@ function SubscriptionCard(props) {
11523
11309
  }, {
11524
11310
  label: "Gateway id",
11525
11311
  value: s().gatewaySubscriptionId ? (() => {
11526
- var _el$27 = _tmpl$016();
11312
+ var _el$27 = _tmpl$015();
11527
11313
  insert(_el$27, () => s().gatewaySubscriptionId);
11528
11314
  return _el$27;
11529
11315
  })() : null
@@ -11535,7 +11321,7 @@ function SubscriptionCard(props) {
11535
11321
  return attempts().length > 0;
11536
11322
  },
11537
11323
  get children() {
11538
- var _el$18 = _tmpl$822(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$20.nextSibling; _el$22.nextSibling;
11324
+ var _el$18 = _tmpl$821(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$20.nextSibling; _el$22.nextSibling;
11539
11325
  _el$19.$$click = () => setShowAttempts((v) => !v);
11540
11326
  insert(_el$19, () => showAttempts() ? "Hide" : "Show", _el$20);
11541
11327
  insert(_el$19, () => attempts().length, _el$22);
@@ -11544,13 +11330,13 @@ function SubscriptionCard(props) {
11544
11330
  return showAttempts();
11545
11331
  },
11546
11332
  get children() {
11547
- var _el$23 = _tmpl$725(), _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
11333
+ var _el$23 = _tmpl$724(), _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
11548
11334
  insert(_el$26, createComponent(For, {
11549
11335
  get each() {
11550
11336
  return attempts();
11551
11337
  },
11552
11338
  children: (a) => (() => {
11553
- var _el$28 = _tmpl$1011(), _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;
11339
+ 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;
11554
11340
  insert(_el$29, () => fmtDate(a.createdAt));
11555
11341
  insert(_el$30, () => (a.billingPeriod ?? 0) + 1, null);
11556
11342
  insert(_el$30, createComponent(Show, {
@@ -11569,7 +11355,7 @@ function SubscriptionCard(props) {
11569
11355
  return a.status === "pending" || a.status === "indeterminate";
11570
11356
  },
11571
11357
  get children() {
11572
- var _el$36 = _tmpl$188();
11358
+ var _el$36 = _tmpl$169();
11573
11359
  _el$36.$$click = () => props.onResolveAttempt(s(), a);
11574
11360
  effect(() => _el$36.disabled = props.busy === `resolve-${a.id}`);
11575
11361
  return _el$36;
@@ -11591,11 +11377,11 @@ function SubscriptionCard(props) {
11591
11377
  })();
11592
11378
  }
11593
11379
  delegateEvents(["click"]);
11594
- var _tmpl$189 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>Showing the latest <!>.`);
11595
- var _tmpl$259 = /* @__PURE__ */ template(`<div class=app-admin-section-stack style=gap:0.5rem><div class=app-admin-text-muted style=font-size:0.8125rem> thread</div><ul style=list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0.5rem>`);
11596
- var _tmpl$343 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>No support conversations.`);
11597
- var _tmpl$432 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Open`);
11598
- var _tmpl$529 = /* @__PURE__ */ template(`<li style=display:flex;align-items:center;justify-content:space-between;gap:0.5rem><div style=min-width:0><div style=font-size:0.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap></div><div class=app-admin-text-muted style=font-size:0.75rem>`);
11380
+ var _tmpl$170 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>Showing the latest <!>.`);
11381
+ var _tmpl$258 = /* @__PURE__ */ template(`<div class=app-admin-section-stack style=gap:0.5rem><div class=app-admin-text-muted style=font-size:0.8125rem> thread</div><ul style=list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0.5rem>`);
11382
+ var _tmpl$341 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>No support conversations.`);
11383
+ var _tmpl$431 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Open`);
11384
+ var _tmpl$528 = /* @__PURE__ */ template(`<li style=display:flex;align-items:center;justify-content:space-between;gap:0.5rem><div style=min-width:0><div style=font-size:0.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap></div><div class=app-admin-text-muted style=font-size:0.75rem>`);
11599
11385
  var STATUS_WORD2 = {
11600
11386
  open: "needs reply",
11601
11387
  pending: "awaiting customer",
@@ -11608,10 +11394,10 @@ function SupportSummary(props) {
11608
11394
  return s().threadCount > 0;
11609
11395
  },
11610
11396
  get fallback() {
11611
- return _tmpl$343();
11397
+ return _tmpl$341();
11612
11398
  },
11613
11399
  get children() {
11614
- var _el$ = _tmpl$259(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
11400
+ var _el$ = _tmpl$258(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
11615
11401
  insert(_el$2, () => s().threadCount, _el$3);
11616
11402
  insert(_el$2, () => s().threadCount === 1 ? "" : "s", null);
11617
11403
  insert(_el$2, createComponent(Show, {
@@ -11627,7 +11413,7 @@ function SupportSummary(props) {
11627
11413
  return s().threads;
11628
11414
  },
11629
11415
  children: (t) => (() => {
11630
- var _el$0 = _tmpl$529(), _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
11416
+ var _el$0 = _tmpl$528(), _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
11631
11417
  insert(_el$10, () => t.subject || "No subject");
11632
11418
  insert(_el$11, () => STATUS_WORD2[t.status] ?? t.status, null);
11633
11419
  insert(_el$11, createComponent(Show, {
@@ -11650,7 +11436,7 @@ function SupportSummary(props) {
11650
11436
  });
11651
11437
  },
11652
11438
  get children() {
11653
- var _el$12 = _tmpl$432();
11439
+ var _el$12 = _tmpl$431();
11654
11440
  _el$12.$$click = () => props.onOpenThread(t.id);
11655
11441
  return _el$12;
11656
11442
  }
@@ -11664,7 +11450,7 @@ function SupportSummary(props) {
11664
11450
  return s().threadCount > s().threads.length;
11665
11451
  },
11666
11452
  get children() {
11667
- var _el$5 = _tmpl$189(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling; _el$8.nextSibling;
11453
+ var _el$5 = _tmpl$170(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling; _el$8.nextSibling;
11668
11454
  insert(_el$5, () => s().threads.length, _el$8);
11669
11455
  return _el$5;
11670
11456
  }
@@ -11676,26 +11462,26 @@ function SupportSummary(props) {
11676
11462
  delegateEvents(["click"]);
11677
11463
 
11678
11464
  // src/pages/admin/customers/CustomerDetail.tsx
11679
- var _tmpl$190 = /* @__PURE__ */ template(`<div class=app-admin-detail>`);
11680
- var _tmpl$260 = /* @__PURE__ */ template(`<button type=button class=app-admin-back><span aria-hidden=true>\u2190</span>Customers`);
11681
- var _tmpl$344 = /* @__PURE__ */ template(`<div style=text-align:center><button type=button class=app-admin-link-btn>Try again`);
11682
- var _tmpl$433 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>Some sections did not load (<!>). <button type=button class=app-admin-link-btn>Reload`);
11683
- var _tmpl$530 = /* @__PURE__ */ template(`<div class=app-admin-alerts data-testid=customer-attention>`);
11684
- var _tmpl$628 = /* @__PURE__ */ template(`<span style=display:inline-flex;align-items:center;gap:0.5rem><input type=email aria-label="Customer email"class=app-admin-input style="width:16rem;padding:0.25rem 0.625rem"><button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"></button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Cancel`);
11685
- var _tmpl$726 = /* @__PURE__ */ template(`<span>`);
11686
- var _tmpl$823 = /* @__PURE__ */ template(`<span>Joined `);
11687
- var _tmpl$920 = /* @__PURE__ */ template(`<span style=display:inline-flex;align-items:center;gap:0.5rem><span></span><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm"style="padding:0.1rem 0.5rem">Edit`);
11688
- var _tmpl$017 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--info"style=text-transform:none>Savings member`);
11689
- var _tmpl$191 = /* @__PURE__ */ template(`<span style=font-size:0.9375rem>`);
11690
- var _tmpl$1012 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">`);
11691
- var _tmpl$1114 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
11692
- var _tmpl$1211 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>Older requests are shown from stored status only.`);
11693
- var _tmpl$1311 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Items</th><th>Total</th><th>Status</th></tr></thead><tbody>`);
11465
+ var _tmpl$171 = /* @__PURE__ */ template(`<div class=app-admin-detail>`);
11466
+ var _tmpl$259 = /* @__PURE__ */ template(`<button type=button class=app-admin-back><span aria-hidden=true>\u2190</span>Customers`);
11467
+ var _tmpl$343 = /* @__PURE__ */ template(`<div style=text-align:center><button type=button class=app-admin-link-btn>Try again`);
11468
+ var _tmpl$432 = /* @__PURE__ */ template(`<p class=app-admin-notice style=margin:0>Some sections did not load (<!>). <button type=button class=app-admin-link-btn>Reload`);
11469
+ var _tmpl$529 = /* @__PURE__ */ template(`<div class=app-admin-alerts data-testid=customer-attention>`);
11470
+ var _tmpl$627 = /* @__PURE__ */ template(`<span style=display:inline-flex;align-items:center;gap:0.5rem><input type=email aria-label="Customer email"class=app-admin-input style="width:16rem;padding:0.25rem 0.625rem"><button type=button class="app-admin-btn app-admin-btn-primary app-admin-btn-sm"></button><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm">Cancel`);
11471
+ var _tmpl$725 = /* @__PURE__ */ template(`<span>`);
11472
+ var _tmpl$822 = /* @__PURE__ */ template(`<span>Joined `);
11473
+ var _tmpl$919 = /* @__PURE__ */ template(`<span style=display:inline-flex;align-items:center;gap:0.5rem><span></span><button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm"style="padding:0.1rem 0.5rem">Edit`);
11474
+ var _tmpl$016 = /* @__PURE__ */ template(`<span class="app-admin-badge app-admin-badge--info"style=text-transform:none>Savings member`);
11475
+ var _tmpl$179 = /* @__PURE__ */ template(`<span style=font-size:0.9375rem>`);
11476
+ var _tmpl$1011 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost">`);
11477
+ var _tmpl$1113 = /* @__PURE__ */ template(`<div class=app-admin-section-stack>`);
11478
+ var _tmpl$1210 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.8125rem>Older requests are shown from stored status only.`);
11479
+ var _tmpl$1310 = /* @__PURE__ */ template(`<div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Items</th><th>Total</th><th>Status</th></tr></thead><tbody>`);
11694
11480
  var _tmpl$1410 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.875rem>No subscriptions.`);
11695
11481
  var _tmpl$1510 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm"title="Cancel any prescription request still awaiting prescriber review. Approved and completed prescriptions are untouched.">`);
11696
11482
  var _tmpl$1610 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.875rem>No prescription requests.`);
11697
11483
  var _tmpl$1710 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Items></td><td data-label=Total></td><td data-label=Status>`);
11698
- var _tmpl$1810 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn>`);
11484
+ var _tmpl$188 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn>`);
11699
11485
  var _tmpl$198 = /* @__PURE__ */ template(`<p class=app-admin-text-muted style=margin:0;font-size:0.875rem>Nothing recorded yet.`);
11700
11486
  var _tmpl$207 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.875rem>The <!> charge for period <!> is <strong></strong>. Check the gateway for this transaction before choosing.`);
11701
11487
  var _tmpl$2113 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem><button type=button class="app-admin-btn app-admin-btn-ghost">The gateway did not capture it: mark failed so billing retries</button><button type=button class="app-admin-btn app-admin-btn-ghost">The gateway captured it: mark succeeded`);
@@ -11722,8 +11508,6 @@ function CustomerDetail(props) {
11722
11508
  }
11723
11509
  });
11724
11510
  const [busy, setBusy] = createSignal(null);
11725
- const [previewToken, setPreviewToken] = createSignal(null);
11726
- const [previewName, setPreviewName] = createSignal("");
11727
11511
  const [editingEmail, setEditingEmail] = createSignal(false);
11728
11512
  const [emailDraft, setEmailDraft] = createSignal("");
11729
11513
  const [savingEmail, setSavingEmail] = createSignal(false);
@@ -11747,15 +11531,6 @@ function CustomerDetail(props) {
11747
11531
  setBusy(null);
11748
11532
  }
11749
11533
  };
11750
- const handleViewAsCustomer = () => withBusy("impersonate", async () => {
11751
- try {
11752
- const res = await adminApi.impersonateCustomer(props.uid);
11753
- setPreviewName([res.customer.firstName, res.customer.lastName].filter(Boolean).join(" ") || res.customer.email);
11754
- setPreviewToken(res.token);
11755
- } catch (err) {
11756
- toastError(err instanceof Error ? err.message : "Could not open customer view");
11757
- }
11758
- });
11759
11534
  const canSendReset = () => !!props.passwordResetRedirectUrl || !!o()?.tenant.passwordResetAvailable;
11760
11535
  const handleSendReset = () => {
11761
11536
  if (!confirm("Send a password reset email to this customer?")) return;
@@ -11983,7 +11758,7 @@ function CustomerDetail(props) {
11983
11758
  };
11984
11759
  const pendingRequests = () => (o()?.requests.items ?? []).filter((r) => r.status === "pending");
11985
11760
  return (() => {
11986
- var _el$ = _tmpl$190();
11761
+ var _el$ = _tmpl$171();
11987
11762
  insert(_el$, createComponent(Show, {
11988
11763
  get when() {
11989
11764
  return !overview.loading;
@@ -11998,7 +11773,7 @@ function CustomerDetail(props) {
11998
11773
  },
11999
11774
  get fallback() {
12000
11775
  return [(() => {
12001
- var _el$2 = _tmpl$260();
11776
+ var _el$2 = _tmpl$259();
12002
11777
  addEventListener(_el$2, "click", props.onBack, true);
12003
11778
  return _el$2;
12004
11779
  })(), createComponent(EmptyState, {
@@ -12006,7 +11781,7 @@ function CustomerDetail(props) {
12006
11781
  return loadError() ?? "This customer could not be loaded.";
12007
11782
  }
12008
11783
  }), (() => {
12009
- var _el$3 = _tmpl$344(), _el$4 = _el$3.firstChild;
11784
+ var _el$3 = _tmpl$343(), _el$4 = _el$3.firstChild;
12010
11785
  _el$4.$$click = () => refetch();
12011
11786
  return _el$3;
12012
11787
  })()];
@@ -12029,14 +11804,14 @@ function CustomerDetail(props) {
12029
11804
  },
12030
11805
  get fallback() {
12031
11806
  return (() => {
12032
- var _el$17 = _tmpl$920(), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling;
11807
+ var _el$17 = _tmpl$919(), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling;
12033
11808
  insert(_el$18, () => c().email);
12034
11809
  _el$19.$$click = () => startEditEmail(c().email);
12035
11810
  return _el$17;
12036
11811
  })();
12037
11812
  },
12038
11813
  get children() {
12039
- var _el$10 = _tmpl$628(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling;
11814
+ var _el$10 = _tmpl$627(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling;
12040
11815
  _el$11.$$input = (e) => setEmailDraft(e.currentTarget.value);
12041
11816
  _el$12.$$click = handleSaveEmail;
12042
11817
  insert(_el$12, () => savingEmail() ? "\u2026" : "Save");
@@ -12060,12 +11835,12 @@ function CustomerDetail(props) {
12060
11835
  return c().phone;
12061
11836
  },
12062
11837
  get children() {
12063
- var _el$14 = _tmpl$726();
11838
+ var _el$14 = _tmpl$725();
12064
11839
  insert(_el$14, () => c().phone);
12065
11840
  return _el$14;
12066
11841
  }
12067
11842
  }), (() => {
12068
- var _el$15 = _tmpl$823(); _el$15.firstChild;
11843
+ var _el$15 = _tmpl$822(); _el$15.firstChild;
12069
11844
  insert(_el$15, () => fmtDate(c().createdAt), null);
12070
11845
  return _el$15;
12071
11846
  })()];
@@ -12080,7 +11855,7 @@ function CustomerDetail(props) {
12080
11855
  return c().savingsMemberId;
12081
11856
  },
12082
11857
  get children() {
12083
- return _tmpl$017();
11858
+ return _tmpl$016();
12084
11859
  }
12085
11860
  }), createComponent(Show, {
12086
11861
  get when() {
@@ -12094,37 +11869,31 @@ function CustomerDetail(props) {
12094
11869
  });
12095
11870
  }
12096
11871
  }), (() => {
12097
- var _el$21 = _tmpl$191();
11872
+ var _el$21 = _tmpl$179();
12098
11873
  insert(_el$21, reason);
12099
11874
  return _el$21;
12100
11875
  })()];
12101
11876
  },
12102
11877
  get actions() {
12103
- return [(() => {
12104
- var _el$22 = _tmpl$1012();
12105
- _el$22.$$click = handleViewAsCustomer;
12106
- insert(_el$22, () => busy() === "impersonate" ? "Opening\u2026" : "View as customer");
12107
- effect(() => _el$22.disabled = busy() === "impersonate");
12108
- return _el$22;
12109
- })(), createComponent(Show, {
11878
+ return createComponent(Show, {
12110
11879
  get when() {
12111
11880
  return canSendReset();
12112
11881
  },
12113
11882
  get children() {
12114
- var _el$23 = _tmpl$1012();
12115
- _el$23.$$click = handleSendReset;
12116
- insert(_el$23, () => busy() === "send-reset" ? "Sending\u2026" : "Send password reset");
12117
- effect(() => _el$23.disabled = busy() === "send-reset");
12118
- return _el$23;
11883
+ var _el$22 = _tmpl$1011();
11884
+ _el$22.$$click = handleSendReset;
11885
+ insert(_el$22, () => busy() === "send-reset" ? "Sending\u2026" : "Send password reset");
11886
+ effect(() => _el$22.disabled = busy() === "send-reset");
11887
+ return _el$22;
12119
11888
  }
12120
- })];
11889
+ });
12121
11890
  }
12122
11891
  }), createComponent(Show, {
12123
11892
  get when() {
12124
11893
  return ov().partial.length > 0;
12125
11894
  },
12126
11895
  get children() {
12127
- var _el$5 = _tmpl$433(), _el$6 = _el$5.firstChild, _el$0 = _el$6.nextSibling, _el$7 = _el$0.nextSibling, _el$9 = _el$7.nextSibling;
11896
+ var _el$5 = _tmpl$432(), _el$6 = _el$5.firstChild, _el$0 = _el$6.nextSibling, _el$7 = _el$0.nextSibling, _el$9 = _el$7.nextSibling;
12128
11897
  insert(_el$5, () => ov().partial.join(", "), _el$0);
12129
11898
  _el$9.$$click = () => refetch();
12130
11899
  return _el$5;
@@ -12134,7 +11903,7 @@ function CustomerDetail(props) {
12134
11903
  return attention().length > 0;
12135
11904
  },
12136
11905
  get children() {
12137
- var _el$1 = _tmpl$530();
11906
+ var _el$1 = _tmpl$529();
12138
11907
  insert(_el$1, createComponent(For, {
12139
11908
  get each() {
12140
11909
  return attention();
@@ -12186,8 +11955,8 @@ function CustomerDetail(props) {
12186
11955
  return _tmpl$1410();
12187
11956
  },
12188
11957
  get children() {
12189
- var _el$24 = _tmpl$1114();
12190
- insert(_el$24, createComponent(For, {
11958
+ var _el$23 = _tmpl$1113();
11959
+ insert(_el$23, createComponent(For, {
12191
11960
  get each() {
12192
11961
  return [...ov().subscriptions].sort((a, b) => Date.parse(b.createdAt ?? "") - Date.parse(a.createdAt ?? ""));
12193
11962
  },
@@ -12207,7 +11976,7 @@ function CustomerDetail(props) {
12207
11976
  })
12208
11977
  })
12209
11978
  }));
12210
- return _el$24;
11979
+ return _el$23;
12211
11980
  }
12212
11981
  });
12213
11982
  }
@@ -12218,14 +11987,14 @@ function CustomerDetail(props) {
12218
11987
  },
12219
11988
  get action() {
12220
11989
  return (() => {
12221
- var _el$32 = _tmpl$1510();
12222
- _el$32.$$click = handleCancelUnapprovedRequests;
12223
- insert(_el$32, (() => {
11990
+ var _el$31 = _tmpl$1510();
11991
+ _el$31.$$click = handleCancelUnapprovedRequests;
11992
+ insert(_el$31, (() => {
12224
11993
  var _c$ = memo(() => busy() === "cancel-requests");
12225
11994
  return () => _c$() ? "Cancelling\u2026" : memo(() => pendingRequests().length > 0)() ? `Cancel unapproved requests (${pendingRequests().length})` : "Cancel unapproved requests";
12226
11995
  })());
12227
- effect(() => _el$32.disabled = busy() === "cancel-requests");
12228
- return _el$32;
11996
+ effect(() => _el$31.disabled = busy() === "cancel-requests");
11997
+ return _el$31;
12229
11998
  })();
12230
11999
  },
12231
12000
  get children() {
@@ -12237,8 +12006,8 @@ function CustomerDetail(props) {
12237
12006
  return _tmpl$1610();
12238
12007
  },
12239
12008
  get children() {
12240
- var _el$25 = _tmpl$1114();
12241
- insert(_el$25, createComponent(For, {
12009
+ var _el$24 = _tmpl$1113();
12010
+ insert(_el$24, createComponent(For, {
12242
12011
  get each() {
12243
12012
  return [...ov().requests.items].sort((a, b) => Date.parse(b.createdAt ?? "") - Date.parse(a.createdAt ?? ""));
12244
12013
  },
@@ -12249,15 +12018,15 @@ function CustomerDetail(props) {
12249
12018
  }
12250
12019
  })
12251
12020
  }), null);
12252
- insert(_el$25, createComponent(Show, {
12021
+ insert(_el$24, createComponent(Show, {
12253
12022
  get when() {
12254
12023
  return ov().requests.capped;
12255
12024
  },
12256
12025
  get children() {
12257
- return _tmpl$1211();
12026
+ return _tmpl$1210();
12258
12027
  }
12259
12028
  }), null);
12260
- return _el$25;
12029
+ return _el$24;
12261
12030
  }
12262
12031
  });
12263
12032
  }
@@ -12290,25 +12059,25 @@ function CustomerDetail(props) {
12290
12059
  },
12291
12060
  flush: true,
12292
12061
  get children() {
12293
- var _el$27 = _tmpl$1311(), _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling;
12294
- insert(_el$30, createComponent(For, {
12062
+ var _el$26 = _tmpl$1310(), _el$27 = _el$26.firstChild, _el$28 = _el$27.firstChild, _el$29 = _el$28.nextSibling;
12063
+ insert(_el$29, createComponent(For, {
12295
12064
  get each() {
12296
12065
  return ov().orders;
12297
12066
  },
12298
12067
  children: (order) => (() => {
12299
- var _el$34 = _tmpl$1710(), _el$35 = _el$34.firstChild, _el$36 = _el$35.nextSibling, _el$37 = _el$36.nextSibling, _el$38 = _el$37.nextSibling;
12300
- insert(_el$35, () => fmtDate(order.createdAt));
12301
- insert(_el$36, () => order.items.map((i) => `${i.quantity && i.quantity > 1 ? `${i.quantity}\xD7 ` : ""}${i.name ?? i.productId ?? "item"}${i.dosage ? ` (${i.dosage})` : ""}`).join(", ") || "\u2014");
12302
- insert(_el$37, () => centsToUsd(order.totalCents));
12303
- insert(_el$38, createComponent(StatusBadge, {
12068
+ var _el$33 = _tmpl$1710(), _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling, _el$36 = _el$35.nextSibling, _el$37 = _el$36.nextSibling;
12069
+ insert(_el$34, () => fmtDate(order.createdAt));
12070
+ insert(_el$35, () => order.items.map((i) => `${i.quantity && i.quantity > 1 ? `${i.quantity}\xD7 ` : ""}${i.name ?? i.productId ?? "item"}${i.dosage ? ` (${i.dosage})` : ""}`).join(", ") || "\u2014");
12071
+ insert(_el$36, () => centsToUsd(order.totalCents));
12072
+ insert(_el$37, createComponent(StatusBadge, {
12304
12073
  get status() {
12305
12074
  return order.status;
12306
12075
  }
12307
12076
  }));
12308
- return _el$34;
12077
+ return _el$33;
12309
12078
  })()
12310
12079
  }));
12311
- return _el$27;
12080
+ return _el$26;
12312
12081
  }
12313
12082
  });
12314
12083
  }
@@ -12357,10 +12126,10 @@ function CustomerDetail(props) {
12357
12126
  },
12358
12127
  get action() {
12359
12128
  return memo(() => timeline().length > TIMELINE_PREVIEW)() ? (() => {
12360
- var _el$39 = _tmpl$1810();
12361
- _el$39.$$click = () => setAllTimeline((v) => !v);
12362
- insert(_el$39, () => allTimeline() ? "Show recent" : "Show all");
12363
- return _el$39;
12129
+ var _el$38 = _tmpl$188();
12130
+ _el$38.$$click = () => setAllTimeline((v) => !v);
12131
+ insert(_el$38, () => allTimeline() ? "Show recent" : "Show all");
12132
+ return _el$38;
12364
12133
  })() : void 0;
12365
12134
  },
12366
12135
  get children() {
@@ -12448,61 +12217,47 @@ function CustomerDetail(props) {
12448
12217
  onClose: () => setResolveTarget(null),
12449
12218
  get children() {
12450
12219
  return [(() => {
12451
- var _el$41 = _tmpl$207(), _el$42 = _el$41.firstChild, _el$47 = _el$42.nextSibling, _el$43 = _el$47.nextSibling, _el$48 = _el$43.nextSibling, _el$44 = _el$48.nextSibling, _el$45 = _el$44.nextSibling, _el$46 = _el$45.nextSibling;
12452
- insert(_el$41, () => centsToUsd(t().attempt.amountCents), _el$47);
12453
- insert(_el$41, () => (t().attempt.billingPeriod ?? 0) + 1, _el$48);
12454
- insert(_el$45, () => t().attempt.status);
12455
- insert(_el$41, (() => {
12220
+ var _el$40 = _tmpl$207(), _el$41 = _el$40.firstChild, _el$46 = _el$41.nextSibling, _el$42 = _el$46.nextSibling, _el$47 = _el$42.nextSibling, _el$43 = _el$47.nextSibling, _el$44 = _el$43.nextSibling, _el$45 = _el$44.nextSibling;
12221
+ insert(_el$40, () => centsToUsd(t().attempt.amountCents), _el$46);
12222
+ insert(_el$40, () => (t().attempt.billingPeriod ?? 0) + 1, _el$47);
12223
+ insert(_el$44, () => t().attempt.status);
12224
+ insert(_el$40, (() => {
12456
12225
  var _c$2 = memo(() => !!t().attempt.errorMessage);
12457
12226
  return () => _c$2() ? ` (${t().attempt.errorMessage})` : "";
12458
- })(), _el$46);
12459
- return _el$41;
12227
+ })(), _el$45);
12228
+ return _el$40;
12460
12229
  })(), (() => {
12461
- var _el$49 = _tmpl$2113(), _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling;
12462
- _el$50.$$click = () => resolveAttempt("failed");
12463
- _el$51.$$click = () => resolveAttempt("succeeded");
12230
+ var _el$48 = _tmpl$2113(), _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling;
12231
+ _el$49.$$click = () => resolveAttempt("failed");
12232
+ _el$50.$$click = () => resolveAttempt("succeeded");
12464
12233
  effect((_p$) => {
12465
12234
  var _v$4 = busy() !== null, _v$5 = busy() !== null;
12466
- _v$4 !== _p$.e && (_el$50.disabled = _p$.e = _v$4);
12467
- _v$5 !== _p$.t && (_el$51.disabled = _p$.t = _v$5);
12235
+ _v$4 !== _p$.e && (_el$49.disabled = _p$.e = _v$4);
12236
+ _v$5 !== _p$.t && (_el$50.disabled = _p$.t = _v$5);
12468
12237
  return _p$;
12469
12238
  }, {
12470
12239
  e: void 0,
12471
12240
  t: void 0
12472
12241
  });
12473
- return _el$49;
12242
+ return _el$48;
12474
12243
  })()];
12475
12244
  }
12476
12245
  })
12477
12246
  }), null);
12478
- insert(_el$, createComponent(Show, {
12479
- get when() {
12480
- return previewToken();
12481
- },
12482
- children: (token) => createComponent(PatientDashboardPreview, {
12483
- get token() {
12484
- return token();
12485
- },
12486
- get customerName() {
12487
- return previewName();
12488
- },
12489
- onClose: () => setPreviewToken(null)
12490
- })
12491
- }), null);
12492
12247
  return _el$;
12493
12248
  })();
12494
12249
  }
12495
12250
  delegateEvents(["click", "input"]);
12496
- var _tmpl$199 = /* @__PURE__ */ template(`<label style=display:inline-flex;align-items:center;gap:0.375rem><input type=checkbox>Savings members only`);
12497
- var _tmpl$261 = /* @__PURE__ */ template(`<div style="padding:0.75rem 1rem;border-top:1px solid var(--app-admin-border-soft);display:flex;justify-content:center"><button type=button class="app-admin-btn app-admin-btn-ghost">`);
12498
- var _tmpl$345 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Customer</th><th>Status</th><th>Plan</th><th>Prescription</th><th>Last activity</th><th>Joined</th></tr></thead><tbody>`);
12499
- var _tmpl$434 = /* @__PURE__ */ template(`<div style=margin-top:0.75rem><button type=button class=app-admin-link-btn>Retry`);
12500
- var _tmpl$531 = /* @__PURE__ */ template(`<div><div style=display:flex;flex-direction:column;gap:0.875rem;margin-bottom:1.25rem><div style=max-width:28rem><input type=search placeholder="Search by name or email"aria-label="Search customers"class=app-admin-input></div><div class=app-admin-chips role=group aria-label="Filter by status"></div><div style=display:flex;flex-wrap:wrap;gap:1rem;font-size:0.8125rem;color:var(--app-admin-fg-muted)><label style=display:inline-flex;align-items:center;gap:0.375rem><input type=checkbox>Never completed intake`);
12501
- var _tmpl$629 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.8125rem>`);
12502
- var _tmpl$727 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.75rem>`);
12503
- var _tmpl$824 = /* @__PURE__ */ template(`<span style=text-transform:capitalize>`);
12504
- var _tmpl$921 = /* @__PURE__ */ template(`<tr class=is-clickable tabindex=0><td data-label=Customer class=app-admin-table-cell--title><div style=font-weight:500></div></td><td data-label=Status><div style=display:flex;flex-direction:column;gap:0.25rem;align-items:flex-start></div></td><td data-label=Plan class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Prescription class=app-admin-text-muted style=font-size:0.8125rem;text-transform:capitalize></td><td data-label="Last activity"class=app-admin-text-muted></td><td data-label=Joined class=app-admin-text-muted>`);
12505
- var _tmpl$018 = /* @__PURE__ */ template(`<span>\u2014`);
12251
+ var _tmpl$180 = /* @__PURE__ */ template(`<label style=display:inline-flex;align-items:center;gap:0.375rem><input type=checkbox>Savings members only`);
12252
+ var _tmpl$260 = /* @__PURE__ */ template(`<div style="padding:0.75rem 1rem;border-top:1px solid var(--app-admin-border-soft);display:flex;justify-content:center"><button type=button class="app-admin-btn app-admin-btn-ghost">`);
12253
+ var _tmpl$344 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Customer</th><th>Status</th><th>Plan</th><th>Prescription</th><th>Last activity</th><th>Joined</th></tr></thead><tbody>`);
12254
+ var _tmpl$433 = /* @__PURE__ */ template(`<div style=margin-top:0.75rem><button type=button class=app-admin-link-btn>Retry`);
12255
+ var _tmpl$530 = /* @__PURE__ */ template(`<div><div style=display:flex;flex-direction:column;gap:0.875rem;margin-bottom:1.25rem><div style=max-width:28rem><input type=search placeholder="Search by name or email"aria-label="Search customers"class=app-admin-input></div><div class=app-admin-chips role=group aria-label="Filter by status"></div><div style=display:flex;flex-wrap:wrap;gap:1rem;font-size:0.8125rem;color:var(--app-admin-fg-muted)><label style=display:inline-flex;align-items:center;gap:0.375rem><input type=checkbox>Never completed intake`);
12256
+ var _tmpl$628 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.8125rem>`);
12257
+ var _tmpl$726 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.75rem>`);
12258
+ var _tmpl$823 = /* @__PURE__ */ template(`<span style=text-transform:capitalize>`);
12259
+ var _tmpl$920 = /* @__PURE__ */ template(`<tr class=is-clickable tabindex=0><td data-label=Customer class=app-admin-table-cell--title><div style=font-weight:500></div></td><td data-label=Status><div style=display:flex;flex-direction:column;gap:0.25rem;align-items:flex-start></div></td><td data-label=Plan class=app-admin-text-muted style=font-size:0.8125rem></td><td data-label=Prescription class=app-admin-text-muted style=font-size:0.8125rem;text-transform:capitalize></td><td data-label="Last activity"class=app-admin-text-muted></td><td data-label=Joined class=app-admin-text-muted>`);
12260
+ var _tmpl$017 = /* @__PURE__ */ template(`<span>\u2014`);
12506
12261
  var PAGE = 50;
12507
12262
  function hint(row) {
12508
12263
  const f = row.facts;
@@ -12612,7 +12367,7 @@ function CustomerList(props) {
12612
12367
  };
12613
12368
  const showSavingsToggle = () => savingsOnly() || rows().some((r) => r.facts?.isSavingsMember);
12614
12369
  return (() => {
12615
- var _el$ = _tmpl$531(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.nextSibling, _el$9 = _el$6.firstChild, _el$0 = _el$9.firstChild;
12370
+ var _el$ = _tmpl$530(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.nextSibling, _el$9 = _el$6.firstChild, _el$0 = _el$9.firstChild;
12616
12371
  insert(_el$, createComponent(PageTitle, {
12617
12372
  subtitle: "Every account on this site, with where each one is in the journey.",
12618
12373
  children: "Customers"
@@ -12648,7 +12403,7 @@ function CustomerList(props) {
12648
12403
  return showSavingsToggle();
12649
12404
  },
12650
12405
  get children() {
12651
- var _el$7 = _tmpl$199(), _el$8 = _el$7.firstChild;
12406
+ var _el$7 = _tmpl$180(), _el$8 = _el$7.firstChild;
12652
12407
  _el$8.addEventListener("change", (e) => setSavingsOnly(e.currentTarget.checked));
12653
12408
  effect(() => _el$8.checked = savingsOnly());
12654
12409
  return _el$7;
@@ -12663,7 +12418,7 @@ function CustomerList(props) {
12663
12418
  return createComponent(LoadingSpinner, {});
12664
12419
  },
12665
12420
  get children() {
12666
- var _el$1 = _tmpl$345(), _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
12421
+ var _el$1 = _tmpl$344(), _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
12667
12422
  insert(_el$13, createComponent(For, {
12668
12423
  get each() {
12669
12424
  return rows();
@@ -12672,7 +12427,7 @@ function CustomerList(props) {
12672
12427
  const name = () => [row.firstName, row.lastName].filter(Boolean).join(" ").trim();
12673
12428
  const lastActivity = () => row.facts?.lastPaymentAt ?? row.createdAt;
12674
12429
  return (() => {
12675
- var _el$18 = _tmpl$921(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$19.nextSibling, _el$23 = _el$22.firstChild, _el$25 = _el$22.nextSibling, _el$27 = _el$25.nextSibling, _el$28 = _el$27.nextSibling, _el$29 = _el$28.nextSibling;
12430
+ var _el$18 = _tmpl$920(), _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$22 = _el$19.nextSibling, _el$23 = _el$22.firstChild, _el$25 = _el$22.nextSibling, _el$27 = _el$25.nextSibling, _el$28 = _el$27.nextSibling, _el$29 = _el$28.nextSibling;
12676
12431
  _el$18.$$keydown = (e) => {
12677
12432
  if (e.key === "Enter" || e.key === " ") {
12678
12433
  e.preventDefault();
@@ -12686,7 +12441,7 @@ function CustomerList(props) {
12686
12441
  return name();
12687
12442
  },
12688
12443
  get children() {
12689
- var _el$21 = _tmpl$629();
12444
+ var _el$21 = _tmpl$628();
12690
12445
  insert(_el$21, () => row.email);
12691
12446
  return _el$21;
12692
12447
  }
@@ -12701,7 +12456,7 @@ function CustomerList(props) {
12701
12456
  return hint(row);
12702
12457
  },
12703
12458
  get children() {
12704
- var _el$24 = _tmpl$727();
12459
+ var _el$24 = _tmpl$726();
12705
12460
  insert(_el$24, () => hint(row));
12706
12461
  return _el$24;
12707
12462
  }
@@ -12711,11 +12466,11 @@ function CustomerList(props) {
12711
12466
  return memo(() => !!row.facts)() && row.facts.subscriptionCount > 0;
12712
12467
  },
12713
12468
  get fallback() {
12714
- return _tmpl$018();
12469
+ return _tmpl$017();
12715
12470
  },
12716
12471
  get children() {
12717
12472
  return [(() => {
12718
- var _el$26 = _tmpl$824();
12473
+ var _el$26 = _tmpl$823();
12719
12474
  insert(_el$26, () => (row.facts.latestSubscriptionStatus ?? row.subscriptionStatus).replace(/_/g, " "));
12720
12475
  return _el$26;
12721
12476
  })(), createComponent(Show, {
@@ -12752,7 +12507,7 @@ function CustomerList(props) {
12752
12507
  return hasMore();
12753
12508
  },
12754
12509
  get children() {
12755
- var _el$14 = _tmpl$261(), _el$15 = _el$14.firstChild;
12510
+ var _el$14 = _tmpl$260(), _el$15 = _el$14.firstChild;
12756
12511
  _el$15.$$click = loadMore;
12757
12512
  insert(_el$15, () => loadingMore() ? "Loading\u2026" : "Load more");
12758
12513
  effect(() => _el$15.disabled = loadingMore());
@@ -12767,7 +12522,7 @@ function CustomerList(props) {
12767
12522
  return page.error;
12768
12523
  },
12769
12524
  get children() {
12770
- var _el$16 = _tmpl$434(), _el$17 = _el$16.firstChild;
12525
+ var _el$16 = _tmpl$433(), _el$17 = _el$16.firstChild;
12771
12526
  _el$17.$$click = () => refetch();
12772
12527
  return _el$16;
12773
12528
  }
@@ -12864,10 +12619,10 @@ function Customers(props = {}) {
12864
12619
  })
12865
12620
  });
12866
12621
  }
12867
- var _tmpl$200 = /* @__PURE__ */ template(`<div data-testid=admin-stats style="display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))">`);
12868
- var _tmpl$266 = /* @__PURE__ */ template(`<div>`);
12869
- var _tmpl$346 = /* @__PURE__ */ template(`<span style="display:block;font-size:0.875rem;color:var(--app-admin-fg-muted);margin:0 0 0.5rem">`);
12870
- var _tmpl$435 = /* @__PURE__ */ template(`<span class=app-admin-heading style=display:block;font-size:1.875rem;margin:0>`);
12622
+ var _tmpl$181 = /* @__PURE__ */ template(`<div data-testid=admin-stats style="display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))">`);
12623
+ var _tmpl$261 = /* @__PURE__ */ template(`<div>`);
12624
+ var _tmpl$345 = /* @__PURE__ */ template(`<span style="display:block;font-size:0.875rem;color:var(--app-admin-fg-muted);margin:0 0 0.5rem">`);
12625
+ var _tmpl$434 = /* @__PURE__ */ template(`<span class=app-admin-heading style=display:block;font-size:1.875rem;margin:0>`);
12871
12626
  function Dashboard(props) {
12872
12627
  const [stats] = createResource(async () => {
12873
12628
  try {
@@ -12910,7 +12665,7 @@ function Dashboard(props) {
12910
12665
  ];
12911
12666
  };
12912
12667
  return (() => {
12913
- var _el$ = _tmpl$266();
12668
+ var _el$ = _tmpl$261();
12914
12669
  insert(_el$, createComponent(PageTitle, {
12915
12670
  children: "Dashboard"
12916
12671
  }), null);
@@ -12932,7 +12687,7 @@ function Dashboard(props) {
12932
12687
  });
12933
12688
  },
12934
12689
  get children() {
12935
- var _el$2 = _tmpl$200();
12690
+ var _el$2 = _tmpl$181();
12936
12691
  insert(_el$2, createComponent(For, {
12937
12692
  get each() {
12938
12693
  return cards();
@@ -12963,11 +12718,11 @@ function Dashboard(props) {
12963
12718
  },
12964
12719
  get children() {
12965
12720
  return [(() => {
12966
- var _el$3 = _tmpl$346();
12721
+ var _el$3 = _tmpl$345();
12967
12722
  insert(_el$3, () => card.label);
12968
12723
  return _el$3;
12969
12724
  })(), (() => {
12970
- var _el$4 = _tmpl$435();
12725
+ var _el$4 = _tmpl$434();
12971
12726
  insert(_el$4, () => card.value);
12972
12727
  effect((_$p) => setStyleProperty(_el$4, "color", card.tint));
12973
12728
  return _el$4;
@@ -12984,9 +12739,9 @@ function Dashboard(props) {
12984
12739
  return _el$;
12985
12740
  })();
12986
12741
  }
12987
- var _tmpl$201 = /* @__PURE__ */ template(`<div style="color:var(--admin-text-muted, #64748b);font-size:14px">Connected<!> \xB7 `);
12988
- var _tmpl$267 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border:1px solid var(--admin-border, #e2e8f0);border-radius:10px;margin-bottom:20px;background:var(--admin-surface, #fff)"><div><div style=font-weight:600>QuickBooks Payments</div></div><button class="btn btn-primary">`);
12989
- var _tmpl$347 = /* @__PURE__ */ template(`<div style="color:var(--admin-text-muted, #64748b);font-size:14px">Not connected \u2014 connect your QuickBooks account to accept payments.`);
12742
+ var _tmpl$189 = /* @__PURE__ */ template(`<div style="color:var(--admin-text-muted, #64748b);font-size:14px">Connected<!> \xB7 `);
12743
+ var _tmpl$266 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border:1px solid var(--admin-border, #e2e8f0);border-radius:10px;margin-bottom:20px;background:var(--admin-surface, #fff)"><div><div style=font-weight:600>QuickBooks Payments</div></div><button class="btn btn-primary">`);
12744
+ var _tmpl$346 = /* @__PURE__ */ template(`<div style="color:var(--admin-text-muted, #64748b);font-size:14px">Not connected \u2014 connect your QuickBooks account to accept payments.`);
12990
12745
  function QuickBooksCard() {
12991
12746
  const [status, {
12992
12747
  refetch
@@ -13024,16 +12779,16 @@ function QuickBooksCard() {
13024
12779
  return status()?.provider === "quickbooks";
13025
12780
  },
13026
12781
  get children() {
13027
- var _el$ = _tmpl$267(), _el$2 = _el$.firstChild; _el$2.firstChild; var _el$8 = _el$2.nextSibling;
12782
+ var _el$ = _tmpl$266(), _el$2 = _el$.firstChild; _el$2.firstChild; var _el$8 = _el$2.nextSibling;
13028
12783
  insert(_el$2, createComponent(Show, {
13029
12784
  get when() {
13030
12785
  return status()?.connected;
13031
12786
  },
13032
12787
  get fallback() {
13033
- return _tmpl$347();
12788
+ return _tmpl$346();
13034
12789
  },
13035
12790
  get children() {
13036
- var _el$4 = _tmpl$201(), _el$5 = _el$4.firstChild, _el$7 = _el$5.nextSibling; _el$7.nextSibling;
12791
+ var _el$4 = _tmpl$189(), _el$5 = _el$4.firstChild, _el$7 = _el$5.nextSibling; _el$7.nextSibling;
13037
12792
  insert(_el$4, (() => {
13038
12793
  var _c$ = memo(() => !!status()?.realmId);
13039
12794
  return () => _c$() ? ` \xB7 company ${status().realmId}` : "";
@@ -13055,13 +12810,13 @@ function QuickBooksCard() {
13055
12810
  delegateEvents(["click"]);
13056
12811
 
13057
12812
  // src/pages/admin/Payments.tsx
13058
- var _tmpl$208 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Customer</th><th>Amount</th><th>Status</th><th>Transaction ID</th><th style=width:6rem>Actions</th></tr></thead><tbody>`);
13059
- var _tmpl$268 = /* @__PURE__ */ template(`<div>`);
13060
- var _tmpl$348 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit;font-weight:inherit>`);
13061
- var _tmpl$436 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem> refunded`);
13062
- var _tmpl$532 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
13063
- var _tmpl$630 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">`);
13064
- var _tmpl$728 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Customer style=font-weight:500></td><td data-label=Amount></td><td data-label=Status></td><td data-label="Transaction ID"class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem></td><td data-label=Actions>`);
12813
+ var _tmpl$190 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><div class=app-admin-table-wrap><table class=app-admin-table><thead><tr><th>Date</th><th>Customer</th><th>Amount</th><th>Status</th><th>Transaction ID</th><th style=width:6rem>Actions</th></tr></thead><tbody>`);
12814
+ var _tmpl$267 = /* @__PURE__ */ template(`<div>`);
12815
+ var _tmpl$347 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn style=font-size:inherit;font-weight:inherit>`);
12816
+ var _tmpl$435 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem> refunded`);
12817
+ var _tmpl$531 = /* @__PURE__ */ template(`<div class=app-admin-text-muted style=font-size:0.75rem>`);
12818
+ var _tmpl$629 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-warning">`);
12819
+ var _tmpl$727 = /* @__PURE__ */ template(`<tr><td data-label=Date class=app-admin-text-muted></td><td data-label=Customer style=font-weight:500></td><td data-label=Amount></td><td data-label=Status></td><td data-label="Transaction ID"class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem></td><td data-label=Actions>`);
13065
12820
  function Payments() {
13066
12821
  const nav = useAdminNav();
13067
12822
  const [refreshKey, setRefreshKey] = createSignal(0);
@@ -13138,7 +12893,7 @@ function Payments() {
13138
12893
  };
13139
12894
  const refundable = (p) => p.status === "succeeded" && p.amountCents - (p.refundedAmountCents ?? 0) > 0;
13140
12895
  return (() => {
13141
- var _el$ = _tmpl$268();
12896
+ var _el$ = _tmpl$267();
13142
12897
  insert(_el$, createComponent(PageTitle, {
13143
12898
  children: "Payments"
13144
12899
  }), null);
@@ -13151,13 +12906,13 @@ function Payments() {
13151
12906
  return createComponent(LoadingSpinner, {});
13152
12907
  },
13153
12908
  get children() {
13154
- var _el$2 = _tmpl$208(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling; _el$1.nextSibling; var _el$11 = _el$5.nextSibling;
12909
+ var _el$2 = _tmpl$190(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling; _el$1.nextSibling; var _el$11 = _el$5.nextSibling;
13155
12910
  insert(_el$11, createComponent(For, {
13156
12911
  get each() {
13157
12912
  return payments() ?? [];
13158
12913
  },
13159
12914
  children: (payment) => (() => {
13160
- var _el$12 = _tmpl$728(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling, _el$19 = _el$16.nextSibling, _el$21 = _el$19.nextSibling, _el$22 = _el$21.nextSibling;
12915
+ var _el$12 = _tmpl$727(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$16 = _el$14.nextSibling, _el$19 = _el$16.nextSibling, _el$21 = _el$19.nextSibling, _el$22 = _el$21.nextSibling;
13161
12916
  insert(_el$13, () => fmtDate(payment.date));
13162
12917
  insert(_el$14, createComponent(Show, {
13163
12918
  get when() {
@@ -13167,7 +12922,7 @@ function Payments() {
13167
12922
  return payment.customerEmail;
13168
12923
  },
13169
12924
  get children() {
13170
- var _el$15 = _tmpl$348();
12925
+ var _el$15 = _tmpl$347();
13171
12926
  _el$15.$$click = () => nav.openCustomer(payment.customerUid);
13172
12927
  insert(_el$15, () => payment.customerEmail);
13173
12928
  return _el$15;
@@ -13179,7 +12934,7 @@ function Payments() {
13179
12934
  return memo(() => (payment.refundedAmountCents ?? 0) > 0)() && payment.status !== "refunded";
13180
12935
  },
13181
12936
  get children() {
13182
- var _el$17 = _tmpl$436(), _el$18 = _el$17.firstChild;
12937
+ var _el$17 = _tmpl$435(), _el$18 = _el$17.firstChild;
13183
12938
  insert(_el$17, () => centsToUsd(payment.refundedAmountCents), _el$18);
13184
12939
  return _el$17;
13185
12940
  }
@@ -13194,7 +12949,7 @@ function Payments() {
13194
12949
  return payment.failureReason;
13195
12950
  },
13196
12951
  get children() {
13197
- var _el$20 = _tmpl$532();
12952
+ var _el$20 = _tmpl$531();
13198
12953
  insert(_el$20, () => payment.failureReason);
13199
12954
  return _el$20;
13200
12955
  }
@@ -13205,7 +12960,7 @@ function Payments() {
13205
12960
  return refundable(payment);
13206
12961
  },
13207
12962
  get children() {
13208
- var _el$23 = _tmpl$630();
12963
+ var _el$23 = _tmpl$629();
13209
12964
  _el$23.$$click = () => openRefund(payment);
13210
12965
  insert(_el$23, () => loadingRefund() === payment.id ? "..." : "Refund");
13211
12966
  effect(() => _el$23.disabled = loadingRefund() === payment.id);
@@ -13282,34 +13037,34 @@ async function loadApexDrugs() {
13282
13037
  }
13283
13038
 
13284
13039
  // src/pages/admin/Products.tsx
13285
- var _tmpl$209 = /* @__PURE__ */ template(`<div style="background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);font-size:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);margin-bottom:0.5rem">`);
13286
- var _tmpl$269 = /* @__PURE__ */ template(`<div style=position:relative><img style="width:100%;height:8rem;object-fit:cover;border-radius:var(--app-admin-radius);border:1px solid var(--app-admin-border)"><div style="position:absolute;inset:0;background:rgba(0,0,0,0.6);border-radius:var(--app-admin-radius);display:flex;align-items:center;justify-content:center;gap:0.75rem;opacity:0;transition:opacity 0.15s"><button type=button class="app-admin-btn app-admin-btn-ghost"style=background:rgba(255,255,255,0.15);color:white></button><button type=button class="app-admin-btn app-admin-btn-danger">Remove`);
13287
- var _tmpl$349 = /* @__PURE__ */ template(`<div style=margin-bottom:1.25rem><input type=file accept=image/* style=display:none>`);
13288
- var _tmpl$437 = /* @__PURE__ */ template(`<button type=button style="width:100%;height:8rem;border:2px dashed var(--app-admin-border-strong);border-radius:var(--app-admin-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;color:var(--app-admin-fg-muted);background:transparent;cursor:pointer;font-size:0.75rem"><span>\u{1F4F7}</span><span>`);
13289
- var _tmpl$533 = /* @__PURE__ */ template(`<option value>`);
13290
- var _tmpl$631 = /* @__PURE__ */ template(`<option>`);
13291
- var _tmpl$729 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-top:0.5rem;font-size:0.75rem>Use Default from Apex`);
13292
- var _tmpl$825 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.375rem 0.75rem">`);
13293
- var _tmpl$922 = /* @__PURE__ */ template(`<select class=app-admin-input><option value>None (use Apex default)`);
13294
- var _tmpl$019 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox><span>Prescriber picks the dose (no fixed SKU sent)`);
13295
- var _tmpl$1100 = /* @__PURE__ */ template(`<div style=margin-top:0.5rem><label class=app-admin-label>Bound SKU</label><select class=app-admin-input>`);
13296
- var _tmpl$1013 = /* @__PURE__ */ template(`<div><label class=app-admin-label>Pharmacy SKU binding</label><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0.5rem;line-height:1.4">Bind each dose to a specific Apex SKU so the exact product is sent to the pharmacy \u2014 no fuzzy label matching. Turn on \u201CPrescriber picks\u201D for a titration product with no fixed SKU at order time.`);
13297
- var _tmpl$1115 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.625rem>`);
13298
- var _tmpl$1212 = /* @__PURE__ */ template(`<div><label class=app-admin-label>Available doses &amp; pricing</label><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0.5rem;line-height:1.4">Doses come from the linked Apex drug. Leave a price blank to charge the base price<!>.`);
13299
- var _tmpl$1312 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"title="Reset this product's fields to the built-in defaults">Reset to defaults`);
13040
+ var _tmpl$191 = /* @__PURE__ */ template(`<div style="background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);font-size:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);margin-bottom:0.5rem">`);
13041
+ var _tmpl$268 = /* @__PURE__ */ template(`<div style=position:relative><img style="width:100%;height:8rem;object-fit:cover;border-radius:var(--app-admin-radius);border:1px solid var(--app-admin-border)"><div style="position:absolute;inset:0;background:rgba(0,0,0,0.6);border-radius:var(--app-admin-radius);display:flex;align-items:center;justify-content:center;gap:0.75rem;opacity:0;transition:opacity 0.15s"><button type=button class="app-admin-btn app-admin-btn-ghost"style=background:rgba(255,255,255,0.15);color:white></button><button type=button class="app-admin-btn app-admin-btn-danger">Remove`);
13042
+ var _tmpl$348 = /* @__PURE__ */ template(`<div style=margin-bottom:1.25rem><input type=file accept=image/* style=display:none>`);
13043
+ var _tmpl$436 = /* @__PURE__ */ template(`<button type=button style="width:100%;height:8rem;border:2px dashed var(--app-admin-border-strong);border-radius:var(--app-admin-radius);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;color:var(--app-admin-fg-muted);background:transparent;cursor:pointer;font-size:0.75rem"><span>\u{1F4F7}</span><span>`);
13044
+ var _tmpl$532 = /* @__PURE__ */ template(`<option value>`);
13045
+ var _tmpl$630 = /* @__PURE__ */ template(`<option>`);
13046
+ var _tmpl$728 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-top:0.5rem;font-size:0.75rem>Use Default from Apex`);
13047
+ var _tmpl$824 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.375rem 0.75rem">`);
13048
+ var _tmpl$921 = /* @__PURE__ */ template(`<select class=app-admin-input><option value>None (use Apex default)`);
13049
+ var _tmpl$018 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox><span>Prescriber picks the dose (no fixed SKU sent)`);
13050
+ var _tmpl$199 = /* @__PURE__ */ template(`<div style=margin-top:0.5rem><label class=app-admin-label>Bound SKU</label><select class=app-admin-input>`);
13051
+ var _tmpl$1012 = /* @__PURE__ */ template(`<div><label class=app-admin-label>Pharmacy SKU binding</label><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0.5rem;line-height:1.4">Bind each dose to a specific Apex SKU so the exact product is sent to the pharmacy \u2014 no fuzzy label matching. Turn on \u201CPrescriber picks\u201D for a titration product with no fixed SKU at order time.`);
13052
+ var _tmpl$1114 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.625rem>`);
13053
+ var _tmpl$1211 = /* @__PURE__ */ template(`<div><label class=app-admin-label>Available doses &amp; pricing</label><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0.5rem;line-height:1.4">Doses come from the linked Apex drug. Leave a price blank to charge the base price<!>.`);
13054
+ var _tmpl$1311 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"title="Reset this product's fields to the built-in defaults">Reset to defaults`);
13300
13055
  var _tmpl$1411 = /* @__PURE__ */ template(`<div class="app-admin-side-panel app-admin-side-panel--narrow"><div style=padding:1.5rem><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem><h2 class=app-admin-heading style=font-size:1.125rem;margin:0>Edit Product</h2><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div class="app-admin-text-mono app-admin-text-muted"style="font-size:0.75rem;background:var(--app-admin-surface-light);padding:0.25rem 0.5rem;border-radius:var(--app-admin-radius-sm);margin-bottom:1.5rem">Drug ID: </div><div style=display:flex;flex-direction:column;gap:1rem><div><label class=app-admin-label>Name</label><input type=text class=app-admin-input></div><div><label class=app-admin-label>Description</label><textarea rows=3 class=app-admin-input style=resize:vertical></textarea></div><div><label class=app-admin-label>Price ($)</label><input type=number step=0.01 class=app-admin-input></div><div><label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox><span>Featured product</span></label></div><div><label class=app-admin-label>Categories</label></div><div><label class=app-admin-label>Pricing Mode</label><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.5rem"></div><p style="font-size:0.6875rem;color:var(--app-admin-fg-muted);margin:0.375rem 0 0;line-height:1.4"></p></div><div><label class=app-admin-label>Default Dosage</label></div><div><label class=app-admin-label>Benefits (one per line)</label><textarea rows=4 class=app-admin-input style=resize:vertical></textarea></div><div style=display:flex;gap:0.75rem;padding-top:0.5rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=flex:1>Cancel</button><button type=button class="app-admin-btn app-admin-btn-primary"style=flex:1>`);
13301
13056
  var _tmpl$1511 = /* @__PURE__ */ template(`<p style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0>No categories defined yet. Create some on the Categories tab.`);
13302
13057
  var _tmpl$1611 = /* @__PURE__ */ template(`<label style=display:flex;align-items:center;gap:0.5rem;font-size:0.875rem;cursor:pointer><input type=checkbox><span>`);
13303
13058
  var _tmpl$1711 = /* @__PURE__ */ template(`<div style=margin-top:0.5rem;font-size:0.75rem;color:var(--app-admin-warning-fg)><div style=margin-bottom:0.25rem>Unknown categories on this product:</div><div style=display:flex;flex-wrap:wrap;gap:0.375rem>`);
13304
- var _tmpl$1811 = /* @__PURE__ */ template(`<span style="display:inline-flex;align-items:center;gap:0.25rem;padding:0.125rem 0.5rem;background:var(--app-admin-warning-bg);border:1px solid var(--app-admin-warning-bg-strong);border-radius:var(--app-admin-radius-sm)"><button type=button title=Remove style=background:none;border:none;color:inherit;cursor:pointer;line-height:1;padding:0>\xD7`);
13059
+ var _tmpl$1810 = /* @__PURE__ */ template(`<span style="display:inline-flex;align-items:center;gap:0.25rem;padding:0.125rem 0.5rem;background:var(--app-admin-warning-bg);border:1px solid var(--app-admin-warning-bg-strong);border-radius:var(--app-admin-radius-sm)"><button type=button title=Remove style=background:none;border:none;color:inherit;cursor:pointer;line-height:1;padding:0>\xD7`);
13305
13060
  var _tmpl$1910 = /* @__PURE__ */ template(`<button type=button style=font-size:0.75rem>`);
13306
- var _tmpl$2010 = /* @__PURE__ */ template(`<input type=text class=app-admin-input>`);
13061
+ var _tmpl$208 = /* @__PURE__ */ template(`<input type=text class=app-admin-input>`);
13307
13062
  var _tmpl$2114 = /* @__PURE__ */ template(`<p style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0>This drug publishes no Apex SKUs; requests are sent by drug id only (the prescriber selects the SKU).`);
13308
13063
  var _tmpl$2211 = /* @__PURE__ */ template(`<p style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0>`);
13309
13064
  var _tmpl$2310 = /* @__PURE__ */ template(`<select class=app-admin-input title="Bind this dose to an Apex SKU"style=flex:1;min-width:0>`);
13310
13065
  var _tmpl$2410 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg)></span><div style=display:flex;gap:0.5rem;align-items:center><input type=number step=0.01 class=app-admin-input style=width:7rem>`);
13311
13066
  var _tmpl$2510 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th style=width:4rem>Status</th><th>Drug</th><th>ID</th><th>Price</th><th>Dosages</th><th>Categories</th></tr></thead><tbody>`);
13312
- var _tmpl$2610 = /* @__PURE__ */ template(`<div style=display:flex;height:100%><div style="flex:1;min-width:0;transition:margin 0.2s">`);
13067
+ var _tmpl$269 = /* @__PURE__ */ template(`<div style=display:flex;height:100%><div style="flex:1;min-width:0;transition:margin 0.2s">`);
13313
13068
  var _tmpl$276 = /* @__PURE__ */ template(`<span style=opacity:0.5;font-size:0.75rem>Not configured`);
13314
13069
  var _tmpl$285 = /* @__PURE__ */ template(`<tr><td data-label=Status class=app-admin-table-cell--no-label><button type=button><span class=app-admin-toggle__knob></span></button></td><td data-label=Drug class=app-admin-table-cell--title></td><td data-label=ID class="app-admin-text-mono app-admin-text-muted app-admin-table-cell--end"style=font-size:0.75rem></td><td data-label=Price></td><td data-label=Dosages class=app-admin-text-muted style=font-size:0.75rem></td><td data-label=Categories class=app-admin-text-muted><div style=display:flex;flex-wrap:wrap;gap:0.25rem>`);
13315
13070
  var _tmpl$294 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>-`);
@@ -13360,7 +13115,7 @@ function ThumbnailUpload(props) {
13360
13115
  }
13361
13116
  };
13362
13117
  return (() => {
13363
- var _el$ = _tmpl$349(), _el$2 = _el$.firstChild;
13118
+ var _el$ = _tmpl$348(), _el$2 = _el$.firstChild;
13364
13119
  _el$2.addEventListener("change", (e) => {
13365
13120
  const file = e.currentTarget.files?.[0];
13366
13121
  if (file) handleFile(file);
@@ -13373,7 +13128,7 @@ function ThumbnailUpload(props) {
13373
13128
  return error();
13374
13129
  },
13375
13130
  get children() {
13376
- var _el$3 = _tmpl$209();
13131
+ var _el$3 = _tmpl$191();
13377
13132
  insert(_el$3, error);
13378
13133
  return _el$3;
13379
13134
  }
@@ -13384,7 +13139,7 @@ function ThumbnailUpload(props) {
13384
13139
  },
13385
13140
  get fallback() {
13386
13141
  return (() => {
13387
- var _el$9 = _tmpl$437(), _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling;
13142
+ var _el$9 = _tmpl$436(), _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling;
13388
13143
  _el$9.$$click = () => fileInput.click();
13389
13144
  insert(_el$1, () => uploading() ? "Uploading\u2026" : "Add thumbnail");
13390
13145
  effect(() => _el$9.disabled = uploading());
@@ -13392,7 +13147,7 @@ function ThumbnailUpload(props) {
13392
13147
  })();
13393
13148
  },
13394
13149
  get children() {
13395
- var _el$4 = _tmpl$269(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
13150
+ var _el$4 = _tmpl$268(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
13396
13151
  _el$6.addEventListener("mouseleave", (e) => e.currentTarget.style.opacity = "0");
13397
13152
  _el$6.addEventListener("mouseenter", (e) => e.currentTarget.style.opacity = "1");
13398
13153
  _el$7.$$click = () => fileInput.click();
@@ -13419,7 +13174,7 @@ function ThumbnailUpload(props) {
13419
13174
  }
13420
13175
  function SkuSelectOptions(props) {
13421
13176
  return [(() => {
13422
- var _el$10 = _tmpl$533();
13177
+ var _el$10 = _tmpl$532();
13423
13178
  insert(_el$10, () => props.placeholder);
13424
13179
  return _el$10;
13425
13180
  })(), createComponent(For, {
@@ -13427,7 +13182,7 @@ function SkuSelectOptions(props) {
13427
13182
  return props.skus;
13428
13183
  },
13429
13184
  children: (s) => (() => {
13430
- var _el$11 = _tmpl$631();
13185
+ var _el$11 = _tmpl$630();
13431
13186
  insert(_el$11, () => s.label, null);
13432
13187
  insert(_el$11, () => s.active === false ? " (inactive)" : "", null);
13433
13188
  effect(() => _el$11.value = s.id);
@@ -13593,7 +13348,7 @@ function ProductEditPanel(props) {
13593
13348
  return memo(() => !!apexAdCopy())() && apexAdCopy() !== description();
13594
13349
  },
13595
13350
  get children() {
13596
- var _el$26 = _tmpl$729();
13351
+ var _el$26 = _tmpl$728();
13597
13352
  _el$26.$$click = () => setDescription(apexAdCopy());
13598
13353
  return _el$26;
13599
13354
  }
@@ -13608,7 +13363,7 @@ function ProductEditPanel(props) {
13608
13363
  return _tmpl$1511();
13609
13364
  },
13610
13365
  get children() {
13611
- var _el$35 = _tmpl$825();
13366
+ var _el$35 = _tmpl$824();
13612
13367
  insert(_el$35, createComponent(For, {
13613
13368
  get each() {
13614
13369
  return props.availableCategories;
@@ -13641,7 +13396,7 @@ function ProductEditPanel(props) {
13641
13396
  return unknown();
13642
13397
  },
13643
13398
  children: (id) => (() => {
13644
- var _el$73 = _tmpl$1811(), _el$74 = _el$73.firstChild;
13399
+ var _el$73 = _tmpl$1810(), _el$74 = _el$73.firstChild;
13645
13400
  insert(_el$73, id, _el$74);
13646
13401
  _el$74.$$click = () => setSelectedCategoryIds((prev) => prev.filter((x) => x !== id));
13647
13402
  return _el$73;
@@ -13668,7 +13423,7 @@ function ProductEditPanel(props) {
13668
13423
  },
13669
13424
  get fallback() {
13670
13425
  return (() => {
13671
- var _el$76 = _tmpl$2010();
13426
+ var _el$76 = _tmpl$208();
13672
13427
  _el$76.$$input = (e) => setDosageOverride(e.currentTarget.value);
13673
13428
  effect(() => setAttribute(_el$76, "placeholder", loadingDosages() ? "Loading dosages\u2026" : "e.g. 5mg"));
13674
13429
  effect(() => _el$76.value = dosageOverride());
@@ -13676,14 +13431,14 @@ function ProductEditPanel(props) {
13676
13431
  })();
13677
13432
  },
13678
13433
  get children() {
13679
- var _el$42 = _tmpl$922(); _el$42.firstChild;
13434
+ var _el$42 = _tmpl$921(); _el$42.firstChild;
13680
13435
  _el$42.addEventListener("change", (e) => setDosageOverride(e.currentTarget.value));
13681
13436
  insert(_el$42, createComponent(For, {
13682
13437
  get each() {
13683
13438
  return apexDosages();
13684
13439
  },
13685
13440
  children: (d) => (() => {
13686
- var _el$77 = _tmpl$631();
13441
+ var _el$77 = _tmpl$630();
13687
13442
  _el$77.value = d;
13688
13443
  insert(_el$77, d);
13689
13444
  return _el$77;
@@ -13698,7 +13453,7 @@ function ProductEditPanel(props) {
13698
13453
  return props.product.apexDrugId;
13699
13454
  },
13700
13455
  get children() {
13701
- var _el$44 = _tmpl$1013(), _el$45 = _el$44.firstChild; _el$45.nextSibling;
13456
+ var _el$44 = _tmpl$1012(), _el$45 = _el$44.firstChild; _el$45.nextSibling;
13702
13457
  insert(_el$44, createComponent(Show, {
13703
13458
  get when() {
13704
13459
  return apexSkus().length > 0;
@@ -13708,7 +13463,7 @@ function ProductEditPanel(props) {
13708
13463
  },
13709
13464
  get children() {
13710
13465
  return [(() => {
13711
- var _el$47 = _tmpl$019(), _el$48 = _el$47.firstChild;
13466
+ var _el$47 = _tmpl$018(), _el$48 = _el$47.firstChild;
13712
13467
  _el$48.addEventListener("change", (e) => setPrescriberPicks(e.currentTarget.checked));
13713
13468
  effect(() => _el$48.checked = prescriberPicks());
13714
13469
  return _el$47;
@@ -13717,7 +13472,7 @@ function ProductEditPanel(props) {
13717
13472
  return memo(() => !!!prescriberPicks())() && pricingMode() === "flat_fee";
13718
13473
  },
13719
13474
  get children() {
13720
- var _el$49 = _tmpl$1100(), _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling;
13475
+ var _el$49 = _tmpl$199(), _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling;
13721
13476
  _el$51.addEventListener("change", (e) => setProductSkuId(e.currentTarget.value));
13722
13477
  insert(_el$51, createComponent(SkuSelectOptions, {
13723
13478
  get skus() {
@@ -13739,7 +13494,7 @@ function ProductEditPanel(props) {
13739
13494
  return pricingMode() === "per_dose";
13740
13495
  },
13741
13496
  get children() {
13742
- var _el$52 = _tmpl$1212(), _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.firstChild, _el$57 = _el$55.nextSibling; _el$57.nextSibling;
13497
+ var _el$52 = _tmpl$1211(), _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.firstChild, _el$57 = _el$55.nextSibling; _el$57.nextSibling;
13743
13498
  insert(_el$54, (() => {
13744
13499
  var _c$ = memo(() => !!price());
13745
13500
  return () => _c$() ? ` ($${price()})` : "";
@@ -13756,7 +13511,7 @@ function ProductEditPanel(props) {
13756
13511
  })();
13757
13512
  },
13758
13513
  get children() {
13759
- var _el$58 = _tmpl$1115();
13514
+ var _el$58 = _tmpl$1114();
13760
13515
  insert(_el$58, createComponent(For, {
13761
13516
  get each() {
13762
13517
  return apexDosages();
@@ -13799,7 +13554,7 @@ function ProductEditPanel(props) {
13799
13554
  return resetCandidate();
13800
13555
  },
13801
13556
  get children() {
13802
- var _el$63 = _tmpl$1312();
13557
+ var _el$63 = _tmpl$1311();
13803
13558
  _el$63.$$click = applyReset;
13804
13559
  effect(() => _el$63.disabled = props.saving);
13805
13560
  return _el$63;
@@ -13945,7 +13700,7 @@ function Products(props) {
13945
13700
  };
13946
13701
  const loading = () => products() === void 0;
13947
13702
  return (() => {
13948
- var _el$85 = _tmpl$2610(), _el$86 = _el$85.firstChild;
13703
+ var _el$85 = _tmpl$269(), _el$86 = _el$85.firstChild;
13949
13704
  insert(_el$86, createComponent(PageTitle, {
13950
13705
  subtitle: "Click any drug to configure it; use the toggle to make it available to customers",
13951
13706
  children: "Products"
@@ -14079,15 +13834,15 @@ function Products(props) {
14079
13834
  })();
14080
13835
  }
14081
13836
  delegateEvents(["click", "input"]);
14082
- var _tmpl$270 = /* @__PURE__ */ template(`<div style="background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);border:1px solid var(--app-admin-danger-bg-strong);font-size:0.875rem;border-radius:var(--app-admin-radius-sm);padding:0.5rem 0.75rem;margin-bottom:1rem">`);
14083
- var _tmpl$271 = /* @__PURE__ */ template(`<input type=number min=1 placeholder="Number of rebills"class=app-admin-input style=margin-top:0.5rem>`);
14084
- var _tmpl$350 = /* @__PURE__ */ template(`<div class=app-admin-side-panel style=width:440px><div style=padding:1.5rem><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem><h2 class=app-admin-heading style=font-size:1.125rem;margin:0></h2><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div style=display:flex;flex-direction:column;gap:1rem><div><label class=app-admin-label>Name</label><input type=text placeholder="Spring sale"class=app-admin-input></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.75rem"><div><label class=app-admin-label>Discount type</label><select class=app-admin-input><option value=percent>Percent off</option><option value=fixed>Fixed $ off</option></select></div><div><label class=app-admin-label></label><input type=number min=0 class=app-admin-input></div></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.75rem"><div><label class=app-admin-label>Start date</label><input type=datetime-local class=app-admin-input></div><div><label class=app-admin-label>End date</label><input type=datetime-local class=app-admin-input></div></div><div><label class=app-admin-label>Products <span style=text-transform:none;letter-spacing:normal;opacity:0.7>(required)</span></label><div class=app-admin-card-soft style=padding:0.5rem;max-height:11rem;overflow-y:auto></div></div><div><label class=app-admin-label>Recurring (subscriptions)</label><select class=app-admin-input><option value=none>Initial charge only</option><option value=finite>First N rebills</option><option value=indefinite>All recurring charges (indefinite)</option></select></div><label style=display:flex;align-items:center;gap:0.5rem;margin-top:0.5rem><input type=checkbox><span style=font-size:0.875rem>Exclusive (cannot stack with other discounts)</span></label><label style=display:flex;align-items:center;gap:0.5rem><input type=checkbox><span style=font-size:0.875rem>Active</span></label><div style=display:flex;gap:0.75rem;padding-top:0.5rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=flex:1>Cancel</button><button type=button class="app-admin-btn app-admin-btn-primary"style=flex:1>`);
14085
- var _tmpl$438 = /* @__PURE__ */ template(`<div style=color:var(--app-admin-fg-muted);font-size:0.875rem;padding:0.5rem>No products available.`);
14086
- var _tmpl$534 = /* @__PURE__ */ template(`<label style="display:flex;align-items:center;gap:0.5rem;padding:0.375rem 0.5rem;border-radius:var(--app-admin-radius-sm);cursor:pointer"><input type=checkbox><span style=font-size:0.875rem>`);
14087
- var _tmpl$632 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th>Name</th><th>Discount</th><th>Window</th><th>Products</th><th>Status</th><th style=width:8rem></th></tr></thead><tbody>`);
14088
- var _tmpl$730 = /* @__PURE__ */ template(`<div><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem><button type=button class="app-admin-btn app-admin-btn-primary">+ New sale`);
14089
- var _tmpl$826 = /* @__PURE__ */ template(`<span style=margin-left:0.5rem;font-size:0.75rem;color:var(--app-admin-warning-fg)>exclusive`);
14090
- var _tmpl$923 = /* @__PURE__ */ template(`<tr><td data-label=Name style=font-weight:500></td><td data-label=Discount></td><td data-label=Window class=app-admin-text-muted> \u2192 </td><td data-label=Products class=app-admin-text-muted></td><td data-label=Status><span></span></td><td data-label=Actions><button type=button style=background:none;border:none;color:var(--app-admin-primary-soft-fg);cursor:pointer;font-size:0.875rem>Edit</button><button type=button style=background:none;border:none;color:var(--app-admin-danger-fg);cursor:pointer;font-size:0.875rem;margin-left:0.75rem>Delete`);
13837
+ var _tmpl$200 = /* @__PURE__ */ template(`<div style="background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);border:1px solid var(--app-admin-danger-bg-strong);font-size:0.875rem;border-radius:var(--app-admin-radius-sm);padding:0.5rem 0.75rem;margin-bottom:1rem">`);
13838
+ var _tmpl$270 = /* @__PURE__ */ template(`<input type=number min=1 placeholder="Number of rebills"class=app-admin-input style=margin-top:0.5rem>`);
13839
+ var _tmpl$349 = /* @__PURE__ */ template(`<div class=app-admin-side-panel style=width:440px><div style=padding:1.5rem><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem><h2 class=app-admin-heading style=font-size:1.125rem;margin:0></h2><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div style=display:flex;flex-direction:column;gap:1rem><div><label class=app-admin-label>Name</label><input type=text placeholder="Spring sale"class=app-admin-input></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.75rem"><div><label class=app-admin-label>Discount type</label><select class=app-admin-input><option value=percent>Percent off</option><option value=fixed>Fixed $ off</option></select></div><div><label class=app-admin-label></label><input type=number min=0 class=app-admin-input></div></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:0.75rem"><div><label class=app-admin-label>Start date</label><input type=datetime-local class=app-admin-input></div><div><label class=app-admin-label>End date</label><input type=datetime-local class=app-admin-input></div></div><div><label class=app-admin-label>Products <span style=text-transform:none;letter-spacing:normal;opacity:0.7>(required)</span></label><div class=app-admin-card-soft style=padding:0.5rem;max-height:11rem;overflow-y:auto></div></div><div><label class=app-admin-label>Recurring (subscriptions)</label><select class=app-admin-input><option value=none>Initial charge only</option><option value=finite>First N rebills</option><option value=indefinite>All recurring charges (indefinite)</option></select></div><label style=display:flex;align-items:center;gap:0.5rem;margin-top:0.5rem><input type=checkbox><span style=font-size:0.875rem>Exclusive (cannot stack with other discounts)</span></label><label style=display:flex;align-items:center;gap:0.5rem><input type=checkbox><span style=font-size:0.875rem>Active</span></label><div style=display:flex;gap:0.75rem;padding-top:0.5rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=flex:1>Cancel</button><button type=button class="app-admin-btn app-admin-btn-primary"style=flex:1>`);
13840
+ var _tmpl$437 = /* @__PURE__ */ template(`<div style=color:var(--app-admin-fg-muted);font-size:0.875rem;padding:0.5rem>No products available.`);
13841
+ var _tmpl$533 = /* @__PURE__ */ template(`<label style="display:flex;align-items:center;gap:0.5rem;padding:0.375rem 0.5rem;border-radius:var(--app-admin-radius-sm);cursor:pointer"><input type=checkbox><span style=font-size:0.875rem>`);
13842
+ var _tmpl$631 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th>Name</th><th>Discount</th><th>Window</th><th>Products</th><th>Status</th><th style=width:8rem></th></tr></thead><tbody>`);
13843
+ var _tmpl$729 = /* @__PURE__ */ template(`<div><div style=display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem><button type=button class="app-admin-btn app-admin-btn-primary">+ New sale`);
13844
+ var _tmpl$825 = /* @__PURE__ */ template(`<span style=margin-left:0.5rem;font-size:0.75rem;color:var(--app-admin-warning-fg)>exclusive`);
13845
+ var _tmpl$922 = /* @__PURE__ */ template(`<tr><td data-label=Name style=font-weight:500></td><td data-label=Discount></td><td data-label=Window class=app-admin-text-muted> \u2192 </td><td data-label=Products class=app-admin-text-muted></td><td data-label=Status><span></span></td><td data-label=Actions><button type=button style=background:none;border:none;color:var(--app-admin-primary-soft-fg);cursor:pointer;font-size:0.875rem>Edit</button><button type=button style=background:none;border:none;color:var(--app-admin-danger-fg);cursor:pointer;font-size:0.875rem;margin-left:0.75rem>Delete`);
14091
13846
  function SaleEditPanel(props) {
14092
13847
  const editing = () => props.sale !== null;
14093
13848
  const initial = props.sale;
@@ -14147,7 +13902,7 @@ function SaleEditPanel(props) {
14147
13902
  }
14148
13903
  };
14149
13904
  return (() => {
14150
- var _el$ = _tmpl$350(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$8.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$10.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$1.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$17.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$16.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild; _el$25.nextSibling; var _el$28 = _el$24.nextSibling, _el$29 = _el$23.nextSibling, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$33 = _el$29.nextSibling, _el$34 = _el$33.firstChild; _el$34.nextSibling; var _el$36 = _el$33.nextSibling, _el$37 = _el$36.firstChild; _el$37.nextSibling; var _el$39 = _el$36.nextSibling, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling;
13905
+ var _el$ = _tmpl$349(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$8.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$10.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$1.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$17.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$16.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild; _el$25.nextSibling; var _el$28 = _el$24.nextSibling, _el$29 = _el$23.nextSibling, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$33 = _el$29.nextSibling, _el$34 = _el$33.firstChild; _el$34.nextSibling; var _el$36 = _el$33.nextSibling, _el$37 = _el$36.firstChild; _el$37.nextSibling; var _el$39 = _el$36.nextSibling, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling;
14151
13906
  insert(_el$4, () => editing() ? "Edit Sale" : "New Sale");
14152
13907
  addEventListener(_el$5, "click", props.onClose, true);
14153
13908
  insert(_el$2, createComponent(Show, {
@@ -14155,7 +13910,7 @@ function SaleEditPanel(props) {
14155
13910
  return error();
14156
13911
  },
14157
13912
  get children() {
14158
- var _el$6 = _tmpl$270();
13913
+ var _el$6 = _tmpl$200();
14159
13914
  insert(_el$6, error);
14160
13915
  return _el$6;
14161
13916
  }
@@ -14171,7 +13926,7 @@ function SaleEditPanel(props) {
14171
13926
  return props.products.length > 0;
14172
13927
  },
14173
13928
  get fallback() {
14174
- return _tmpl$438();
13929
+ return _tmpl$437();
14175
13930
  },
14176
13931
  get children() {
14177
13932
  return createComponent(For, {
@@ -14179,7 +13934,7 @@ function SaleEditPanel(props) {
14179
13934
  return props.products;
14180
13935
  },
14181
13936
  children: (p) => (() => {
14182
- var _el$43 = _tmpl$534(), _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling;
13937
+ var _el$43 = _tmpl$533(), _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling;
14183
13938
  _el$44.addEventListener("change", () => toggleProduct(p.id));
14184
13939
  insert(_el$45, () => p.name);
14185
13940
  effect(() => _el$44.checked = productIds().includes(p.id));
@@ -14194,7 +13949,7 @@ function SaleEditPanel(props) {
14194
13949
  return recurringMode() === "finite";
14195
13950
  },
14196
13951
  get children() {
14197
- var _el$32 = _tmpl$271();
13952
+ var _el$32 = _tmpl$270();
14198
13953
  _el$32.$$input = (e) => setRecurringCharges(parseInt(e.currentTarget.value, 10) || 0);
14199
13954
  effect(() => _el$32.value = recurringCharges());
14200
13955
  return _el$32;
@@ -14265,7 +14020,7 @@ function Sales() {
14265
14020
  }
14266
14021
  };
14267
14022
  return (() => {
14268
- var _el$46 = _tmpl$730(), _el$47 = _el$46.firstChild, _el$48 = _el$47.firstChild;
14023
+ var _el$46 = _tmpl$729(), _el$47 = _el$46.firstChild, _el$48 = _el$47.firstChild;
14269
14024
  insert(_el$47, createComponent(PageTitle, {
14270
14025
  subtitle: "Named promotions applied directly to selected products at checkout.",
14271
14026
  children: "Sales"
@@ -14279,20 +14034,20 @@ function Sales() {
14279
14034
  return createComponent(LoadingSpinner, {});
14280
14035
  },
14281
14036
  get children() {
14282
- var _el$49 = _tmpl$632(), _el$50 = _el$49.firstChild, _el$51 = _el$50.firstChild, _el$52 = _el$51.firstChild, _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.nextSibling, _el$56 = _el$55.nextSibling, _el$57 = _el$56.nextSibling; _el$57.nextSibling; var _el$59 = _el$51.nextSibling;
14037
+ var _el$49 = _tmpl$631(), _el$50 = _el$49.firstChild, _el$51 = _el$50.firstChild, _el$52 = _el$51.firstChild, _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.nextSibling, _el$56 = _el$55.nextSibling, _el$57 = _el$56.nextSibling; _el$57.nextSibling; var _el$59 = _el$51.nextSibling;
14283
14038
  insert(_el$59, createComponent(For, {
14284
14039
  get each() {
14285
14040
  return sales() ?? [];
14286
14041
  },
14287
14042
  children: (s) => (() => {
14288
- var _el$60 = _tmpl$923(), _el$61 = _el$60.firstChild, _el$63 = _el$61.nextSibling, _el$64 = _el$63.nextSibling, _el$65 = _el$64.firstChild, _el$66 = _el$64.nextSibling, _el$67 = _el$66.nextSibling, _el$68 = _el$67.firstChild, _el$69 = _el$67.nextSibling, _el$70 = _el$69.firstChild, _el$71 = _el$70.nextSibling;
14043
+ var _el$60 = _tmpl$922(), _el$61 = _el$60.firstChild, _el$63 = _el$61.nextSibling, _el$64 = _el$63.nextSibling, _el$65 = _el$64.firstChild, _el$66 = _el$64.nextSibling, _el$67 = _el$66.nextSibling, _el$68 = _el$67.firstChild, _el$69 = _el$67.nextSibling, _el$70 = _el$69.firstChild, _el$71 = _el$70.nextSibling;
14289
14044
  insert(_el$61, () => s.name, null);
14290
14045
  insert(_el$61, createComponent(Show, {
14291
14046
  get when() {
14292
14047
  return s.isExclusive;
14293
14048
  },
14294
14049
  get children() {
14295
- return _tmpl$826();
14050
+ return _tmpl$825();
14296
14051
  }
14297
14052
  }), null);
14298
14053
  insert(_el$63, () => fmtDiscount(s.discountType, s.discountValueCents));
@@ -14343,20 +14098,20 @@ function Sales() {
14343
14098
  })();
14344
14099
  }
14345
14100
  delegateEvents(["click", "input"]);
14346
- var _tmpl$277 = /* @__PURE__ */ template(`<button type=button style=display:block;padding:0;border:none;background:none;cursor:pointer;margin-top:0.5rem><img loading=lazy style=max-width:100%;max-height:15rem;border-radius:0.5rem;display:block>`, true, false, false);
14347
- var _tmpl$278 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-top:0.5rem;font-size:0.75rem>\u{1F4CE} `);
14348
- var _tmpl$351 = /* @__PURE__ */ template(`<p style=margin:0;white-space:pre-wrap;line-height:1.5>`);
14349
- var _tmpl$439 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style="padding:0.75rem 0.875rem;margin-bottom:0.5rem"><div style=display:flex;justify-content:space-between;gap:1rem;margin-bottom:0.25rem><strong style=font-size:0.75rem></strong><span class=app-admin-text-muted style=font-size:0.75rem>`);
14350
- var _tmpl$535 = /* @__PURE__ */ template(`<p class=app-admin-text-muted role=alert style=color:var(--app-admin-danger-fg)>`);
14351
- var _tmpl$633 = /* @__PURE__ */ template(`<div><div style=display:flex;gap:0.5rem;margin-bottom:1rem;flex-wrap:wrap></div><div style="display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1.6fr);gap:1rem"><div class=app-admin-card style=overflow:hidden;padding:0></div><div class=app-admin-card style=padding:1.25rem>`);
14352
- var _tmpl$731 = /* @__PURE__ */ template(`<button type=button>`);
14353
- var _tmpl$827 = /* @__PURE__ */ template(`<button type=button style="display:block;width:100%;text-align:left;padding:0.75rem 1rem;border:none;border-bottom:1px solid var(--app-admin-border);cursor:pointer"><div style=display:flex;justify-content:space-between;gap:0.5rem><span></span><span class=app-admin-text-muted style=font-size:0.75rem></span></div><div style=display:flex;justify-content:space-between;gap:0.5rem;margin-top:0.25rem><span class=app-admin-text-muted style=font-size:0.8125rem>`);
14354
- var _tmpl$924 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn>View customer`);
14355
- var _tmpl$020 = /* @__PURE__ */ template(`<div style=display:flex;justify-content:space-between;gap:1rem;align-items:flex-start><div><h3 style="margin:0 0 0.25rem"></h3><p class=app-admin-text-muted style=margin:0;font-size:0.8125rem></p></div><div style=display:flex;gap:0.375rem>`);
14356
- var _tmpl$1101 = /* @__PURE__ */ template(`<div data-scrollable style="margin:1rem 0;max-height:26rem;overflow-y:auto"><div>`);
14357
- var _tmpl$1014 = /* @__PURE__ */ template(`<form><textarea class=app-admin-input rows=4 maxlength=5000 placeholder="Write a reply\u2026"aria-label=Reply style=width:100%></textarea><div style=display:flex;gap:0.5rem;align-items:center;margin-top:0.5rem><button type=submit class="app-admin-btn app-admin-btn-primary"></button><label class="app-admin-btn app-admin-btn-ghost"style=cursor:pointer>\u{1F4CE} Attach<input type=file style=display:none>`);
14358
- var _tmpl$1116 = /* @__PURE__ */ template(`<button type=button style=font-size:0.75rem>`);
14359
- var _tmpl$1213 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.8125rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-left:0.25rem;font-size:0.75rem>remove`);
14101
+ var _tmpl$201 = /* @__PURE__ */ template(`<button type=button style=display:block;padding:0;border:none;background:none;cursor:pointer;margin-top:0.5rem><img loading=lazy style=max-width:100%;max-height:15rem;border-radius:0.5rem;display:block>`, true, false, false);
14102
+ var _tmpl$271 = /* @__PURE__ */ template(`<button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-top:0.5rem;font-size:0.75rem>\u{1F4CE} `);
14103
+ var _tmpl$350 = /* @__PURE__ */ template(`<p style=margin:0;white-space:pre-wrap;line-height:1.5>`);
14104
+ var _tmpl$438 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style="padding:0.75rem 0.875rem;margin-bottom:0.5rem"><div style=display:flex;justify-content:space-between;gap:1rem;margin-bottom:0.25rem><strong style=font-size:0.75rem></strong><span class=app-admin-text-muted style=font-size:0.75rem>`);
14105
+ var _tmpl$534 = /* @__PURE__ */ template(`<p class=app-admin-text-muted role=alert style=color:var(--app-admin-danger-fg)>`);
14106
+ var _tmpl$632 = /* @__PURE__ */ template(`<div><div style=display:flex;gap:0.5rem;margin-bottom:1rem;flex-wrap:wrap></div><div style="display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1.6fr);gap:1rem"><div class=app-admin-card style=overflow:hidden;padding:0></div><div class=app-admin-card style=padding:1.25rem>`);
14107
+ var _tmpl$730 = /* @__PURE__ */ template(`<button type=button>`);
14108
+ var _tmpl$826 = /* @__PURE__ */ template(`<button type=button style="display:block;width:100%;text-align:left;padding:0.75rem 1rem;border:none;border-bottom:1px solid var(--app-admin-border);cursor:pointer"><div style=display:flex;justify-content:space-between;gap:0.5rem><span></span><span class=app-admin-text-muted style=font-size:0.75rem></span></div><div style=display:flex;justify-content:space-between;gap:0.5rem;margin-top:0.25rem><span class=app-admin-text-muted style=font-size:0.8125rem>`);
14109
+ var _tmpl$923 = /* @__PURE__ */ template(`<button type=button class=app-admin-link-btn>View customer`);
14110
+ var _tmpl$019 = /* @__PURE__ */ template(`<div style=display:flex;justify-content:space-between;gap:1rem;align-items:flex-start><div><h3 style="margin:0 0 0.25rem"></h3><p class=app-admin-text-muted style=margin:0;font-size:0.8125rem></p></div><div style=display:flex;gap:0.375rem>`);
14111
+ var _tmpl$1100 = /* @__PURE__ */ template(`<div data-scrollable style="margin:1rem 0;max-height:26rem;overflow-y:auto"><div>`);
14112
+ var _tmpl$1013 = /* @__PURE__ */ template(`<form><textarea class=app-admin-input rows=4 maxlength=5000 placeholder="Write a reply\u2026"aria-label=Reply style=width:100%></textarea><div style=display:flex;gap:0.5rem;align-items:center;margin-top:0.5rem><button type=submit class="app-admin-btn app-admin-btn-primary"></button><label class="app-admin-btn app-admin-btn-ghost"style=cursor:pointer>\u{1F4CE} Attach<input type=file style=display:none>`);
14113
+ var _tmpl$1115 = /* @__PURE__ */ template(`<button type=button style=font-size:0.75rem>`);
14114
+ var _tmpl$1212 = /* @__PURE__ */ template(`<span class=app-admin-text-muted style=font-size:0.8125rem><button type=button class="app-admin-btn app-admin-btn-ghost"style=margin-left:0.25rem;font-size:0.75rem>remove`);
14360
14115
  var STATUS_FILTERS3 = [{
14361
14116
  value: "all",
14362
14117
  label: "All"
@@ -14522,14 +14277,14 @@ function Support(props = {}) {
14522
14277
  },
14523
14278
  get fallback() {
14524
14279
  return (() => {
14525
- var _el$3 = _tmpl$278(); _el$3.firstChild;
14280
+ var _el$3 = _tmpl$271(); _el$3.firstChild;
14526
14281
  _el$3.$$click = () => openAttachment(p.attachment.id);
14527
14282
  insert(_el$3, () => p.attachment.filename, null);
14528
14283
  return _el$3;
14529
14284
  })();
14530
14285
  },
14531
14286
  get children() {
14532
- var _el$ = _tmpl$277(), _el$2 = _el$.firstChild;
14287
+ var _el$ = _tmpl$201(), _el$2 = _el$.firstChild;
14533
14288
  _el$.$$click = () => openAttachment(p.attachment.id);
14534
14289
  _el$2.addEventListener("error", () => {
14535
14290
  if (retried) {
@@ -14555,7 +14310,7 @@ function Support(props = {}) {
14555
14310
  const Bubble = (p) => {
14556
14311
  const fromSupport = () => p.msg.sender === "support";
14557
14312
  return (() => {
14558
- var _el$5 = _tmpl$439(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
14313
+ var _el$5 = _tmpl$438(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
14559
14314
  insert(_el$7, () => fromSupport() ? "Support" : "Customer");
14560
14315
  insert(_el$8, () => formatWhen(p.msg.createdAt));
14561
14316
  insert(_el$5, createComponent(Show, {
@@ -14563,7 +14318,7 @@ function Support(props = {}) {
14563
14318
  return p.msg.body;
14564
14319
  },
14565
14320
  get children() {
14566
- var _el$9 = _tmpl$351();
14321
+ var _el$9 = _tmpl$350();
14567
14322
  insert(_el$9, () => p.msg.body);
14568
14323
  return _el$9;
14569
14324
  }
@@ -14593,7 +14348,7 @@ function Support(props = {}) {
14593
14348
  })();
14594
14349
  };
14595
14350
  return (() => {
14596
- var _el$0 = _tmpl$633(), _el$1 = _el$0.firstChild, _el$11 = _el$1.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
14351
+ var _el$0 = _tmpl$632(), _el$1 = _el$0.firstChild, _el$11 = _el$1.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
14597
14352
  insert(_el$0, createComponent(PageTitle, {
14598
14353
  subtitle: "Customer messages from the member portal",
14599
14354
  children: "Support"
@@ -14601,7 +14356,7 @@ function Support(props = {}) {
14601
14356
  insert(_el$1, createComponent(For, {
14602
14357
  each: STATUS_FILTERS3,
14603
14358
  children: (f) => (() => {
14604
- var _el$14 = _tmpl$731();
14359
+ var _el$14 = _tmpl$730();
14605
14360
  _el$14.$$click = () => {
14606
14361
  setStatusFilter(f.value);
14607
14362
  setSelectedId(null);
@@ -14616,7 +14371,7 @@ function Support(props = {}) {
14616
14371
  return error();
14617
14372
  },
14618
14373
  get children() {
14619
- var _el$10 = _tmpl$535();
14374
+ var _el$10 = _tmpl$534();
14620
14375
  insert(_el$10, error);
14621
14376
  return _el$10;
14622
14377
  }
@@ -14644,7 +14399,7 @@ function Support(props = {}) {
14644
14399
  return threads() ?? [];
14645
14400
  },
14646
14401
  children: (t) => (() => {
14647
- var _el$15 = _tmpl$827(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling, _el$19 = _el$16.nextSibling, _el$20 = _el$19.firstChild;
14402
+ var _el$15 = _tmpl$826(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling, _el$19 = _el$16.nextSibling, _el$20 = _el$19.firstChild;
14648
14403
  _el$15.$$click = () => setSelectedId(t.id);
14649
14404
  insert(_el$17, () => customerLabel(t));
14650
14405
  insert(_el$18, () => formatWhen(t.lastMessageAt));
@@ -14698,7 +14453,7 @@ function Support(props = {}) {
14698
14453
  });
14699
14454
  },
14700
14455
  children: (d) => [(() => {
14701
- var _el$21 = _tmpl$020(), _el$22 = _el$21.firstChild, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$26 = _el$22.nextSibling;
14456
+ var _el$21 = _tmpl$019(), _el$22 = _el$21.firstChild, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$26 = _el$22.nextSibling;
14702
14457
  insert(_el$23, () => d().thread.subject);
14703
14458
  insert(_el$24, () => d().customer?.email ?? "Unknown customer", null);
14704
14459
  insert(_el$24, createComponent(Show, {
@@ -14707,7 +14462,7 @@ function Support(props = {}) {
14707
14462
  },
14708
14463
  get children() {
14709
14464
  return [" \xB7 ", (() => {
14710
- var _el$25 = _tmpl$924();
14465
+ var _el$25 = _tmpl$923();
14711
14466
  _el$25.$$click = () => nav.openCustomer(d().thread.userId);
14712
14467
  return _el$25;
14713
14468
  })()];
@@ -14718,7 +14473,7 @@ function Support(props = {}) {
14718
14473
  return STATUS_FILTERS3.filter((f) => f.value !== "all");
14719
14474
  },
14720
14475
  children: (f) => (() => {
14721
- var _el$36 = _tmpl$1116();
14476
+ var _el$36 = _tmpl$1115();
14722
14477
  _el$36.$$click = () => changeStatus(f.value);
14723
14478
  insert(_el$36, () => f.label);
14724
14479
  effect((_p$) => {
@@ -14735,7 +14490,7 @@ function Support(props = {}) {
14735
14490
  }));
14736
14491
  return _el$21;
14737
14492
  })(), (() => {
14738
- var _el$27 = _tmpl$1101(), _el$28 = _el$27.firstChild;
14493
+ var _el$27 = _tmpl$1100(), _el$28 = _el$27.firstChild;
14739
14494
  var _ref$ = transcriptEnd.setContainer;
14740
14495
  typeof _ref$ === "function" ? use(_ref$, _el$27) : transcriptEnd.setContainer = _el$27;
14741
14496
  insert(_el$27, createComponent(For, {
@@ -14750,7 +14505,7 @@ function Support(props = {}) {
14750
14505
  typeof _ref$2 === "function" ? use(_ref$2, _el$28) : transcriptEnd.setEnd = _el$28;
14751
14506
  return _el$27;
14752
14507
  })(), (() => {
14753
- var _el$29 = _tmpl$1014(), _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling;
14508
+ var _el$29 = _tmpl$1013(), _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$34.nextSibling;
14754
14509
  _el$29.addEventListener("submit", sendReply);
14755
14510
  _el$30.$$keydown = handleReplyKeyDown;
14756
14511
  _el$30.$$input = (e) => setReply(e.currentTarget.value);
@@ -14775,7 +14530,7 @@ function Support(props = {}) {
14775
14530
  return pendingFile();
14776
14531
  },
14777
14532
  children: (f) => (() => {
14778
- var _el$37 = _tmpl$1213(), _el$38 = _el$37.firstChild;
14533
+ var _el$37 = _tmpl$1212(), _el$38 = _el$37.firstChild;
14779
14534
  insert(_el$37, () => f().name, _el$38);
14780
14535
  _el$38.$$click = () => setPendingFile(null);
14781
14536
  return _el$37;
@@ -14802,10 +14557,10 @@ function Support(props = {}) {
14802
14557
  })();
14803
14558
  }
14804
14559
  delegateEvents(["click", "input", "keydown"]);
14805
- var _tmpl$279 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th>Date</th><th>Provider</th><th>Event Type</th><th>Status</th><th style=width:2.5rem></th></tr></thead><tbody>`);
14806
- var _tmpl$280 = /* @__PURE__ */ template(`<div>`);
14807
- var _tmpl$353 = /* @__PURE__ */ template(`<tr class=is-clickable><td data-label=Date class=app-admin-text-muted></td><td data-label=Provider style=font-weight:500></td><td data-label="Event type"class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem></td><td data-label=Status></td><td class=app-admin-text-muted style=font-size:0.75rem><span style="display:inline-block;transition:transform 0.15s">\u25B6`);
14808
- var _tmpl$440 = /* @__PURE__ */ template(`<tr><td colspan=5><pre class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem;background:var(--app-admin-surface-light);border-radius:var(--app-admin-radius-sm);padding:1rem;overflow-x:auto;white-space:pre-wrap;word-break:break-all;margin:0>`);
14560
+ var _tmpl$209 = /* @__PURE__ */ template(`<div class=app-admin-card style=overflow:hidden><table class=app-admin-table><thead><tr><th>Date</th><th>Provider</th><th>Event Type</th><th>Status</th><th style=width:2.5rem></th></tr></thead><tbody>`);
14561
+ var _tmpl$277 = /* @__PURE__ */ template(`<div>`);
14562
+ var _tmpl$351 = /* @__PURE__ */ template(`<tr class=is-clickable><td data-label=Date class=app-admin-text-muted></td><td data-label=Provider style=font-weight:500></td><td data-label="Event type"class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem></td><td data-label=Status></td><td class=app-admin-text-muted style=font-size:0.75rem><span style="display:inline-block;transition:transform 0.15s">\u25B6`);
14563
+ var _tmpl$439 = /* @__PURE__ */ template(`<tr><td colspan=5><pre class="app-admin-text-mono app-admin-text-muted"style=font-size:0.75rem;background:var(--app-admin-surface-light);border-radius:var(--app-admin-radius-sm);padding:1rem;overflow-x:auto;white-space:pre-wrap;word-break:break-all;margin:0>`);
14809
14564
  function Webhooks() {
14810
14565
  const [expanded, setExpanded] = createSignal(null);
14811
14566
  const [webhooks] = createResource(async () => {
@@ -14822,7 +14577,7 @@ function Webhooks() {
14822
14577
  setExpanded((prev) => prev === id ? null : id);
14823
14578
  };
14824
14579
  return (() => {
14825
- var _el$ = _tmpl$280();
14580
+ var _el$ = _tmpl$277();
14826
14581
  insert(_el$, createComponent(PageTitle, {
14827
14582
  children: "Webhook Events"
14828
14583
  }), null);
@@ -14834,13 +14589,13 @@ function Webhooks() {
14834
14589
  return createComponent(LoadingSpinner, {});
14835
14590
  },
14836
14591
  get children() {
14837
- var _el$2 = _tmpl$279(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling; _el$9.nextSibling; var _el$1 = _el$4.nextSibling;
14592
+ var _el$2 = _tmpl$209(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling; _el$9.nextSibling; var _el$1 = _el$4.nextSibling;
14838
14593
  insert(_el$1, createComponent(For, {
14839
14594
  get each() {
14840
14595
  return webhooks() ?? [];
14841
14596
  },
14842
14597
  children: (event) => [(() => {
14843
- var _el$10 = _tmpl$353(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild;
14598
+ var _el$10 = _tmpl$351(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild;
14844
14599
  _el$10.$$click = () => toggleExpand(String(event.id));
14845
14600
  insert(_el$11, () => event.date);
14846
14601
  insert(_el$12, () => event.provider || "Authorize.Net");
@@ -14857,7 +14612,7 @@ function Webhooks() {
14857
14612
  return expanded() === String(event.id);
14858
14613
  },
14859
14614
  get children() {
14860
- var _el$17 = _tmpl$440(), _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild;
14615
+ var _el$17 = _tmpl$439(), _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild;
14861
14616
  insert(_el$19, (() => {
14862
14617
  var _c$ = memo(() => typeof event.payload === "string");
14863
14618
  return () => _c$() ? (() => {
@@ -14889,17 +14644,17 @@ function Webhooks() {
14889
14644
  })();
14890
14645
  }
14891
14646
  delegateEvents(["click"]);
14892
- var _tmpl$281 = /* @__PURE__ */ template(`<div style=display:flex;gap:1.5rem;align-items:flex-start><div class=app-admin-card style=min-width:14rem;max-width:14rem;padding:0.5rem;flex-shrink:0;max-height:70vh;overflow-y:auto;position:sticky;top:1rem>`);
14893
- var _tmpl$286 = /* @__PURE__ */ template(`<div>`);
14894
- var _tmpl$354 = /* @__PURE__ */ template(`<div class=app-admin-empty>No email templates configured.`);
14895
- var _tmpl$441 = /* @__PURE__ */ template(`<div style=margin-bottom:0.25rem><button type=button style="display:flex;align-items:center;justify-content:space-between;width:100%;text-align:left;padding:0.4rem 0.5rem;font-size:0.7rem;font-weight:700;letter-spacing:0.03em;text-transform:uppercase;border:none;background:transparent;color:var(--app-admin-fg-subtle);cursor:pointer"><span></span><span style=font-size:0.65rem>`);
14896
- var _tmpl$536 = /* @__PURE__ */ template(`<button type=button style="display:block;width:100%;text-align:left;padding:0.5rem 0.75rem;font-size:0.8rem;font-weight:500;border:none;border-radius:var(--app-admin-radius-sm);cursor:pointer;transition:color 0.15s, background 0.15s">`);
14897
- var _tmpl$634 = /* @__PURE__ */ template(`<div style="padding:0.75rem 0.875rem;background:var(--app-admin-info-bg);border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm)"><p style=font-size:0.75rem;font-weight:600;margin-bottom:0.5rem>Insert placeholder<span style=font-weight:400;color:var(--app-admin-fg-muted)> &mdash; click a field, then a token</span></p><div style=display:flex;flex-wrap:wrap;gap:0.375rem>`);
14898
- var _tmpl$732 = /* @__PURE__ */ template(`<button type=button style=margin-top:0.5rem;background:none;border:none;color:var(--app-admin-primary-soft-fg);cursor:pointer;font-size:0.8rem;font-weight:500>+ Add Paragraph`);
14899
- var _tmpl$828 = /* @__PURE__ */ template(`<div class=app-admin-card style=padding:1.25rem;flex:1;min-width:0><div style=display:flex;flex-direction:column;gap:1.25rem><div><label class=app-admin-label>Subject</label><input type=text maxlength=200 class=app-admin-input><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/200</p></div><div><label class=app-admin-label>Greeting</label><input type=text class=app-admin-input></div><div><label class=app-admin-label>Body Paragraphs (<!>/10)</label><div style=display:flex;flex-direction:column;gap:0.75rem></div></div><div><label class=app-admin-label>Closing Text</label><textarea maxlength=500 rows=3 class=app-admin-input style=resize:vertical></textarea><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/500</p></div><div style="display:flex;flex-wrap:wrap;gap:0.75rem;padding-top:1rem;border-top:1px solid var(--app-admin-border)"><button type=button class="app-admin-btn app-admin-btn-primary"></button><button type=button class="app-admin-btn app-admin-btn-ghost"></button><button type=button class="app-admin-btn app-admin-btn-ghost">`);
14900
- var _tmpl$925 = /* @__PURE__ */ template(`<button type=button style="font-family:var(--app-admin-font-mono);font-size:0.72rem;background:var(--app-admin-surface);border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm);padding:0.2rem 0.45rem;color:var(--app-admin-fg);cursor:pointer">`);
14901
- var _tmpl$021 = /* @__PURE__ */ template(`<button type=button title="Remove paragraph"style=align-self:flex-start;background:none;border:none;color:var(--app-admin-danger-fg);cursor:pointer;font-size:1.125rem;padding:0.375rem>&times;`);
14902
- var _tmpl$1102 = /* @__PURE__ */ template(`<div style=display:flex;gap:0.5rem><textarea rows=3 class=app-admin-input style=flex:1;resize:vertical>`);
14647
+ var _tmpl$278 = /* @__PURE__ */ template(`<div style=display:flex;gap:1.5rem;align-items:flex-start><div class=app-admin-card style=min-width:14rem;max-width:14rem;padding:0.5rem;flex-shrink:0;max-height:70vh;overflow-y:auto;position:sticky;top:1rem>`);
14648
+ var _tmpl$279 = /* @__PURE__ */ template(`<div>`);
14649
+ var _tmpl$353 = /* @__PURE__ */ template(`<div class=app-admin-empty>No email templates configured.`);
14650
+ var _tmpl$440 = /* @__PURE__ */ template(`<div style=margin-bottom:0.25rem><button type=button style="display:flex;align-items:center;justify-content:space-between;width:100%;text-align:left;padding:0.4rem 0.5rem;font-size:0.7rem;font-weight:700;letter-spacing:0.03em;text-transform:uppercase;border:none;background:transparent;color:var(--app-admin-fg-subtle);cursor:pointer"><span></span><span style=font-size:0.65rem>`);
14651
+ var _tmpl$535 = /* @__PURE__ */ template(`<button type=button style="display:block;width:100%;text-align:left;padding:0.5rem 0.75rem;font-size:0.8rem;font-weight:500;border:none;border-radius:var(--app-admin-radius-sm);cursor:pointer;transition:color 0.15s, background 0.15s">`);
14652
+ var _tmpl$633 = /* @__PURE__ */ template(`<div style="padding:0.75rem 0.875rem;background:var(--app-admin-info-bg);border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm)"><p style=font-size:0.75rem;font-weight:600;margin-bottom:0.5rem>Insert placeholder<span style=font-weight:400;color:var(--app-admin-fg-muted)> &mdash; click a field, then a token</span></p><div style=display:flex;flex-wrap:wrap;gap:0.375rem>`);
14653
+ var _tmpl$731 = /* @__PURE__ */ template(`<button type=button style=margin-top:0.5rem;background:none;border:none;color:var(--app-admin-primary-soft-fg);cursor:pointer;font-size:0.8rem;font-weight:500>+ Add Paragraph`);
14654
+ var _tmpl$827 = /* @__PURE__ */ template(`<div class=app-admin-card style=padding:1.25rem;flex:1;min-width:0><div style=display:flex;flex-direction:column;gap:1.25rem><div><label class=app-admin-label>Subject</label><input type=text maxlength=200 class=app-admin-input><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/200</p></div><div><label class=app-admin-label>Greeting</label><input type=text class=app-admin-input></div><div><label class=app-admin-label>Body Paragraphs (<!>/10)</label><div style=display:flex;flex-direction:column;gap:0.75rem></div></div><div><label class=app-admin-label>Closing Text</label><textarea maxlength=500 rows=3 class=app-admin-input style=resize:vertical></textarea><p style=font-size:0.75rem;color:var(--app-admin-fg-subtle);margin-top:0.25rem>/500</p></div><div style="display:flex;flex-wrap:wrap;gap:0.75rem;padding-top:1rem;border-top:1px solid var(--app-admin-border)"><button type=button class="app-admin-btn app-admin-btn-primary"></button><button type=button class="app-admin-btn app-admin-btn-ghost"></button><button type=button class="app-admin-btn app-admin-btn-ghost">`);
14655
+ var _tmpl$924 = /* @__PURE__ */ template(`<button type=button style="font-family:var(--app-admin-font-mono);font-size:0.72rem;background:var(--app-admin-surface);border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm);padding:0.2rem 0.45rem;color:var(--app-admin-fg);cursor:pointer">`);
14656
+ var _tmpl$020 = /* @__PURE__ */ template(`<button type=button title="Remove paragraph"style=align-self:flex-start;background:none;border:none;color:var(--app-admin-danger-fg);cursor:pointer;font-size:1.125rem;padding:0.375rem>&times;`);
14657
+ var _tmpl$1101 = /* @__PURE__ */ template(`<div style=display:flex;gap:0.5rem><textarea rows=3 class=app-admin-input style=flex:1;resize:vertical>`);
14903
14658
  var CATEGORY_DEFS = [{
14904
14659
  label: "Subscription & Billing",
14905
14660
  keys: ["subscriptionConfirmation", "paymentFailed", "subscriptionSuspended", "subscriptionExpiring", "renewalReminder", "cardExpiring", "pastDueNudge"]
@@ -15101,7 +14856,7 @@ function EmailTemplates() {
15101
14856
  }
15102
14857
  };
15103
14858
  return (() => {
15104
- var _el$ = _tmpl$286();
14859
+ var _el$ = _tmpl$279();
15105
14860
  insert(_el$, createComponent(PageTitle, {
15106
14861
  subtitle: "Customize the transactional emails sent to your customers.",
15107
14862
  children: "Email Templates"
@@ -15119,16 +14874,16 @@ function EmailTemplates() {
15119
14874
  return templateKeys().length > 0;
15120
14875
  },
15121
14876
  get fallback() {
15122
- return _tmpl$354();
14877
+ return _tmpl$353();
15123
14878
  },
15124
14879
  get children() {
15125
- var _el$2 = _tmpl$281(), _el$3 = _el$2.firstChild;
14880
+ var _el$2 = _tmpl$278(), _el$3 = _el$2.firstChild;
15126
14881
  insert(_el$3, createComponent(For, {
15127
14882
  get each() {
15128
14883
  return categorizedKeys();
15129
14884
  },
15130
14885
  children: (group) => (() => {
15131
- var _el$5 = _tmpl$441(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
14886
+ var _el$5 = _tmpl$440(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
15132
14887
  _el$6.$$click = () => toggleCategory(group.label);
15133
14888
  insert(_el$7, () => group.label);
15134
14889
  insert(_el$8, () => collapsed()[group.label] ? "\u25B8" : "\u25BE");
@@ -15142,7 +14897,7 @@ function EmailTemplates() {
15142
14897
  return group.keys;
15143
14898
  },
15144
14899
  children: (key) => (() => {
15145
- var _el$9 = _tmpl$536();
14900
+ var _el$9 = _tmpl$535();
15146
14901
  _el$9.$$click = () => handleTabSwitch(key);
15147
14902
  insert(_el$9, () => humanize(key));
15148
14903
  effect((_p$) => {
@@ -15167,19 +14922,19 @@ function EmailTemplates() {
15167
14922
  return currentDraft();
15168
14923
  },
15169
14924
  children: (cur) => (() => {
15170
- var _el$0 = _tmpl$828(), _el$1 = _el$0.firstChild, _el$15 = _el$1.firstChild, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$17.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$15.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$20.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$27 = _el$25.nextSibling; _el$27.nextSibling; var _el$28 = _el$24.nextSibling, _el$30 = _el$23.nextSibling, _el$31 = _el$30.firstChild, _el$32 = _el$31.nextSibling, _el$33 = _el$32.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$30.nextSibling, _el$36 = _el$35.firstChild, _el$37 = _el$36.nextSibling, _el$38 = _el$37.nextSibling;
14925
+ var _el$0 = _tmpl$827(), _el$1 = _el$0.firstChild, _el$15 = _el$1.firstChild, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$17.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$15.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$20.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$27 = _el$25.nextSibling; _el$27.nextSibling; var _el$28 = _el$24.nextSibling, _el$30 = _el$23.nextSibling, _el$31 = _el$30.firstChild, _el$32 = _el$31.nextSibling, _el$33 = _el$32.nextSibling, _el$34 = _el$33.firstChild, _el$35 = _el$30.nextSibling, _el$36 = _el$35.firstChild, _el$37 = _el$36.nextSibling, _el$38 = _el$37.nextSibling;
15171
14926
  insert(_el$1, createComponent(Show, {
15172
14927
  get when() {
15173
14928
  return activePlaceholders().length > 0;
15174
14929
  },
15175
14930
  get children() {
15176
- var _el$10 = _tmpl$634(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild; _el$12.nextSibling; var _el$14 = _el$11.nextSibling;
14931
+ var _el$10 = _tmpl$633(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild; _el$12.nextSibling; var _el$14 = _el$11.nextSibling;
15177
14932
  insert(_el$14, createComponent(For, {
15178
14933
  get each() {
15179
14934
  return activePlaceholders();
15180
14935
  },
15181
14936
  children: (p) => (() => {
15182
- var _el$39 = _tmpl$925();
14937
+ var _el$39 = _tmpl$924();
15183
14938
  _el$39.$$click = () => insertToken(p.token);
15184
14939
  _el$39.$$mousedown = (e) => e.preventDefault();
15185
14940
  insert(_el$39, () => p.token);
@@ -15207,7 +14962,7 @@ function EmailTemplates() {
15207
14962
  return cur().bodyParagraphs;
15208
14963
  },
15209
14964
  children: (para, i) => (() => {
15210
- var _el$40 = _tmpl$1102(), _el$41 = _el$40.firstChild;
14965
+ var _el$40 = _tmpl$1101(), _el$41 = _el$40.firstChild;
15211
14966
  _el$41.$$input = (e) => updateParagraph(i, e.currentTarget.value);
15212
14967
  _el$41.addEventListener("focus", (e) => setLastFocused({
15213
14968
  field: "paragraph",
@@ -15219,7 +14974,7 @@ function EmailTemplates() {
15219
14974
  return cur().bodyParagraphs.length > 1;
15220
14975
  },
15221
14976
  get children() {
15222
- var _el$42 = _tmpl$021();
14977
+ var _el$42 = _tmpl$020();
15223
14978
  _el$42.$$click = () => removeParagraph(i);
15224
14979
  return _el$42;
15225
14980
  }
@@ -15233,7 +14988,7 @@ function EmailTemplates() {
15233
14988
  return cur().bodyParagraphs.length < 10;
15234
14989
  },
15235
14990
  get children() {
15236
- var _el$29 = _tmpl$732();
14991
+ var _el$29 = _tmpl$731();
15237
14992
  _el$29.$$click = addParagraph;
15238
14993
  return _el$29;
15239
14994
  }
@@ -15276,26 +15031,26 @@ function EmailTemplates() {
15276
15031
  })();
15277
15032
  }
15278
15033
  delegateEvents(["click", "input", "mousedown"]);
15279
- var _tmpl$287 = /* @__PURE__ */ template(`<div class=app-admin-card style="padding:1rem 1.25rem"><p style=font-size:0.8125rem;color:var(--app-admin-fg-muted);margin:0></p><p style="font-size:1.5rem;font-weight:600;margin:0.25rem 0 0">`);
15280
- var _tmpl$288 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
15281
- var _tmpl$355 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft)"><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0>`);
15282
- var _tmpl$442 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem>`);
15283
- var _tmpl$537 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-danger-fg);font-size:0.8125rem;margin:0>`);
15284
- var _tmpl$635 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-success-fg);font-size:0.8125rem;margin:0>`);
15285
- var _tmpl$733 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;display:grid;gap:0.875rem;max-width:34rem"><label style=display:flex;align-items:center;gap:0.625rem;cursor:pointer><input type=checkbox><span>Send recovery emails</span></label><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>Completed-survey reminders \u2014 hours after the survey was submitted (comma-separated)</span><input class=app-admin-input type=text placeholder="24, 72"></label><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>Mid-survey reminders \u2014 hours after last activity (comma-separated)</span><input class=app-admin-input type=text placeholder="4, 48"></label><div><button type=button class="app-admin-btn app-admin-btn--primary">`);
15286
- var _tmpl$829 = /* @__PURE__ */ template(`<div><div style=margin-bottom:1rem><select class=app-admin-input style=width:auto><option value=7>Last 7 days</option><option value=30>Last 30 days</option><option value=90>Last 90 days</option></select></div><div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Last seen</th><th>Progress</th><th>Email</th><th>Reminders</th></tr></thead><tbody></tbody></table></div><div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Captured</th><th>Name</th><th>Email</th><th>Qualified</th><th>Reminders</th></tr></thead><tbody>`);
15287
- var _tmpl$926 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(10rem, 1fr));gap:0.75rem">`);
15288
- var _tmpl$022 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style="padding:1rem 1.25rem;display:grid;gap:0.625rem">`);
15289
- var _tmpl$1103 = /* @__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>`);
15290
- var _tmpl$1015 = /* @__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>`);
15291
- var _tmpl$1117 = /* @__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>`);
15292
- var _tmpl$1214 = /* @__PURE__ */ template(`<span style=font-size:0.6875rem;color:var(--app-admin-fg-muted)>`);
15293
- var _tmpl$1313 = /* @__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)>`);
15034
+ var _tmpl$280 = /* @__PURE__ */ template(`<div class=app-admin-card style="padding:1rem 1.25rem"><p style=font-size:0.8125rem;color:var(--app-admin-fg-muted);margin:0></p><p style="font-size:1.5rem;font-weight:600;margin:0.25rem 0 0">`);
15035
+ var _tmpl$281 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
15036
+ var _tmpl$354 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;border-bottom:1px solid var(--app-admin-border-soft)"><h2 class=app-admin-heading style=font-size:0.9375rem;font-weight:600;margin:0>`);
15037
+ var _tmpl$441 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem>`);
15038
+ var _tmpl$536 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-danger-fg);font-size:0.8125rem;margin:0>`);
15039
+ var _tmpl$634 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-success-fg);font-size:0.8125rem;margin:0>`);
15040
+ var _tmpl$732 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;display:grid;gap:0.875rem;max-width:34rem"><label style=display:flex;align-items:center;gap:0.625rem;cursor:pointer><input type=checkbox><span>Send recovery emails</span></label><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>Completed-survey reminders \u2014 hours after the survey was submitted (comma-separated)</span><input class=app-admin-input type=text placeholder="24, 72"></label><label style=display:grid;gap:0.25rem><span style=font-size:0.8125rem;color:var(--app-admin-fg-muted)>Mid-survey reminders \u2014 hours after last activity (comma-separated)</span><input class=app-admin-input type=text placeholder="4, 48"></label><div><button type=button class="app-admin-btn app-admin-btn--primary">`);
15041
+ var _tmpl$828 = /* @__PURE__ */ template(`<div><div style=margin-bottom:1rem><select class=app-admin-input style=width:auto><option value=7>Last 7 days</option><option value=30>Last 30 days</option><option value=90>Last 90 days</option></select></div><div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Last seen</th><th>Progress</th><th>Email</th><th>Reminders</th></tr></thead><tbody></tbody></table></div><div class=app-admin-card style=margin-top:1.25rem;overflow:hidden><table class=app-admin-table><thead><tr><th>Captured</th><th>Name</th><th>Email</th><th>Qualified</th><th>Reminders</th></tr></thead><tbody>`);
15042
+ var _tmpl$925 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(10rem, 1fr));gap:0.75rem">`);
15043
+ var _tmpl$021 = /* @__PURE__ */ template(`<div class=app-admin-card style=margin-top:1.25rem><div style="padding:1rem 1.25rem;display:grid;gap:0.625rem">`);
15044
+ var _tmpl$1102 = /* @__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>`);
15045
+ var _tmpl$1014 = /* @__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>`);
15046
+ var _tmpl$1116 = /* @__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>`);
15047
+ var _tmpl$1213 = /* @__PURE__ */ template(`<span style=font-size:0.6875rem;color:var(--app-admin-fg-muted)>`);
15048
+ var _tmpl$1312 = /* @__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)>`);
15294
15049
  var _tmpl$1412 = /* @__PURE__ */ template(`<tr><td colspan=4>`);
15295
15050
  var _tmpl$1512 = /* @__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>`);
15296
15051
  var _tmpl$1612 = /* @__PURE__ */ template(`<span class=app-admin-text-muted>not captured`);
15297
15052
  var _tmpl$1712 = /* @__PURE__ */ template(`<tr><td colspan=5>`);
15298
- var _tmpl$1812 = /* @__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>`);
15053
+ var _tmpl$1811 = /* @__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>`);
15299
15054
  function pct(n, d) {
15300
15055
  if (!d) return "\u2014";
15301
15056
  return `${Math.round(n / d * 100)}%`;
@@ -15314,7 +15069,7 @@ function formatDate(dateStr) {
15314
15069
  }
15315
15070
  function StatCard(props) {
15316
15071
  return (() => {
15317
- var _el$ = _tmpl$287(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
15072
+ var _el$ = _tmpl$280(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
15318
15073
  insert(_el$2, () => props.label);
15319
15074
  insert(_el$3, () => props.value);
15320
15075
  return _el$;
@@ -15322,14 +15077,14 @@ function StatCard(props) {
15322
15077
  }
15323
15078
  function CardHeader(props) {
15324
15079
  return (() => {
15325
- var _el$4 = _tmpl$355(), _el$5 = _el$4.firstChild;
15080
+ var _el$4 = _tmpl$354(), _el$5 = _el$4.firstChild;
15326
15081
  insert(_el$5, () => props.title);
15327
15082
  insert(_el$4, createComponent(Show, {
15328
15083
  get when() {
15329
15084
  return props.note;
15330
15085
  },
15331
15086
  get children() {
15332
- var _el$6 = _tmpl$288();
15087
+ var _el$6 = _tmpl$281();
15333
15088
  insert(_el$6, () => props.note);
15334
15089
  return _el$6;
15335
15090
  }
@@ -15393,7 +15148,7 @@ function RecoverySettingsCard() {
15393
15148
  }
15394
15149
  };
15395
15150
  return (() => {
15396
- var _el$7 = _tmpl$442();
15151
+ var _el$7 = _tmpl$441();
15397
15152
  insert(_el$7, createComponent(CardHeader, {
15398
15153
  title: "Recovery email settings"
15399
15154
  }), null);
@@ -15415,7 +15170,7 @@ function RecoverySettingsCard() {
15415
15170
  return createComponent(LoadingSpinner, {});
15416
15171
  },
15417
15172
  children: (s) => (() => {
15418
- var _el$8 = _tmpl$733(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$9.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling, _el$12 = _el$1.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$17 = _el$12.nextSibling, _el$18 = _el$17.firstChild;
15173
+ var _el$8 = _tmpl$732(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$9.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling, _el$12 = _el$1.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$17 = _el$12.nextSibling, _el$18 = _el$17.firstChild;
15419
15174
  _el$0.addEventListener("change", (e) => setSettings({
15420
15175
  ...s(),
15421
15176
  enabled: e.currentTarget.checked
@@ -15427,7 +15182,7 @@ function RecoverySettingsCard() {
15427
15182
  return error();
15428
15183
  },
15429
15184
  get children() {
15430
- var _el$15 = _tmpl$537();
15185
+ var _el$15 = _tmpl$536();
15431
15186
  insert(_el$15, error);
15432
15187
  return _el$15;
15433
15188
  }
@@ -15437,7 +15192,7 @@ function RecoverySettingsCard() {
15437
15192
  return status();
15438
15193
  },
15439
15194
  get children() {
15440
- var _el$16 = _tmpl$635();
15195
+ var _el$16 = _tmpl$634();
15441
15196
  insert(_el$16, status);
15442
15197
  return _el$16;
15443
15198
  }
@@ -15482,7 +15237,7 @@ function Funnel() {
15482
15237
  const dropoffMax = () => Math.max(1, ...(summary()?.stepDropoff ?? []).map((b) => b.count));
15483
15238
  const totalRecovered = () => (summary()?.recovery.captureRecovered ?? 0) + (summary()?.recovery.sessionRecovered ?? 0);
15484
15239
  return (() => {
15485
- var _el$19 = _tmpl$829(), _el$20 = _el$19.firstChild, _el$21 = _el$20.firstChild, _el$22 = _el$20.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$22.nextSibling, _el$27 = _el$26.firstChild, _el$28 = _el$27.firstChild, _el$29 = _el$28.nextSibling;
15240
+ var _el$19 = _tmpl$828(), _el$20 = _el$19.firstChild, _el$21 = _el$20.firstChild, _el$22 = _el$20.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$22.nextSibling, _el$27 = _el$26.firstChild, _el$28 = _el$27.firstChild, _el$29 = _el$28.nextSibling;
15486
15241
  insert(_el$19, createComponent(PageTitle, {
15487
15242
  subtitle: "Survey drop-off and abandoned-checkout recovery",
15488
15243
  children: "Funnel"
@@ -15496,7 +15251,7 @@ function Funnel() {
15496
15251
  return createComponent(LoadingSpinner, {});
15497
15252
  },
15498
15253
  children: (s) => [(() => {
15499
- var _el$30 = _tmpl$926();
15254
+ var _el$30 = _tmpl$925();
15500
15255
  insert(_el$30, createComponent(StatCard, {
15501
15256
  label: "Surveys Started",
15502
15257
  get value() {
@@ -15529,7 +15284,7 @@ function Funnel() {
15529
15284
  }), null);
15530
15285
  return _el$30;
15531
15286
  })(), (() => {
15532
- var _el$31 = _tmpl$022(), _el$32 = _el$31.firstChild;
15287
+ var _el$31 = _tmpl$021(), _el$32 = _el$31.firstChild;
15533
15288
  insert(_el$31, createComponent(CardHeader, {
15534
15289
  title: "Funnel stages"
15535
15290
  }), _el$32);
@@ -15538,7 +15293,7 @@ function Funnel() {
15538
15293
  return stages();
15539
15294
  },
15540
15295
  children: (stage, i) => (() => {
15541
- var _el$50 = _tmpl$1117(), _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling, _el$53 = _el$52.firstChild, _el$54 = _el$52.nextSibling, _el$55 = _el$54.firstChild;
15296
+ var _el$50 = _tmpl$1116(), _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling, _el$53 = _el$52.firstChild, _el$54 = _el$52.nextSibling, _el$55 = _el$54.firstChild;
15542
15297
  insert(_el$51, () => stage.label);
15543
15298
  insert(_el$54, () => stage.value, _el$55);
15544
15299
  insert(_el$55, (() => {
@@ -15561,7 +15316,7 @@ function Funnel() {
15561
15316
  }));
15562
15317
  return _el$31;
15563
15318
  })(), (() => {
15564
- var _el$33 = _tmpl$1103(), _el$34 = _el$33.firstChild;
15319
+ var _el$33 = _tmpl$1102(), _el$34 = _el$33.firstChild;
15565
15320
  insert(_el$33, createComponent(CardHeader, {
15566
15321
  title: "Where abandons quit",
15567
15322
  get note() {
@@ -15573,13 +15328,13 @@ function Funnel() {
15573
15328
  return s().stepDropoff;
15574
15329
  },
15575
15330
  children: (b) => (() => {
15576
- var _el$56 = _tmpl$1313(), _el$58 = _el$56.firstChild, _el$59 = _el$58.nextSibling;
15331
+ var _el$56 = _tmpl$1312(), _el$58 = _el$56.firstChild, _el$59 = _el$58.nextSibling;
15577
15332
  insert(_el$56, createComponent(Show, {
15578
15333
  get when() {
15579
15334
  return b.count > 0;
15580
15335
  },
15581
15336
  get children() {
15582
- var _el$57 = _tmpl$1214();
15337
+ var _el$57 = _tmpl$1213();
15583
15338
  insert(_el$57, () => b.count);
15584
15339
  return _el$57;
15585
15340
  }
@@ -15604,7 +15359,7 @@ function Funnel() {
15604
15359
  }));
15605
15360
  return _el$33;
15606
15361
  })(), (() => {
15607
- var _el$35 = _tmpl$1015(), _el$36 = _el$35.firstChild, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$38.firstChild, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling, _el$42 = _el$41.nextSibling, _el$43 = _el$39.nextSibling, _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling, _el$46 = _el$45.nextSibling, _el$47 = _el$43.nextSibling, _el$48 = _el$47.firstChild, _el$49 = _el$48.nextSibling;
15362
+ var _el$35 = _tmpl$1014(), _el$36 = _el$35.firstChild, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$38.firstChild, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling, _el$42 = _el$41.nextSibling, _el$43 = _el$39.nextSibling, _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling, _el$46 = _el$45.nextSibling, _el$47 = _el$43.nextSibling, _el$48 = _el$47.firstChild, _el$49 = _el$48.nextSibling;
15608
15363
  insert(_el$35, createComponent(CardHeader, {
15609
15364
  title: "Recovery emails"
15610
15365
  }), _el$36);
@@ -15674,7 +15429,7 @@ function Funnel() {
15674
15429
  return leads()?.captures;
15675
15430
  },
15676
15431
  children: (c) => (() => {
15677
- var _el$70 = _tmpl$1812(), _el$71 = _el$70.firstChild, _el$72 = _el$71.nextSibling, _el$73 = _el$72.nextSibling, _el$74 = _el$73.nextSibling, _el$75 = _el$74.nextSibling;
15432
+ var _el$70 = _tmpl$1811(), _el$71 = _el$70.firstChild, _el$72 = _el$71.nextSibling, _el$73 = _el$72.nextSibling, _el$74 = _el$73.nextSibling, _el$75 = _el$74.nextSibling;
15678
15433
  insert(_el$71, () => formatDate(c.captured_at));
15679
15434
  insert(_el$72, () => c.patient_name ?? "\u2014");
15680
15435
  insert(_el$73, () => c.email ?? "\u2014");
@@ -15692,12 +15447,12 @@ function Funnel() {
15692
15447
  delegateEvents(["input", "click"]);
15693
15448
 
15694
15449
  // src/pages/AdminDashboard.tsx
15695
- var _tmpl$289 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
15696
- var _tmpl$290 = /* @__PURE__ */ template(`<button type=button style="display:flex;align-items:center;gap:0.75rem;padding:0.625rem 0.75rem;border-radius:var(--app-admin-radius-sm);font-size:0.875rem;font-weight:500;text-align:left;border:none;cursor:pointer">`);
15697
- var _tmpl$356 = /* @__PURE__ */ template(`<div class="app-admin-root app-admin-shell"style=position:sticky><div class=app-admin-shell-header><button type=button class=app-admin-shell-menu-trigger aria-label="Open admin menu"><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=18 x2=21 y2=18></line></svg></button><span class=app-admin-shell-header-title></span></div><div class=app-admin-backdrop aria-hidden=true></div><aside class=app-admin-sidebar><div style=padding:1.25rem><h2 style="font-size:0.7rem;font-weight:500;color:var(--app-admin-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 1rem">Admin Panel</h2><nav style=display:flex;flex-direction:column;gap:0.25rem></nav></div></aside><div class=app-admin-content>`);
15698
- var _tmpl$443 = /* @__PURE__ */ template(`<h3 style="font-size:0.625rem;font-weight:600;color:var(--app-admin-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:1rem 0 0.375rem;padding:0 0.75rem">`);
15699
- var _tmpl$538 = /* @__PURE__ */ template(`<div role=alert style="margin:1rem 0;padding:1.25rem 1.5rem;border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm);background:var(--app-admin-surface);color:var(--app-admin-fg)"><div style=font-weight:600;margin-bottom:0.375rem>This section failed to load</div><div style=font-size:0.875rem;color:var(--app-admin-fg-muted);margin-bottom:1rem;word-break:break-word></div><button type=button style="padding:0.5rem 0.875rem;border-radius:var(--app-admin-radius-sm);border:1px solid var(--app-admin-border);background:var(--app-admin-primary-soft);color:var(--app-admin-primary-soft-fg);font-size:0.875rem;font-weight:500;cursor:pointer">Try again`);
15700
- var _tmpl$636 = /* @__PURE__ */ template(`<div class=app-admin-root style=display:flex;align-items:center;justify-content:center;position:sticky;background:var(--app-admin-bg)><div role=status aria-label="Loading admin"style="width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--app-admin-border);border-top-color:var(--app-admin-primary);animation:app-admin-gate-spin 0.8s linear infinite"></div><style>@keyframes app-admin-gate-spin { to { transform: rotate(360deg); } }`);
15450
+ var _tmpl$286 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
15451
+ var _tmpl$287 = /* @__PURE__ */ template(`<button type=button style="display:flex;align-items:center;gap:0.75rem;padding:0.625rem 0.75rem;border-radius:var(--app-admin-radius-sm);font-size:0.875rem;font-weight:500;text-align:left;border:none;cursor:pointer">`);
15452
+ var _tmpl$355 = /* @__PURE__ */ template(`<div class="app-admin-root app-admin-shell"style=position:sticky><div class=app-admin-shell-header><button type=button class=app-admin-shell-menu-trigger aria-label="Open admin menu"><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=18 x2=21 y2=18></line></svg></button><span class=app-admin-shell-header-title></span></div><div class=app-admin-backdrop aria-hidden=true></div><aside class=app-admin-sidebar><div style=padding:1.25rem><h2 style="font-size:0.7rem;font-weight:500;color:var(--app-admin-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 1rem">Admin Panel</h2><nav style=display:flex;flex-direction:column;gap:0.25rem></nav></div></aside><div class=app-admin-content>`);
15453
+ var _tmpl$442 = /* @__PURE__ */ template(`<h3 style="font-size:0.625rem;font-weight:600;color:var(--app-admin-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:1rem 0 0.375rem;padding:0 0.75rem">`);
15454
+ var _tmpl$537 = /* @__PURE__ */ template(`<div role=alert style="margin:1rem 0;padding:1.25rem 1.5rem;border:1px solid var(--app-admin-border);border-radius:var(--app-admin-radius-sm);background:var(--app-admin-surface);color:var(--app-admin-fg)"><div style=font-weight:600;margin-bottom:0.375rem>This section failed to load</div><div style=font-size:0.875rem;color:var(--app-admin-fg-muted);margin-bottom:1rem;word-break:break-word></div><button type=button style="padding:0.5rem 0.875rem;border-radius:var(--app-admin-radius-sm);border:1px solid var(--app-admin-border);background:var(--app-admin-primary-soft);color:var(--app-admin-primary-soft-fg);font-size:0.875rem;font-weight:500;cursor:pointer">Try again`);
15455
+ var _tmpl$635 = /* @__PURE__ */ template(`<div class=app-admin-root style=display:flex;align-items:center;justify-content:center;position:sticky;background:var(--app-admin-bg)><div role=status aria-label="Loading admin"style="width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--app-admin-border);border-top-color:var(--app-admin-primary);animation:app-admin-gate-spin 0.8s linear infinite"></div><style>@keyframes app-admin-gate-spin { to { transform: rotate(360deg); } }`);
15701
15456
  var TAB_LABELS = {
15702
15457
  dashboard: "Dashboard",
15703
15458
  customers: "Customers",
@@ -15796,14 +15551,14 @@ function AdminDashboard(props) {
15796
15551
  };
15797
15552
  const topOffset = () => props.topOffset ?? "0px";
15798
15553
  const TabButton = (btnProps) => (() => {
15799
- var _el$ = _tmpl$290();
15554
+ var _el$ = _tmpl$287();
15800
15555
  _el$.$$click = () => handleTabClick(btnProps.tab);
15801
15556
  insert(_el$, createComponent(Show, {
15802
15557
  get when() {
15803
15558
  return props.tabIcons?.[btnProps.tab];
15804
15559
  },
15805
15560
  get children() {
15806
- var _el$2 = _tmpl$289();
15561
+ var _el$2 = _tmpl$286();
15807
15562
  effect(() => className(_el$2, props.tabIcons[btnProps.tab]));
15808
15563
  return _el$2;
15809
15564
  }
@@ -15835,7 +15590,7 @@ function AdminDashboard(props) {
15835
15590
  return createComponent(AdminNavContext.Provider, {
15836
15591
  value: adminNav,
15837
15592
  get children() {
15838
- var _el$3 = _tmpl$356(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$8.nextSibling;
15593
+ var _el$3 = _tmpl$355(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$8.nextSibling;
15839
15594
  _el$5.$$click = () => setDrawerOpen(true);
15840
15595
  insert(_el$6, () => TAB_LABELS[currentTab()]);
15841
15596
  _el$7.$$click = () => setDrawerOpen(false);
@@ -15852,7 +15607,7 @@ function AdminDashboard(props) {
15852
15607
  return visibleGroups();
15853
15608
  },
15854
15609
  children: (group) => [(() => {
15855
- var _el$11 = _tmpl$443();
15610
+ var _el$11 = _tmpl$442();
15856
15611
  insert(_el$11, () => group.label);
15857
15612
  return _el$11;
15858
15613
  })(), createComponent(For, {
@@ -16046,7 +15801,7 @@ function AdminTabError(props) {
16046
15801
  console.error("[AdminDashboard] tab failed to render:", props.error);
16047
15802
  const message = () => props.error instanceof Error ? props.error.message : String(props.error);
16048
15803
  return (() => {
16049
- var _el$12 = _tmpl$538(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling;
15804
+ var _el$12 = _tmpl$537(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.nextSibling;
16050
15805
  insert(_el$14, message);
16051
15806
  _el$15.$$click = () => props.reset();
16052
15807
  return _el$12;
@@ -16054,7 +15809,7 @@ function AdminTabError(props) {
16054
15809
  }
16055
15810
  function AdminGateSpinner(props) {
16056
15811
  return (() => {
16057
- var _el$16 = _tmpl$636(); _el$16.firstChild;
15812
+ var _el$16 = _tmpl$635(); _el$16.firstChild;
16058
15813
  effect((_p$) => {
16059
15814
  var _v$8 = props.topOffset, _v$9 = `calc(100vh - ${props.topOffset})`;
16060
15815
  _v$8 !== _p$.e && setStyleProperty(_el$16, "top", _p$.e = _v$8);
@@ -16068,8 +15823,222 @@ function AdminGateSpinner(props) {
16068
15823
  })();
16069
15824
  }
16070
15825
  delegateEvents(["click"]);
16071
- var _tmpl$291 = /* @__PURE__ */ template(`<div style=margin-bottom:1rem>`);
16072
- var _tmpl$295 = /* @__PURE__ */ template(`<form><div style=display:grid;gap:1rem;margin-bottom:1.5rem><div style="display:grid;grid-template-columns:repeat(2, 1fr);gap:1rem"></div></div><div style=margin-bottom:1.5rem></div><div style=display:flex;gap:0.75rem>`);
15826
+ var _tmpl$288 = /* @__PURE__ */ template(`<div class=app-admin-modal-backdrop><div class="app-admin-card app-admin-modal"style=max-width:32rem><div class=app-admin-modal-header><h3 class=app-admin-heading style=font-size:1rem;margin:0>Customer dashboard preview</h3><button type=button class="app-admin-btn app-admin-btn-ghost"style="border:none;padding:0.25rem 0.5rem;font-size:1.25rem">\xD7</button></div><div class=app-admin-modal-body><div style="padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);background:var(--app-admin-warning-bg);color:var(--app-admin-warning-fg);font-size:0.75rem;font-weight:500">Viewing as <!> \u2014 read-only`);
15827
+ var _tmpl$289 = /* @__PURE__ */ template(`<div style="display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--app-admin-radius-sm);background:var(--app-admin-danger-bg);color:var(--app-admin-danger-fg);font-size:0.75rem;font-weight:500"><span></span><button type=button class="app-admin-btn app-admin-btn-ghost"style="padding:0.25rem 0.75rem">Retry`);
15828
+ var _tmpl$356 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>Could not load this customer's dashboard.`);
15829
+ var _tmpl$443 = /* @__PURE__ */ template(`<div><h3>Profile</h3><div class=app-admin-card-soft style=padding:0.75rem><p style=font-weight:600;font-size:0.9375rem;margin:0></p><p style="font-size:0.8125rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
15830
+ var _tmpl$538 = /* @__PURE__ */ template(`<div><h3>Subscription`);
15831
+ var _tmpl$636 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:0.5rem>`);
15832
+ var _tmpl$733 = /* @__PURE__ */ template(`<div><h3>Prescription requests`);
15833
+ var _tmpl$829 = /* @__PURE__ */ template(`<div><h3>Pending surveys`);
15834
+ var _tmpl$926 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No active subscription.`);
15835
+ var _tmpl$022 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">Next charge `);
15836
+ var _tmpl$1103 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><span style=font-size:0.875rem;font-weight:500>`);
15837
+ var _tmpl$1015 = /* @__PURE__ */ template(`<p style="font-size:0.75rem;color:var(--app-admin-fg-muted);margin:0.25rem 0 0">`);
15838
+ var _tmpl$1117 = /* @__PURE__ */ template(`<div><h3>Prescription status</h3><div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><span style=font-size:0.875rem;font-weight:500>Current request`);
15839
+ var _tmpl$1214 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No prescription requests.`);
15840
+ var _tmpl$1313 = /* @__PURE__ */ template(`<span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>`);
15841
+ var _tmpl$1413 = /* @__PURE__ */ template(`<span> \xB7 `);
15842
+ var _tmpl$1513 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><div style=display:flex;align-items:center;justify-content:space-between><div><span style=font-size:0.875rem;font-weight:500></span></div></div><div style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-top:0.25rem>`);
15843
+ var _tmpl$1613 = /* @__PURE__ */ template(`<p style=color:var(--app-admin-fg-muted);font-size:0.875rem>No pending surveys.`);
15844
+ var _tmpl$1713 = /* @__PURE__ */ template(`<div class=app-admin-card-soft style=padding:0.75rem><span style=font-size:0.875rem;font-weight:500></span><span style=font-size:0.75rem;color:var(--app-admin-fg-muted);margin-left:0.5rem>Cycle `);
15845
+ function PatientDashboardPreview(props) {
15846
+ const data = useDashboardData({
15847
+ authToken: () => props.token
15848
+ });
15849
+ return (() => {
15850
+ var _el$ = _tmpl$288(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$3.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$0 = _el$8.nextSibling; _el$0.nextSibling;
15851
+ _el$.$$click = (e) => {
15852
+ if (e.target === e.currentTarget) props.onClose();
15853
+ };
15854
+ addEventListener(_el$5, "click", props.onClose, true);
15855
+ insert(_el$7, () => props.customerName || "customer", _el$0);
15856
+ insert(_el$6, createComponent(Show, {
15857
+ get when() {
15858
+ return data.error();
15859
+ },
15860
+ keyed: true,
15861
+ children: (msg) => (() => {
15862
+ var _el$1 = _tmpl$289(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
15863
+ insert(_el$10, msg);
15864
+ _el$11.$$click = () => data.retry();
15865
+ return _el$1;
15866
+ })()
15867
+ }), null);
15868
+ insert(_el$6, createComponent(Show, {
15869
+ get when() {
15870
+ return !data.profile.loading;
15871
+ },
15872
+ get fallback() {
15873
+ return createComponent(LoadingSpinner, {});
15874
+ },
15875
+ get children() {
15876
+ return createComponent(Show, {
15877
+ get when() {
15878
+ return data.profile();
15879
+ },
15880
+ get fallback() {
15881
+ return _tmpl$356();
15882
+ },
15883
+ children: (profile) => [(() => {
15884
+ var _el$13 = _tmpl$443(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling;
15885
+ insert(_el$16, () => [profile().firstName, profile().lastName].filter(Boolean).join(" ") || "Member");
15886
+ insert(_el$17, () => profile().email);
15887
+ effect((_$p) => style(_el$14, panelSectionHeader, _$p));
15888
+ return _el$13;
15889
+ })(), (() => {
15890
+ var _el$18 = _tmpl$538(), _el$19 = _el$18.firstChild;
15891
+ insert(_el$18, createComponent(Show, {
15892
+ get when() {
15893
+ return data.subscription();
15894
+ },
15895
+ get fallback() {
15896
+ return _tmpl$926();
15897
+ },
15898
+ children: (sub) => (() => {
15899
+ var _el$27 = _tmpl$1103(), _el$28 = _el$27.firstChild, _el$29 = _el$28.firstChild;
15900
+ insert(_el$29, createComponent(Show, {
15901
+ get when() {
15902
+ return sub().amount != null;
15903
+ },
15904
+ fallback: "Subscription",
15905
+ get children() {
15906
+ return [memo(() => centsToUsd(sub().amount)), "/mo"];
15907
+ }
15908
+ }));
15909
+ insert(_el$28, createComponent(StatusBadge, {
15910
+ get status() {
15911
+ return sub().status;
15912
+ }
15913
+ }), null);
15914
+ insert(_el$27, createComponent(Show, {
15915
+ get when() {
15916
+ return sub().nextBillingDate;
15917
+ },
15918
+ get children() {
15919
+ var _el$30 = _tmpl$022(); _el$30.firstChild;
15920
+ insert(_el$30, () => fmtDate(sub().nextBillingDate), null);
15921
+ return _el$30;
15922
+ }
15923
+ }), null);
15924
+ return _el$27;
15925
+ })()
15926
+ }), null);
15927
+ effect((_$p) => style(_el$19, panelSectionHeader, _$p));
15928
+ return _el$18;
15929
+ })(), createComponent(Show, {
15930
+ get when() {
15931
+ return data.rxStatus();
15932
+ },
15933
+ children: (rx) => (() => {
15934
+ var _el$32 = _tmpl$1117(), _el$33 = _el$32.firstChild, _el$34 = _el$33.nextSibling, _el$35 = _el$34.firstChild; _el$35.firstChild;
15935
+ insert(_el$35, createComponent(StatusBadge, {
15936
+ get status() {
15937
+ return rx().status;
15938
+ }
15939
+ }), null);
15940
+ insert(_el$34, createComponent(Show, {
15941
+ get when() {
15942
+ return rx().reason;
15943
+ },
15944
+ get children() {
15945
+ var _el$37 = _tmpl$1015();
15946
+ insert(_el$37, () => rx().reason);
15947
+ return _el$37;
15948
+ }
15949
+ }), null);
15950
+ effect((_$p) => style(_el$33, panelSectionHeader, _$p));
15951
+ return _el$32;
15952
+ })()
15953
+ }), (() => {
15954
+ var _el$20 = _tmpl$733(), _el$21 = _el$20.firstChild;
15955
+ insert(_el$20, createComponent(Show, {
15956
+ get when() {
15957
+ return (data.rxList() ?? []).length > 0;
15958
+ },
15959
+ get fallback() {
15960
+ return _tmpl$1214();
15961
+ },
15962
+ get children() {
15963
+ var _el$22 = _tmpl$636();
15964
+ insert(_el$22, createComponent(For, {
15965
+ get each() {
15966
+ return data.rxList();
15967
+ },
15968
+ children: (req) => (() => {
15969
+ var _el$39 = _tmpl$1513(), _el$40 = _el$39.firstChild, _el$41 = _el$40.firstChild, _el$42 = _el$41.firstChild, _el$44 = _el$40.nextSibling;
15970
+ insert(_el$42, () => req.drugName || req.drugId || "Prescription");
15971
+ insert(_el$41, createComponent(Show, {
15972
+ get when() {
15973
+ return req.dosage;
15974
+ },
15975
+ get children() {
15976
+ var _el$43 = _tmpl$1313();
15977
+ insert(_el$43, () => req.dosage);
15978
+ return _el$43;
15979
+ }
15980
+ }), null);
15981
+ insert(_el$40, createComponent(StatusBadge, {
15982
+ get status() {
15983
+ return req.status;
15984
+ }
15985
+ }), null);
15986
+ insert(_el$44, createComponent(Show, {
15987
+ get when() {
15988
+ return req.priceCents != null;
15989
+ },
15990
+ get children() {
15991
+ var _el$45 = _tmpl$1413(), _el$46 = _el$45.firstChild;
15992
+ insert(_el$45, () => centsToUsd(req.priceCents), _el$46);
15993
+ return _el$45;
15994
+ }
15995
+ }), null);
15996
+ insert(_el$44, () => fmtDate(req.createdAt), null);
15997
+ return _el$39;
15998
+ })()
15999
+ }));
16000
+ return _el$22;
16001
+ }
16002
+ }), null);
16003
+ effect((_$p) => style(_el$21, panelSectionHeader, _$p));
16004
+ return _el$20;
16005
+ })(), (() => {
16006
+ var _el$23 = _tmpl$829(), _el$24 = _el$23.firstChild;
16007
+ insert(_el$23, createComponent(Show, {
16008
+ get when() {
16009
+ return (data.pendingSurveys() ?? []).length > 0;
16010
+ },
16011
+ get fallback() {
16012
+ return _tmpl$1613();
16013
+ },
16014
+ get children() {
16015
+ var _el$25 = _tmpl$636();
16016
+ insert(_el$25, createComponent(For, {
16017
+ get each() {
16018
+ return data.pendingSurveys();
16019
+ },
16020
+ children: (survey) => (() => {
16021
+ var _el$48 = _tmpl$1713(), _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling; _el$50.firstChild;
16022
+ insert(_el$49, () => survey.drugName || survey.drugId || "Renewal survey");
16023
+ insert(_el$50, () => survey.cycleNumber, null);
16024
+ return _el$48;
16025
+ })()
16026
+ }));
16027
+ return _el$25;
16028
+ }
16029
+ }), null);
16030
+ effect((_$p) => style(_el$24, panelSectionHeader, _$p));
16031
+ return _el$23;
16032
+ })()]
16033
+ });
16034
+ }
16035
+ }), null);
16036
+ return _el$;
16037
+ })();
16038
+ }
16039
+ delegateEvents(["click"]);
16040
+ var _tmpl$290 = /* @__PURE__ */ template(`<div style=margin-bottom:1rem>`);
16041
+ var _tmpl$291 = /* @__PURE__ */ template(`<form><div style=display:grid;gap:1rem;margin-bottom:1.5rem><div style="display:grid;grid-template-columns:repeat(2, 1fr);gap:1rem"></div></div><div style=margin-bottom:1.5rem></div><div style=display:flex;gap:0.75rem>`);
16073
16042
  var _tmpl$357 = /* @__PURE__ */ template(`<div class=pay-method style="max-width:480px;margin:0 auto;padding:2rem 1.25rem"><p style="color:var(--app-portal-fg-muted, #6e6a66);margin-bottom:1.5rem">Enter a new card for your subscription. Your current card stays active until this succeeds.`);
16074
16043
  var LIVE = /* @__PURE__ */ new Set(["active", "paused", "past_due"]);
16075
16044
  function UpdatePaymentMethod(props) {
@@ -16131,14 +16100,14 @@ function UpdatePaymentMethod(props) {
16131
16100
  return memo(() => !!!resolving())() && !noSubscription();
16132
16101
  },
16133
16102
  get children() {
16134
- var _el$3 = _tmpl$295(), _el$5 = _el$3.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.nextSibling;
16103
+ var _el$3 = _tmpl$291(), _el$5 = _el$3.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.nextSibling;
16135
16104
  _el$3.addEventListener("submit", handleSubmit);
16136
16105
  insert(_el$3, createComponent(Show, {
16137
16106
  get when() {
16138
16107
  return flow.error();
16139
16108
  },
16140
16109
  get children() {
16141
- var _el$4 = _tmpl$291();
16110
+ var _el$4 = _tmpl$290();
16142
16111
  insert(_el$4, createComponent(Banner, {
16143
16112
  variant: "error",
16144
16113
  get children() {
@@ -16216,8 +16185,8 @@ function UpdatePaymentMethod(props) {
16216
16185
  return _el$;
16217
16186
  })();
16218
16187
  }
16219
- var _tmpl$296 = /* @__PURE__ */ template(`<a class=ship__track target=_blank rel="noopener noreferrer">Track<!> \u2197`);
16220
- var _tmpl$297 = /* @__PURE__ */ template(`<div class=ship><p class=ship__eta></p><div class=ship__chip-row><button type=button class=ship__chip><span class=ship__num></span><i class="ph ph-copy ship__copy-icon"aria-hidden=true></i><span class=ship__copied>Copied \u2713</span></button></div><span class=portal-sr-only role=status aria-live=polite>`);
16188
+ var _tmpl$295 = /* @__PURE__ */ template(`<a class=ship__track target=_blank rel="noopener noreferrer">Track<!> \u2197`);
16189
+ var _tmpl$296 = /* @__PURE__ */ template(`<div class=ship><p class=ship__eta></p><div class=ship__chip-row><button type=button class=ship__chip><span class=ship__num></span><i class="ph ph-copy ship__copy-icon"aria-hidden=true></i><span class=ship__copied>Copied \u2713</span></button></div><span class=portal-sr-only role=status aria-live=polite>`);
16221
16190
  var _tmpl$358 = /* @__PURE__ */ template(`<span class=refill__cycle>Day <!> of `);
16222
16191
  var _tmpl$444 = /* @__PURE__ */ template(`<div class=refill data-testid=refill-strip><div class=refill__head><span class=lab-label>Your plan</span></div><div class=refill__rail>`);
16223
16192
  var _tmpl$539 = /* @__PURE__ */ template(`<span class=refill__cycle>Preparing your next fill`);
@@ -16231,10 +16200,10 @@ var _tmpl$1016 = /* @__PURE__ */ template(`<p class=thread__caption>`);
16231
16200
  var _tmpl$1118 = /* @__PURE__ */ template(`<button type=button class="portal-btn portal-btn--primary thread__action">Message your care team`);
16232
16201
  var _tmpl$1215 = /* @__PURE__ */ template(`<button type=button class="portal-btn portal-btn--ghost thread__action">Talk to your provider`);
16233
16202
  var _tmpl$1314 = /* @__PURE__ */ template(`<li><div class=thread__rail><span class=thread__bead></span></div><div><div class=thread__top><span class="lab-label thread__label">`);
16234
- var _tmpl$1413 = /* @__PURE__ */ template(`<p class="thread__caption thread__await"data-testid=await-messaging>Your care team is reviewing your request. You\u2019ll be able to message them here once your consult begins.`);
16235
- var _tmpl$1513 = /* @__PURE__ */ template(`<p class="thread__caption thread__await"data-testid=await-messaging>Your provider will follow up with you about next steps.`);
16236
- var _tmpl$1613 = /* @__PURE__ */ template(`<span class=tracker__dose> \xB7 `);
16237
- var _tmpl$1713 = /* @__PURE__ */ template(`<div class=tracker data-testid=order-tracker><div class=tracker__intro><span class=lab-label>Your order</span><p class=tracker__med></p></div><ol>`);
16203
+ var _tmpl$1414 = /* @__PURE__ */ template(`<p class="thread__caption thread__await"data-testid=await-messaging>Your care team is reviewing your request. You\u2019ll be able to message them here once your consult begins.`);
16204
+ var _tmpl$1514 = /* @__PURE__ */ template(`<p class="thread__caption thread__await"data-testid=await-messaging>Your provider will follow up with you about next steps.`);
16205
+ var _tmpl$1614 = /* @__PURE__ */ template(`<span class=tracker__dose> \xB7 `);
16206
+ var _tmpl$1714 = /* @__PURE__ */ template(`<div class=tracker data-testid=order-tracker><div class=tracker__intro><span class=lab-label>Your order</span><p class=tracker__med></p></div><ol>`);
16238
16207
  function TrackingChip(props) {
16239
16208
  let copied;
16240
16209
  const [announce, setAnnounce] = createSignal("");
@@ -16251,7 +16220,7 @@ function TrackingChip(props) {
16251
16220
  }
16252
16221
  };
16253
16222
  return (() => {
16254
- var _el$ = _tmpl$297(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$10 = _el$3.nextSibling;
16223
+ var _el$ = _tmpl$296(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$10 = _el$3.nextSibling;
16255
16224
  insert(_el$2, () => props.eta);
16256
16225
  _el$4.$$click = copy;
16257
16226
  insert(_el$5, () => props.number);
@@ -16262,7 +16231,7 @@ function TrackingChip(props) {
16262
16231
  return props.url;
16263
16232
  },
16264
16233
  get children() {
16265
- var _el$8 = _tmpl$296(), _el$9 = _el$8.firstChild, _el$1 = _el$9.nextSibling; _el$1.nextSibling;
16234
+ var _el$8 = _tmpl$295(), _el$9 = _el$8.firstChild, _el$1 = _el$9.nextSibling; _el$1.nextSibling;
16266
16235
  insert(_el$8, (() => {
16267
16236
  var _c$ = memo(() => !!props.carrier);
16268
16237
  return () => _c$() ? ` with ${props.carrier}` : "";
@@ -16410,7 +16379,7 @@ function OrderTracker(props) {
16410
16379
  return props.messagingEnabled;
16411
16380
  },
16412
16381
  get fallback() {
16413
- return _tmpl$1413();
16382
+ return _tmpl$1414();
16414
16383
  },
16415
16384
  get children() {
16416
16385
  var _el$43 = _tmpl$1118();
@@ -16430,7 +16399,7 @@ function OrderTracker(props) {
16430
16399
  return props.messagingEnabled;
16431
16400
  },
16432
16401
  get fallback() {
16433
- return _tmpl$1513();
16402
+ return _tmpl$1514();
16434
16403
  },
16435
16404
  get children() {
16436
16405
  var _el$44 = _tmpl$1215();
@@ -16464,14 +16433,14 @@ function OrderTracker(props) {
16464
16433
  children: (rx) => {
16465
16434
  const view = buildTrackerView(rx());
16466
16435
  return (() => {
16467
- var _el$47 = _tmpl$1713(), _el$48 = _el$47.firstChild, _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling, _el$53 = _el$48.nextSibling;
16436
+ var _el$47 = _tmpl$1714(), _el$48 = _el$47.firstChild, _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling, _el$53 = _el$48.nextSibling;
16468
16437
  insert(_el$50, () => props.medicationName, null);
16469
16438
  insert(_el$50, createComponent(Show, {
16470
16439
  get when() {
16471
16440
  return rx().dosage;
16472
16441
  },
16473
16442
  get children() {
16474
- var _el$51 = _tmpl$1613(); _el$51.firstChild;
16443
+ var _el$51 = _tmpl$1614(); _el$51.firstChild;
16475
16444
  insert(_el$51, () => rx().dosage, null);
16476
16445
  return _el$51;
16477
16446
  }
@@ -16506,8 +16475,8 @@ function OrderTracker(props) {
16506
16475
  });
16507
16476
  }
16508
16477
  delegateEvents(["click"]);
16509
- var _tmpl$298 = /* @__PURE__ */ template(`<span class=rx-row__dose> \xB7 `);
16510
- var _tmpl$299 = /* @__PURE__ */ template(`<div class=rx-row__body>`);
16478
+ var _tmpl$297 = /* @__PURE__ */ template(`<span class=rx-row__dose> \xB7 `);
16479
+ var _tmpl$298 = /* @__PURE__ */ template(`<div class=rx-row__body>`);
16511
16480
  var _tmpl$359 = /* @__PURE__ */ template(`<div data-testid=rx-row><button type=button class=rx-row__head><span class=rx-row__med></span><span class=rx-row__status></span><i aria-hidden=true>`);
16512
16481
  var STATUS_LABEL = {
16513
16482
  pending: "Under review",
@@ -16533,7 +16502,7 @@ function RxRow(props) {
16533
16502
  return props.rx.dosage;
16534
16503
  },
16535
16504
  get children() {
16536
- var _el$4 = _tmpl$298(); _el$4.firstChild;
16505
+ var _el$4 = _tmpl$297(); _el$4.firstChild;
16537
16506
  insert(_el$4, () => props.rx.dosage, null);
16538
16507
  return _el$4;
16539
16508
  }
@@ -16544,7 +16513,7 @@ function RxRow(props) {
16544
16513
  return open();
16545
16514
  },
16546
16515
  get children() {
16547
- var _el$8 = _tmpl$299();
16516
+ var _el$8 = _tmpl$298();
16548
16517
  insert(_el$8, createComponent(OrderTracker, {
16549
16518
  get request() {
16550
16519
  return props.request;
@@ -16587,7 +16556,7 @@ function RxRow(props) {
16587
16556
  })();
16588
16557
  }
16589
16558
  delegateEvents(["click"]);
16590
- var _tmpl$300 = /* @__PURE__ */ template(`<div class=plan data-testid=plan-billing><span class=lab-label>Plan &amp; billing`);
16559
+ var _tmpl$299 = /* @__PURE__ */ template(`<div class=plan data-testid=plan-billing><span class=lab-label>Plan &amp; billing`);
16591
16560
  var _tmpl$2100 = /* @__PURE__ */ template(`<div class=plan__empty><h2 class=plan__empty-title>No active plan</h2><p class=plan__empty-text>Start your treatment to set up your monthly plan.</p><a class="portal-btn portal-btn--primary">Start your intake`);
16592
16561
  var _tmpl$360 = /* @__PURE__ */ template(`<p class=membership__dose>`);
16593
16562
  var _tmpl$445 = /* @__PURE__ */ template(`<div data-testid=membership-card><div class=membership__sheen aria-hidden=true></div><div class=membership__top><span class="lab-label membership__status"></span><span class=membership__brand></span></div><h2 class=membership__med></h2><div class=membership__bottom><span class=membership__price><span class=membership__per>/mo</span></span><span class=membership__renew>Renews `);
@@ -16641,7 +16610,7 @@ function PlanBilling(props) {
16641
16610
  }
16642
16611
  };
16643
16612
  return (() => {
16644
- var _el$ = _tmpl$300(); _el$.firstChild;
16613
+ var _el$ = _tmpl$299(); _el$.firstChild;
16645
16614
  insert(_el$, createComponent(Show, {
16646
16615
  get when() {
16647
16616
  return primary();
@@ -16753,7 +16722,7 @@ function PlanBilling(props) {
16753
16722
  })();
16754
16723
  }
16755
16724
  delegateEvents(["click"]);
16756
- var _tmpl$301 = /* @__PURE__ */ template(`<p class=account__empty>We don\u2019t have your details on file yet.`);
16725
+ var _tmpl$300 = /* @__PURE__ */ template(`<p class=account__empty>We don\u2019t have your details on file yet.`);
16757
16726
  var _tmpl$2101 = /* @__PURE__ */ template(`<p class=account__note>Need to update something? <button type=button class=account__note-link>Message your care team</button> and we\u2019ll take care of it.`);
16758
16727
  var _tmpl$361 = /* @__PURE__ */ template(`<button type=button class="account__support-link account__support-btn">Messages`);
16759
16728
  var _tmpl$446 = /* @__PURE__ */ template(`<div class=account data-testid=account-panel><span class=lab-label>Account</span><h1 class=account__title>Your details</h1><dl class=account__fields></dl><div class=account__support></div><button type=button class="portal-btn portal-btn--ghost account__signout">Sign out`);
@@ -16816,7 +16785,7 @@ function AccountPanel(props) {
16816
16785
  return fields().length === 0;
16817
16786
  },
16818
16787
  get children() {
16819
- return _tmpl$301();
16788
+ return _tmpl$300();
16820
16789
  }
16821
16790
  }), _el$0);
16822
16791
  insert(_el$, createComponent(Show, {
@@ -16855,7 +16824,7 @@ function AccountPanel(props) {
16855
16824
  })();
16856
16825
  }
16857
16826
  delegateEvents(["click"]);
16858
- var _tmpl$305 = /* @__PURE__ */ template(`<section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Birth control</h2><p class=leaflet__body>`);
16827
+ var _tmpl$301 = /* @__PURE__ */ template(`<section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Birth control</h2><p class=leaflet__body>`);
16859
16828
  var _tmpl$2102 = /* @__PURE__ */ template(`<ul class=leaflet__disclaimers id=leaflet-disclaimers>`);
16860
16829
  var _tmpl$363 = /* @__PURE__ */ template(`<div class=leaflet data-testid=medication-guide><header class=leaflet__header><span class=lab-label>How to take it</span><h1 class=leaflet__title></h1><p class=leaflet__summary></p></header><section class=leaflet__boxed aria-label="Boxed warning"><div class=leaflet__boxed-head><i class="ph-fill ph-warning"aria-hidden=true></i><span>Important warning</span></div><p></p></section><section class="leaflet__section leaflet__section--caution"><h2 class=leaflet__h2>Do not use this medicine if\u2026</h2><ul class="leaflet__list leaflet__list--caution"></ul></section><section class=leaflet__section><h2 class=leaflet__h2>Your dose over time</h2><p class=leaflet__note>A typical step-up. Your prescriber sets your exact doses and timing.</p><ol class=titration></ol></section><section class=leaflet__section><h2 class=leaflet__h2>Giving your injection</h2><ol class=steps></ol></section><div class=leaflet__grid><section class=leaflet__section><h2 class=leaflet__h2>Storing your medicine</h2><ul class=leaflet__list></ul></section><section class=leaflet__section><h2 class=leaflet__h2>If you miss a dose</h2><p class=leaflet__body></p></section></div><div class=leaflet__grid><section class=leaflet__section><h2 class=leaflet__h2>Common side effects</h2><ul class="leaflet__list leaflet__list--check"></ul></section><section class="leaflet__section leaflet__section--alert"><h2 class=leaflet__h2>Call right away if you notice\u2026</h2><ul class="leaflet__list leaflet__list--alert"></ul></section></div><section class=leaflet__section><h2 class=leaflet__h2>When to contact your care team</h2><ul class=leaflet__list></ul></section><section class=leaflet__section><h2 class=leaflet__h2>Tips for feeling your best</h2><ul class="leaflet__list leaflet__list--check"></ul></section><section class=leaflet__footnote><button type=button class=leaflet__disclose aria-controls=leaflet-disclaimers> the important details<i aria-hidden=true>`);
16861
16830
  var _tmpl$447 = /* @__PURE__ */ template(`<li>`);
@@ -16937,7 +16906,7 @@ function MedicationGuide(props) {
16937
16906
  return props.guide.contraception;
16938
16907
  },
16939
16908
  get children() {
16940
- var _el$24 = _tmpl$305(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
16909
+ var _el$24 = _tmpl$301(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
16941
16910
  insert(_el$26, () => props.guide.contraception);
16942
16911
  return _el$24;
16943
16912
  }
@@ -17016,7 +16985,7 @@ function MedicationGuide(props) {
17016
16985
  })();
17017
16986
  }
17018
16987
  delegateEvents(["click"]);
17019
- var _tmpl$306 = /* @__PURE__ */ template(`<div class=msg-list__header><h2 class=msg-list__title>Messages</h2><button type=button class=msg-list__new data-testid=messages-new-support><i class="ph-thin ph-plus"aria-hidden=true></i>Message support`);
16988
+ var _tmpl$305 = /* @__PURE__ */ template(`<div class=msg-list__header><h2 class=msg-list__title>Messages</h2><button type=button class=msg-list__new data-testid=messages-new-support><i class="ph-thin ph-plus"aria-hidden=true></i>Message support`);
17020
16989
  var _tmpl$2103 = /* @__PURE__ */ template(`<div class=msg-list__state><div class=request-status__spinner>`);
17021
16990
  var _tmpl$364 = /* @__PURE__ */ template(`<div class="msg-list__state msg-list__state--empty"data-testid=messages-empty><i class="ph-thin ph-chat-circle msg-list__empty-icon"aria-hidden=true></i><p class=msg-list__empty-title>No conversations yet.</p><p class=msg-list__empty-hint>Your care team will reach out after reviewing your case \u2014 or message support with a question any time.`);
17022
16991
  var _tmpl$448 = /* @__PURE__ */ template(`<div class=msg-list__scroll data-scrollable>`);
@@ -17031,19 +17000,19 @@ var _tmpl$1017 = /* @__PURE__ */ template(`<div class=msg-attachment>`);
17031
17000
  var _tmpl$1119 = /* @__PURE__ */ template(`<div><div><p class=msg-thread__meta>`);
17032
17001
  var _tmpl$1216 = /* @__PURE__ */ template(`<p class=msg-thread__system data-testid=system-message>`);
17033
17002
  var _tmpl$1315 = /* @__PURE__ */ template(`<p class=msg-thread__text>`);
17034
- var _tmpl$1414 = /* @__PURE__ */ template(`<button type=button class="msg-compose__staged-remove msg-compose__staged-remove--inline">Remove file`);
17035
- var _tmpl$1514 = /* @__PURE__ */ template(`<p class=msg-compose__error role=alert>`);
17036
- var _tmpl$1614 = /* @__PURE__ */ template(`<form class="msg-thread msg-thread--compose"data-testid=support-compose><div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name>Message support</h3><p class=msg-thread__role>We usually reply within one business day</p></div></div><div class=msg-compose__new><label class=msg-compose__label for=support-subject>What's this about?</label><input id=support-subject class=msg-compose__subject type=text maxlength=500 required placeholder="e.g. Question about my order"><label class=msg-compose__label for=support-body>How can we help?</label><textarea id=support-body class=msg-compose__body rows=6 maxlength=5000 required placeholder="Tell us what's going on\u2026"></textarea><label class="msg-compose__attach msg-compose__attach--block"title="Attach a file"><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-compose__attach-label></span><input class=msg-compose__file-input type=file data-testid=support-compose-attach></label><button type=submit class=msg-compose__send data-testid=support-compose-send>`);
17037
- var _tmpl$1714 = /* @__PURE__ */ template(`<span class=msg-thread__status data-testid=thread-status-closed>Resolved`);
17038
- var _tmpl$1813 = /* @__PURE__ */ template(`<div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"data-testid=messages-back><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name></h3><p class=msg-thread__role>`);
17003
+ var _tmpl$1415 = /* @__PURE__ */ template(`<button type=button class="msg-compose__staged-remove msg-compose__staged-remove--inline">Remove file`);
17004
+ var _tmpl$1515 = /* @__PURE__ */ template(`<p class=msg-compose__error role=alert>`);
17005
+ var _tmpl$1615 = /* @__PURE__ */ template(`<form class="msg-thread msg-thread--compose"data-testid=support-compose><div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name>Message support</h3><p class=msg-thread__role>We usually reply within one business day</p></div></div><div class=msg-compose__new><label class=msg-compose__label for=support-subject>What's this about?</label><input id=support-subject class=msg-compose__subject type=text maxlength=500 required placeholder="e.g. Question about my order"><label class=msg-compose__label for=support-body>How can we help?</label><textarea id=support-body class=msg-compose__body rows=6 maxlength=5000 required placeholder="Tell us what's going on\u2026"></textarea><label class="msg-compose__attach msg-compose__attach--block"title="Attach a file"><i class="ph-thin ph-paperclip"aria-hidden=true></i><span class=msg-compose__attach-label></span><input class=msg-compose__file-input type=file data-testid=support-compose-attach></label><button type=submit class=msg-compose__send data-testid=support-compose-send>`);
17006
+ var _tmpl$1715 = /* @__PURE__ */ template(`<span class=msg-thread__status data-testid=thread-status-closed>Resolved`);
17007
+ var _tmpl$1812 = /* @__PURE__ */ template(`<div class=msg-thread__header><button type=button class=msg-thread__back-btn aria-label="Back to conversations"data-testid=messages-back><i class="ph-thin ph-arrow-left"aria-hidden=true></i></button><div><h3 class=msg-thread__name></h3><p class=msg-thread__role>`);
17039
17008
  var _tmpl$1911 = /* @__PURE__ */ template(`<div class=msg-thread__messages data-scrollable><div>`);
17040
- var _tmpl$2011 = /* @__PURE__ */ template(`<span class=msg-compose__error role=alert>`);
17009
+ var _tmpl$2010 = /* @__PURE__ */ template(`<span class=msg-compose__error role=alert>`);
17041
17010
  var _tmpl$2115 = /* @__PURE__ */ template(`<div class=msg-compose__staged>`);
17042
17011
  var _tmpl$2212 = /* @__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>`);
17043
17012
  var _tmpl$2311 = /* @__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>`);
17044
17013
  var _tmpl$2411 = /* @__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`);
17045
17014
  var _tmpl$2511 = /* @__PURE__ */ template(`<div class=msg-panel data-testid=messages-panel><div class=msg-panel__layout><div></div><div>`);
17046
- var _tmpl$2611 = /* @__PURE__ */ template(`<div class=msg-panel__placeholder data-testid=messages-placeholder><p>Select a conversation to read and reply.`);
17015
+ var _tmpl$2610 = /* @__PURE__ */ template(`<div class=msg-panel__placeholder data-testid=messages-placeholder><p>Select a conversation to read and reply.`);
17047
17016
  function sanitizeMessageHtml(html) {
17048
17017
  return DOMPurify.sanitize(html, {
17049
17018
  ALLOWED_TAGS: ["a", "b", "strong", "i", "em", "u", "s", "p", "br", "ul", "ol", "li", "blockquote", "h1", "h2", "h3", "h4", "span", "div", "table", "thead", "tbody", "tr", "th", "td", "img", "hr", "code", "pre"],
@@ -17140,7 +17109,7 @@ function MessagesPanel(props) {
17140
17109
  }
17141
17110
  }
17142
17111
  const ConversationList = () => [(() => {
17143
- var _el$ = _tmpl$306(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
17112
+ var _el$ = _tmpl$305(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
17144
17113
  _el$3.$$click = openCompose;
17145
17114
  return _el$;
17146
17115
  })(), (() => {
@@ -17346,7 +17315,7 @@ function MessagesPanel(props) {
17346
17315
  });
17347
17316
  };
17348
17317
  const NewSupportThread = () => (() => {
17349
- var _el$28 = _tmpl$1614(), _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$29.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.nextSibling, _el$35 = _el$34.nextSibling, _el$36 = _el$35.nextSibling, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$38.nextSibling, _el$42 = _el$36.nextSibling;
17318
+ var _el$28 = _tmpl$1615(), _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$29.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.nextSibling, _el$35 = _el$34.nextSibling, _el$36 = _el$35.nextSibling, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$38.nextSibling, _el$42 = _el$36.nextSibling;
17350
17319
  _el$28.addEventListener("submit", submitCompose);
17351
17320
  _el$30.$$click = () => setComposing(false);
17352
17321
  _el$33.$$input = (e) => setNewSubject(e.currentTarget.value);
@@ -17358,7 +17327,7 @@ function MessagesPanel(props) {
17358
17327
  return newFile();
17359
17328
  },
17360
17329
  get children() {
17361
- var _el$40 = _tmpl$1414();
17330
+ var _el$40 = _tmpl$1415();
17362
17331
  _el$40.$$click = () => setNewFile(null);
17363
17332
  return _el$40;
17364
17333
  }
@@ -17368,7 +17337,7 @@ function MessagesPanel(props) {
17368
17337
  return attachError() || composeError();
17369
17338
  },
17370
17339
  get children() {
17371
- var _el$41 = _tmpl$1514();
17340
+ var _el$41 = _tmpl$1515();
17372
17341
  insert(_el$41, () => attachError() ?? composeError());
17373
17342
  return _el$41;
17374
17343
  }
@@ -17388,7 +17357,7 @@ function MessagesPanel(props) {
17388
17357
  return _el$28;
17389
17358
  })();
17390
17359
  const Thread = () => [(() => {
17391
- var _el$43 = _tmpl$1813(), _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling, _el$46 = _el$45.firstChild, _el$47 = _el$46.nextSibling;
17360
+ var _el$43 = _tmpl$1812(), _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling, _el$46 = _el$45.firstChild, _el$47 = _el$46.nextSibling;
17392
17361
  _el$44.$$click = () => thread().clearSelection();
17393
17362
  insert(_el$46, () => selectedConvo()?.participantName ?? "Provider");
17394
17363
  insert(_el$47, () => selectedConvo()?.participantRole ?? "Prescriber");
@@ -17397,7 +17366,7 @@ function MessagesPanel(props) {
17397
17366
  return memo(() => selectedConvo()?.source === "support")() && selectedConvo()?.status === "closed";
17398
17367
  },
17399
17368
  get children() {
17400
- return _tmpl$1714();
17369
+ return _tmpl$1715();
17401
17370
  }
17402
17371
  }), null);
17403
17372
  return _el$43;
@@ -17445,7 +17414,7 @@ function MessagesPanel(props) {
17445
17414
  return attachError();
17446
17415
  },
17447
17416
  get children() {
17448
- var _el$53 = _tmpl$2011();
17417
+ var _el$53 = _tmpl$2010();
17449
17418
  insert(_el$53, attachError);
17450
17419
  return _el$53;
17451
17420
  }
@@ -17494,7 +17463,7 @@ function MessagesPanel(props) {
17494
17463
  return thread().selectedId() != null;
17495
17464
  },
17496
17465
  get fallback() {
17497
- return _tmpl$2611();
17466
+ return _tmpl$2610();
17498
17467
  },
17499
17468
  get children() {
17500
17469
  return createComponent(Thread, {});
@@ -17515,7 +17484,7 @@ function MessagesPanel(props) {
17515
17484
  })();
17516
17485
  }
17517
17486
  delegateEvents(["click", "input", "keydown"]);
17518
- var _tmpl$307 = /* @__PURE__ */ template(`<ul class=history-list data-testid=history-list>`);
17487
+ var _tmpl$306 = /* @__PURE__ */ template(`<ul class=history-list data-testid=history-list>`);
17519
17488
  var _tmpl$2104 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-error><p>We couldn't load your submitted surveys. Please try again in a moment.`);
17520
17489
  var _tmpl$365 = /* @__PURE__ */ template(`<div class=portal-state data-testid=history-empty><p>No submitted questionnaires yet.</p><p class=history-hint>Your intake and refill check-in answers will appear here once you've submitted them.`);
17521
17490
  var _tmpl$449 = /* @__PURE__ */ template(`<li><button type=button class=history-row><span class=history-row__mode></span><span class=history-row__date></span><i class="ph-thin ph-caret-right portal-icon"aria-hidden=true>`);
@@ -17565,7 +17534,7 @@ function SurveyHistory() {
17565
17534
  return _tmpl$365();
17566
17535
  },
17567
17536
  get children() {
17568
- var _el$ = _tmpl$307();
17537
+ var _el$ = _tmpl$306();
17569
17538
  insert(_el$, createComponent(For, {
17570
17539
  get each() {
17571
17540
  return list();
@@ -17662,7 +17631,7 @@ function SurveyHistory() {
17662
17631
  delegateEvents(["click"]);
17663
17632
 
17664
17633
  // src/pages/MemberPortal.tsx
17665
- var _tmpl$308 = /* @__PURE__ */ template(`<span class=portal-item__live aria-label="In progress">`);
17634
+ var _tmpl$307 = /* @__PURE__ */ template(`<span class=portal-item__live aria-label="In progress">`);
17666
17635
  var _tmpl$2105 = /* @__PURE__ */ template(`<span>`);
17667
17636
  var _tmpl$366 = /* @__PURE__ */ template(`<button type=button><i aria-hidden=true></i><span class=portal-item__label>`);
17668
17637
  var _tmpl$450 = /* @__PURE__ */ template(`<div class=rx-others data-testid=rx-others><span class=lab-label>Other orders`);
@@ -17764,7 +17733,7 @@ function MemberPortal(props) {
17764
17733
  return memo(() => item.key === "tracker")() && inMotion();
17765
17734
  },
17766
17735
  get children() {
17767
- return _tmpl$308();
17736
+ return _tmpl$307();
17768
17737
  }
17769
17738
  }), null);
17770
17739
  insert(_el$, createComponent(Show, {
@@ -18070,7 +18039,7 @@ function MemberPortal(props) {
18070
18039
  })();
18071
18040
  }
18072
18041
  delegateEvents(["click"]);
18073
- var _tmpl$309 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;border-radius:var(--app-affiliate-radius);background:var(--app-affiliate-warning-bg);color:var(--app-affiliate-warning-fg);border:1px solid var(--app-affiliate-border)">Your affiliate account is awaiting approval. Once an admin activates it, your referral link will start earning commissions.`);
18042
+ var _tmpl$308 = /* @__PURE__ */ template(`<div style="padding:1rem 1.25rem;border-radius:var(--app-affiliate-radius);background:var(--app-affiliate-warning-bg);color:var(--app-affiliate-warning-fg);border:1px solid var(--app-affiliate-border)">Your affiliate account is awaiting approval. Once an admin activates it, your referral link will start earning commissions.`);
18074
18043
  var _tmpl$2106 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Overview`);
18075
18044
  var _tmpl$367 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading stats\u2026`);
18076
18045
  var _tmpl$451 = /* @__PURE__ */ template(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));gap:1rem">`);
@@ -18113,7 +18082,7 @@ function AffiliateOverview() {
18113
18082
  return isPending();
18114
18083
  },
18115
18084
  get children() {
18116
- return _tmpl$309();
18085
+ return _tmpl$308();
18117
18086
  }
18118
18087
  }), null);
18119
18088
  insert(_el$, createComponent(Show, {
@@ -18142,9 +18111,9 @@ function AffiliateOverview() {
18142
18111
  return _el$;
18143
18112
  })();
18144
18113
  }
18145
- var _tmpl$368 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden"><table class=app-affiliate-table style=width:100%;border-collapse:collapse;font-size:0.875rem><thead><tr style=background:var(--app-affiliate-surface-light)><th>Date</th><th>Type</th><th>Order total</th><th>Commission</th><th>Status</th></tr></thead><tbody>`);
18114
+ var _tmpl$309 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden"><table class=app-affiliate-table style=width:100%;border-collapse:collapse;font-size:0.875rem><thead><tr style=background:var(--app-affiliate-surface-light)><th>Date</th><th>Type</th><th>Order total</th><th>Commission</th><th>Status</th></tr></thead><tbody>`);
18146
18115
  var _tmpl$2107 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Conversions`);
18147
- var _tmpl$369 = /* @__PURE__ */ template(`<div style="padding:2rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);color:var(--app-affiliate-fg-muted);text-align:center">No conversions yet. Share your referral link to start earning.`);
18116
+ var _tmpl$368 = /* @__PURE__ */ template(`<div style="padding:2rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);color:var(--app-affiliate-fg-muted);text-align:center">No conversions yet. Share your referral link to start earning.`);
18148
18117
  var _tmpl$452 = /* @__PURE__ */ template(`<span title="Override commission earned on a sub-affiliate's sale"style="margin-left:0.4rem;padding:0.1rem 0.45rem;border-radius:999px;font-size:0.65rem;font-weight:600;background:var(--app-affiliate-primary-soft);color:var(--app-affiliate-primary-soft-fg)">Override`);
18149
18118
  var _tmpl$547 = /* @__PURE__ */ template(`<tr style="border-top:1px solid var(--app-affiliate-border)"><td data-label=Date></td><td data-label=Type></td><td data-label="Order total"></td><td data-label=Commission style=color:var(--app-affiliate-fg);font-weight:600></td><td data-label=Status><span style="padding:0.2rem 0.6rem;border-radius:999px;font-size:0.75rem;font-weight:600">`);
18150
18119
  function formatMoney2(cents) {
@@ -18190,10 +18159,10 @@ function AffiliateConversions() {
18190
18159
  return (conversions() ?? []).length > 0;
18191
18160
  },
18192
18161
  get fallback() {
18193
- return _tmpl$369();
18162
+ return _tmpl$368();
18194
18163
  },
18195
18164
  get children() {
18196
- var _el$3 = _tmpl$368(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$5.nextSibling;
18165
+ var _el$3 = _tmpl$309(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$5.nextSibling;
18197
18166
  insert(_el$10, createComponent(For, {
18198
18167
  get each() {
18199
18168
  return conversions();
@@ -18275,9 +18244,9 @@ function td() {
18275
18244
  color: "var(--app-affiliate-fg)"
18276
18245
  };
18277
18246
  }
18278
- var _tmpl$370 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden"><table class=app-affiliate-table style=width:100%;border-collapse:collapse;font-size:0.875rem><thead><tr style=background:var(--app-affiliate-surface-light)><th>Code</th><th>Name</th><th>Status</th><th>Joined</th></tr></thead><tbody>`);
18247
+ var _tmpl$369 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden"><table class=app-affiliate-table style=width:100%;border-collapse:collapse;font-size:0.875rem><thead><tr style=background:var(--app-affiliate-surface-light)><th>Code</th><th>Name</th><th>Status</th><th>Joined</th></tr></thead><tbody>`);
18279
18248
  var _tmpl$2108 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Downline</h1><p style=margin:0;color:var(--app-affiliate-fg-muted);font-size:0.875rem>Affiliates you've referred. You earn an override commission on every qualifying sale they make \u2014 those show up as \u201COverride\u201D rows on your Conversions.`);
18280
- var _tmpl$371 = /* @__PURE__ */ template(`<div style="padding:2rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);color:var(--app-affiliate-fg-muted);text-align:center">No sub-affiliates yet.`);
18249
+ var _tmpl$370 = /* @__PURE__ */ template(`<div style="padding:2rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);color:var(--app-affiliate-fg-muted);text-align:center">No sub-affiliates yet.`);
18281
18250
  var _tmpl$453 = /* @__PURE__ */ template(`<tr style="border-top:1px solid var(--app-affiliate-border)"><td data-label=Code style=font-family:var(--app-affiliate-font-mono)></td><td data-label=Name></td><td data-label=Status><span style="padding:0.2rem 0.6rem;border-radius:999px;font-size:0.75rem;font-weight:600"></span></td><td data-label=Joined>`);
18282
18251
  function formatDate4(iso) {
18283
18252
  const d = new Date(iso);
@@ -18317,10 +18286,10 @@ function AffiliateDownline() {
18317
18286
  return (downline() ?? []).length > 0;
18318
18287
  },
18319
18288
  get fallback() {
18320
- return _tmpl$371();
18289
+ return _tmpl$370();
18321
18290
  },
18322
18291
  get children() {
18323
- var _el$4 = _tmpl$370(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$6.nextSibling;
18292
+ var _el$4 = _tmpl$369(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$6.nextSibling;
18324
18293
  insert(_el$10, createComponent(For, {
18325
18294
  get each() {
18326
18295
  return downline();
@@ -18389,9 +18358,9 @@ function td2() {
18389
18358
  color: "var(--app-affiliate-fg)"
18390
18359
  };
18391
18360
  }
18392
- var _tmpl$372 = /* @__PURE__ */ template(`<div style="padding:1.5rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);display:flex;flex-direction:column;gap:0.75rem"><div style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted)>Share this link</div><div style=display:flex;gap:0.5rem;align-items:stretch;flex-wrap:wrap><code style="flex:1;min-width:16rem;padding:0.75rem 1rem;background:var(--app-affiliate-surface-light);border-radius:var(--app-affiliate-radius-sm);font-family:var(--app-affiliate-font-mono);color:var(--app-affiliate-fg);word-break:break-all"></code><button type=button style="padding:0.75rem 1.25rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600;cursor:pointer"></button></div><div style=font-size:0.875rem;color:var(--app-affiliate-fg-muted)>Anyone who visits this URL has a tracking cookie set for the duration of your program. If they sign up and subscribe within the cookie window, you earn commission on the conversion.`);
18361
+ var _tmpl$371 = /* @__PURE__ */ template(`<div style="padding:1.5rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);display:flex;flex-direction:column;gap:0.75rem"><div style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted)>Share this link</div><div style=display:flex;gap:0.5rem;align-items:stretch;flex-wrap:wrap><code style="flex:1;min-width:16rem;padding:0.75rem 1rem;background:var(--app-affiliate-surface-light);border-radius:var(--app-affiliate-radius-sm);font-family:var(--app-affiliate-font-mono);color:var(--app-affiliate-fg);word-break:break-all"></code><button type=button style="padding:0.75rem 1.25rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600;cursor:pointer"></button></div><div style=font-size:0.875rem;color:var(--app-affiliate-fg-muted)>Anyone who visits this URL has a tracking cookie set for the duration of your program. If they sign up and subscribe within the cookie window, you earn commission on the conversion.`);
18393
18362
  var _tmpl$2109 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Referral link`);
18394
- var _tmpl$373 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Your referral link will appear here once your account is approved.`);
18363
+ var _tmpl$372 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Your referral link will appear here once your account is approved.`);
18395
18364
  function AffiliateReferralLink() {
18396
18365
  const {
18397
18366
  links
@@ -18422,10 +18391,10 @@ function AffiliateReferralLink() {
18422
18391
  return homepageLink();
18423
18392
  },
18424
18393
  get fallback() {
18425
- return _tmpl$373();
18394
+ return _tmpl$372();
18426
18395
  },
18427
18396
  get children() {
18428
- var _el$3 = _tmpl$372(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling; _el$5.nextSibling;
18397
+ var _el$3 = _tmpl$371(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling; _el$5.nextSibling;
18429
18398
  insert(_el$6, homepageLink);
18430
18399
  _el$7.$$click = copy;
18431
18400
  insert(_el$7, () => copied() ? "Copied" : "Copy");
@@ -18436,9 +18405,9 @@ function AffiliateReferralLink() {
18436
18405
  })();
18437
18406
  }
18438
18407
  delegateEvents(["click"]);
18439
- var _tmpl$374 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Account</h1><div><button type=button style="padding:0.75rem 1.25rem;background:transparent;color:var(--app-affiliate-fg);border:1px solid var(--app-affiliate-border-strong);border-radius:var(--app-affiliate-radius-sm);cursor:pointer;font-weight:500">Log out</button></div><div style=font-size:0.875rem;color:var(--app-affiliate-fg-muted)>To update your profile or payment details, contact your program administrator.`);
18408
+ var _tmpl$373 = /* @__PURE__ */ template(`<div style=display:flex;flex-direction:column;gap:1.5rem><h1 style=font-family:var(--app-affiliate-font-display);font-size:1.5rem;margin:0;color:var(--app-affiliate-fg)>Account</h1><div><button type=button style="padding:0.75rem 1.25rem;background:transparent;color:var(--app-affiliate-fg);border:1px solid var(--app-affiliate-border-strong);border-radius:var(--app-affiliate-radius-sm);cursor:pointer;font-weight:500">Log out</button></div><div style=font-size:0.875rem;color:var(--app-affiliate-fg-muted)>To update your profile or payment details, contact your program administrator.`);
18440
18409
  var _tmpl$2116 = /* @__PURE__ */ template(`<div style=color:var(--app-affiliate-fg-muted)>Loading\u2026`);
18441
- var _tmpl$375 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden">`);
18410
+ var _tmpl$374 = /* @__PURE__ */ template(`<div style="background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);overflow:hidden">`);
18442
18411
  var _tmpl$454 = /* @__PURE__ */ template(`<div style="display:flex;justify-content:space-between;align-items:center;padding:0.875rem 1.25rem;border-bottom:1px solid var(--app-affiliate-border)"><div style=font-size:0.75rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--app-affiliate-fg-muted)></div><div style=color:var(--app-affiliate-fg)>`);
18443
18412
  var STATUS_LABEL2 = {
18444
18413
  pending: "Pending approval",
@@ -18474,7 +18443,7 @@ function AffiliateSettings() {
18474
18443
  value: a.paymentEmail ?? "\u2014"
18475
18444
  }];
18476
18445
  return (() => {
18477
- var _el$ = _tmpl$374(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild; _el$3.nextSibling;
18446
+ var _el$ = _tmpl$373(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild; _el$3.nextSibling;
18478
18447
  insert(_el$, createComponent(Show, {
18479
18448
  get when() {
18480
18449
  return affiliate();
@@ -18483,7 +18452,7 @@ function AffiliateSettings() {
18483
18452
  return _tmpl$2116();
18484
18453
  },
18485
18454
  children: (a) => (() => {
18486
- var _el$7 = _tmpl$375();
18455
+ var _el$7 = _tmpl$374();
18487
18456
  insert(_el$7, createComponent(For, {
18488
18457
  get each() {
18489
18458
  return rows(a());
@@ -18505,9 +18474,9 @@ function AffiliateSettings() {
18505
18474
  delegateEvents(["click"]);
18506
18475
 
18507
18476
  // src/pages/AffiliatePortal.tsx
18508
- var _tmpl$376 = /* @__PURE__ */ template(`<div class="app-affiliate-root app-affiliate-shell"style=position:sticky;background:var(--app-affiliate-bg);color:var(--app-affiliate-fg)><div class=app-affiliate-shell-header><button type=button class=app-affiliate-shell-menu-trigger aria-label="Open portal menu"><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=18 x2=21 y2=18></line></svg></button><span class=app-affiliate-shell-header-title></span></div><div class=app-affiliate-backdrop aria-hidden=true></div><aside class=app-affiliate-sidebar><div style=padding:1.25rem><h2 style="font-size:0.7rem;font-weight:500;color:var(--app-affiliate-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 1rem">Affiliate Portal</h2><nav style=display:flex;flex-direction:column;gap:0.25rem></nav></div></aside><div class=app-affiliate-content>`);
18477
+ var _tmpl$375 = /* @__PURE__ */ template(`<div class="app-affiliate-root app-affiliate-shell"style=position:sticky;background:var(--app-affiliate-bg);color:var(--app-affiliate-fg)><div class=app-affiliate-shell-header><button type=button class=app-affiliate-shell-menu-trigger aria-label="Open portal menu"><svg width=22 height=22 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round aria-hidden=true><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=18 x2=21 y2=18></line></svg></button><span class=app-affiliate-shell-header-title></span></div><div class=app-affiliate-backdrop aria-hidden=true></div><aside class=app-affiliate-sidebar><div style=padding:1.25rem><h2 style="font-size:0.7rem;font-weight:500;color:var(--app-affiliate-fg-muted);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 1rem">Affiliate Portal</h2><nav style=display:flex;flex-direction:column;gap:0.25rem></nav></div></aside><div class=app-affiliate-content>`);
18509
18478
  var _tmpl$2117 = /* @__PURE__ */ template(`<span style=font-size:1rem;opacity:0.7;flex-shrink:0>`);
18510
- var _tmpl$377 = /* @__PURE__ */ template(`<button type=button style="display:flex;align-items:center;gap:0.75rem;padding:0.625rem 0.75rem;border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem;font-weight:500;text-align:left;border:none;cursor:pointer">`);
18479
+ var _tmpl$376 = /* @__PURE__ */ template(`<button type=button style="display:flex;align-items:center;gap:0.75rem;padding:0.625rem 0.75rem;border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem;font-weight:500;text-align:left;border:none;cursor:pointer">`);
18511
18480
  var _tmpl$455 = /* @__PURE__ */ template(`<div class=app-affiliate-root style=display:flex;align-items:center;justify-content:center;position:sticky;background:var(--app-affiliate-bg)><div role=status aria-label="Loading affiliate portal"style="width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--app-affiliate-border);border-top-color:var(--app-affiliate-primary);animation:app-affiliate-gate-spin 0.8s linear infinite"></div><style>@keyframes app-affiliate-gate-spin { to { transform: rotate(360deg); } }`);
18512
18481
  var TAB_LABELS2 = {
18513
18482
  overview: "Overview",
@@ -18553,7 +18522,7 @@ function AffiliatePortal(props) {
18553
18522
  });
18554
18523
  },
18555
18524
  get children() {
18556
- var _el$ = _tmpl$376(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$6.nextSibling;
18525
+ var _el$ = _tmpl$375(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$6.nextSibling;
18557
18526
  _el$3.$$click = () => setDrawerOpen(true);
18558
18527
  insert(_el$4, () => TAB_LABELS2[currentTab()]);
18559
18528
  _el$5.$$click = () => setDrawerOpen(false);
@@ -18562,7 +18531,7 @@ function AffiliatePortal(props) {
18562
18531
  return orderedTabs();
18563
18532
  },
18564
18533
  children: (tab) => (() => {
18565
- var _el$1 = _tmpl$377();
18534
+ var _el$1 = _tmpl$376();
18566
18535
  _el$1.$$click = () => handleTabClick(tab);
18567
18536
  insert(_el$1, createComponent(Show, {
18568
18537
  get when() {
@@ -18665,11 +18634,11 @@ function AffiliateGateSpinner(props) {
18665
18634
  })();
18666
18635
  }
18667
18636
  delegateEvents(["click"]);
18668
- var _tmpl$378 = /* @__PURE__ */ template(`<div style=position:relative><input><button type=button style="position:absolute;top:0;right:0;height:100%;display:flex;align-items:center;padding:0 0.75rem;background:transparent;border:none;color:var(--app-affiliate-fg-muted);cursor:pointer;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em">`);
18637
+ var _tmpl$377 = /* @__PURE__ */ template(`<div style=position:relative><input><button type=button style="position:absolute;top:0;right:0;height:100%;display:flex;align-items:center;padding:0 0.75rem;background:transparent;border:none;color:var(--app-affiliate-fg-muted);cursor:pointer;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em">`);
18669
18638
  function AffiliatePasswordInput(props) {
18670
18639
  const [visible, setVisible] = createSignal(false);
18671
18640
  return (() => {
18672
- var _el$ = _tmpl$378(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
18641
+ var _el$ = _tmpl$377(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
18673
18642
  _el$2.$$input = (e) => props.onInput(e.currentTarget.value);
18674
18643
  _el$3.$$click = () => setVisible((v) => !v);
18675
18644
  insert(_el$3, () => visible() ? "Hide" : "Show");
@@ -18710,9 +18679,9 @@ function inputStyle() {
18710
18679
  delegateEvents(["input", "click"]);
18711
18680
 
18712
18681
  // src/pages/AffiliateRegister.tsx
18713
- var _tmpl$379 = /* @__PURE__ */ template(`<input type=text required autocomplete=given-name>`);
18682
+ var _tmpl$378 = /* @__PURE__ */ template(`<input type=text required autocomplete=given-name>`);
18714
18683
  var _tmpl$2118 = /* @__PURE__ */ template(`<input type=text required autocomplete=family-name>`);
18715
- var _tmpl$380 = /* @__PURE__ */ template(`<input type=email required autocomplete=email>`);
18684
+ var _tmpl$379 = /* @__PURE__ */ template(`<input type=email required autocomplete=email>`);
18716
18685
  var _tmpl$456 = /* @__PURE__ */ template(`<input type=text required minlength=4>`);
18717
18686
  var _tmpl$548 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
18718
18687
  var _tmpl$644 = /* @__PURE__ */ template(`<button type=button>Already have an account? Log in`);
@@ -18765,7 +18734,7 @@ function AffiliateRegister(props) {
18765
18734
  insert(_el$6, createComponent(Row, {
18766
18735
  label: "First name",
18767
18736
  get children() {
18768
- var _el$7 = _tmpl$379();
18737
+ var _el$7 = _tmpl$378();
18769
18738
  _el$7.$$input = (e) => setFirstName(e.currentTarget.value);
18770
18739
  effect((_$p) => style(_el$7, inputStyle2(), _$p));
18771
18740
  effect(() => _el$7.value = firstName());
@@ -18785,7 +18754,7 @@ function AffiliateRegister(props) {
18785
18754
  insert(_el$6, createComponent(Row, {
18786
18755
  label: "Email",
18787
18756
  get children() {
18788
- var _el$9 = _tmpl$380();
18757
+ var _el$9 = _tmpl$379();
18789
18758
  _el$9.$$input = (e) => setEmail(e.currentTarget.value);
18790
18759
  effect((_$p) => style(_el$9, inputStyle2(), _$p));
18791
18760
  effect(() => _el$9.value = email());
@@ -18904,9 +18873,9 @@ function linkStyle() {
18904
18873
  };
18905
18874
  }
18906
18875
  delegateEvents(["input", "click"]);
18907
- var _tmpl$381 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
18876
+ var _tmpl$380 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
18908
18877
  var _tmpl$2119 = /* @__PURE__ */ template(`<button type=button style=background:transparent;border:none;color:var(--app-affiliate-fg-muted);cursor:pointer;text-decoration:underline;font-size:0.875rem;padding:0;text-align:center>Forgot your password?`);
18909
- var _tmpl$382 = /* @__PURE__ */ template(`<button type=button style=background:transparent;border:none;color:var(--app-affiliate-primary-soft-fg);cursor:pointer;text-decoration:underline;font-size:0.875rem;padding:0;text-align:center>New affiliate? Apply`);
18878
+ var _tmpl$381 = /* @__PURE__ */ template(`<button type=button style=background:transparent;border:none;color:var(--app-affiliate-primary-soft-fg);cursor:pointer;text-decoration:underline;font-size:0.875rem;padding:0;text-align:center>New affiliate? Apply`);
18910
18879
  var _tmpl$457 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Affiliate login</h1><form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>Email</span><input type=email required autocomplete=email></label><label style=display:flex;flex-direction:column;gap:0.35rem><span>Password</span></label><button type=submit style="padding:0.75rem 1rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600">`);
18911
18880
  function AffiliateLogin(props) {
18912
18881
  const [email, setEmail] = createSignal("");
@@ -18943,7 +18912,7 @@ function AffiliateLogin(props) {
18943
18912
  return error();
18944
18913
  },
18945
18914
  get children() {
18946
- var _el$0 = _tmpl$381();
18915
+ var _el$0 = _tmpl$380();
18947
18916
  insert(_el$0, error);
18948
18917
  return _el$0;
18949
18918
  }
@@ -18964,7 +18933,7 @@ function AffiliateLogin(props) {
18964
18933
  return props.onNavigateRegister;
18965
18934
  },
18966
18935
  get children() {
18967
- var _el$11 = _tmpl$382();
18936
+ var _el$11 = _tmpl$381();
18968
18937
  _el$11.$$click = () => props.onNavigateRegister?.();
18969
18938
  return _el$11;
18970
18939
  }
@@ -19012,9 +18981,9 @@ function inputStyle3() {
19012
18981
  };
19013
18982
  }
19014
18983
  delegateEvents(["input", "click"]);
19015
- var _tmpl$383 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
18984
+ var _tmpl$382 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19016
18985
  var _tmpl$2120 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>Email</span><input type=email required></label><button type=submit style="padding:0.75rem 1rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600">`);
19017
- var _tmpl$384 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Reset your password`);
18986
+ var _tmpl$383 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Reset your password`);
19018
18987
  var _tmpl$458 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-surface-light);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19019
18988
  function ForgotPasswordPage(props) {
19020
18989
  const [email, setEmail] = createSignal("");
@@ -19039,7 +19008,7 @@ function ForgotPasswordPage(props) {
19039
19008
  }
19040
19009
  }
19041
19010
  return (() => {
19042
- var _el$ = _tmpl$384(), _el$2 = _el$.firstChild; _el$2.firstChild;
19011
+ var _el$ = _tmpl$383(), _el$2 = _el$.firstChild; _el$2.firstChild;
19043
19012
  insert(_el$2, createComponent(Show, {
19044
19013
  get when() {
19045
19014
  return !message();
@@ -19060,7 +19029,7 @@ function ForgotPasswordPage(props) {
19060
19029
  return error();
19061
19030
  },
19062
19031
  get children() {
19063
- var _el$8 = _tmpl$383();
19032
+ var _el$8 = _tmpl$382();
19064
19033
  insert(_el$8, error);
19065
19034
  return _el$8;
19066
19035
  }
@@ -19110,9 +19079,9 @@ function inputStyle4() {
19110
19079
  };
19111
19080
  }
19112
19081
  delegateEvents(["input"]);
19113
- var _tmpl$385 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19082
+ var _tmpl$384 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-danger-bg);color:var(--app-affiliate-danger-fg);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19114
19083
  var _tmpl$2121 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>New password</span><input type=password required autocomplete=new-password></label><label style=display:flex;flex-direction:column;gap:0.35rem><span>Confirm password</span><input type=password required autocomplete=new-password></label><button type=submit style="padding:0.75rem 1rem;background:var(--app-affiliate-primary);color:var(--app-affiliate-primary-fg);border:none;border-radius:var(--app-affiliate-radius-sm);font-weight:600">`);
19115
- var _tmpl$386 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Choose a new password`);
19084
+ var _tmpl$385 = /* @__PURE__ */ template(`<div class=app-affiliate-root style="background:var(--app-affiliate-bg);color:var(--app-affiliate-fg);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem 1rem"><div style="width:100%;max-width:24rem;background:var(--app-affiliate-surface);border:1px solid var(--app-affiliate-border);border-radius:var(--app-affiliate-radius);padding:2rem;display:flex;flex-direction:column;gap:1.25rem"><h1 style=font-family:var(--app-affiliate-font-display);margin:0;font-size:1.5rem>Choose a new password`);
19116
19085
  var _tmpl$459 = /* @__PURE__ */ template(`<div style="padding:0.625rem 0.875rem;background:var(--app-affiliate-surface-light);border-radius:var(--app-affiliate-radius-sm);font-size:0.875rem">`);
19117
19086
  function queryParam(name) {
19118
19087
  if (typeof window === "undefined") return "";
@@ -19153,7 +19122,7 @@ function ResetPasswordPage(props) {
19153
19122
  }
19154
19123
  }
19155
19124
  return (() => {
19156
- var _el$ = _tmpl$386(), _el$2 = _el$.firstChild; _el$2.firstChild;
19125
+ var _el$ = _tmpl$385(), _el$2 = _el$.firstChild; _el$2.firstChild;
19157
19126
  insert(_el$2, createComponent(Show, {
19158
19127
  get when() {
19159
19128
  return !message();
@@ -19175,7 +19144,7 @@ function ResetPasswordPage(props) {
19175
19144
  return error();
19176
19145
  },
19177
19146
  get children() {
19178
- var _el$1 = _tmpl$385();
19147
+ var _el$1 = _tmpl$384();
19179
19148
  insert(_el$1, error);
19180
19149
  return _el$1;
19181
19150
  }
@@ -19230,9 +19199,9 @@ function inputStyle5() {
19230
19199
  };
19231
19200
  }
19232
19201
  delegateEvents(["input"]);
19233
- var _tmpl$387 = /* @__PURE__ */ template(`<div>`);
19202
+ var _tmpl$386 = /* @__PURE__ */ template(`<div>`);
19234
19203
  var _tmpl$2122 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>Email</span><input type=email required autocomplete=email></label><button type=submit>`);
19235
- var _tmpl$388 = /* @__PURE__ */ template(`<button type=button>Back to login`);
19204
+ var _tmpl$387 = /* @__PURE__ */ template(`<button type=button>Back to login`);
19236
19205
  var _tmpl$460 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Reset your password`);
19237
19206
  var _tmpl$549 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>`);
19238
19207
  function AffiliateForgotPassword(props) {
@@ -19278,7 +19247,7 @@ function AffiliateForgotPassword(props) {
19278
19247
  return error();
19279
19248
  },
19280
19249
  get children() {
19281
- var _el$8 = _tmpl$387();
19250
+ var _el$8 = _tmpl$386();
19282
19251
  insert(_el$8, error);
19283
19252
  effect((_$p) => style(_el$8, errorStyle(), _$p));
19284
19253
  return _el$8;
@@ -19307,7 +19276,7 @@ function AffiliateForgotPassword(props) {
19307
19276
  return props.onNavigateLogin;
19308
19277
  },
19309
19278
  get children() {
19310
- var _el$0 = _tmpl$388();
19279
+ var _el$0 = _tmpl$387();
19311
19280
  _el$0.$$click = () => props.onNavigateLogin?.();
19312
19281
  effect((_$p) => style(_el$0, linkStyle2(), _$p));
19313
19282
  return _el$0;
@@ -19413,9 +19382,9 @@ function linkStyle2() {
19413
19382
  };
19414
19383
  }
19415
19384
  delegateEvents(["input", "click"]);
19416
- var _tmpl$389 = /* @__PURE__ */ template(`<div>`);
19385
+ var _tmpl$388 = /* @__PURE__ */ template(`<div>`);
19417
19386
  var _tmpl$2123 = /* @__PURE__ */ template(`<form style=display:flex;flex-direction:column;gap:0.875rem><label style=display:flex;flex-direction:column;gap:0.35rem><span>New password</span></label><label style=display:flex;flex-direction:column;gap:0.35rem><span>Confirm new password</span></label><button type=submit>`);
19418
- var _tmpl$390 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Choose a new password`);
19387
+ var _tmpl$389 = /* @__PURE__ */ template(`<div class=app-affiliate-root><div><h1>Choose a new password`);
19419
19388
  var _tmpl$461 = /* @__PURE__ */ template(`<p style=margin:0;font-size:0.9rem>Your password has been reset. You can now log in with your new password.`);
19420
19389
  function queryParam2(name) {
19421
19390
  if (typeof window === "undefined") return "";
@@ -19460,7 +19429,7 @@ function AffiliateResetPassword(props) {
19460
19429
  }
19461
19430
  }
19462
19431
  return (() => {
19463
- var _el$ = _tmpl$390(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
19432
+ var _el$ = _tmpl$389(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
19464
19433
  insert(_el$2, createComponent(Show, {
19465
19434
  get when() {
19466
19435
  return !done();
@@ -19494,7 +19463,7 @@ function AffiliateResetPassword(props) {
19494
19463
  return error();
19495
19464
  },
19496
19465
  get children() {
19497
- var _el$9 = _tmpl$389();
19466
+ var _el$9 = _tmpl$388();
19498
19467
  insert(_el$9, error);
19499
19468
  effect((_$p) => style(_el$9, errorStyle2(), _$p));
19500
19469
  return _el$9;
@@ -19593,5 +19562,5 @@ function primaryButtonStyle2(submitting) {
19593
19562
  }
19594
19563
 
19595
19564
  export { AddressFields, AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod };
19596
- //# sourceMappingURL=ID67FV6R.js.map
19597
- //# sourceMappingURL=ID67FV6R.js.map
19565
+ //# sourceMappingURL=MN4GWQC4.js.map
19566
+ //# sourceMappingURL=MN4GWQC4.js.map