@photonhealth/elements 0.6.0 → 0.7.0-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -47,7 +47,7 @@ function ee(e, t, n) {
47
47
  const r = Rc(e, t, !1, Ur);
48
48
  da(r);
49
49
  }
50
- function me(e, t, n) {
50
+ function pe(e, t, n) {
51
51
  _g = k7;
52
52
  const r = Rc(e, t, !1, Ur);
53
53
  r.user = !0, Rr ? Rr.push(r) : da(r);
@@ -72,7 +72,7 @@ function ce(e) {
72
72
  }
73
73
  }
74
74
  function Ze(e) {
75
- me(() => ce(e));
75
+ pe(() => ce(e));
76
76
  }
77
77
  function Sn(e) {
78
78
  return Et === null || (Et.cleanups === null ? Et.cleanups = [e] : Et.cleanups.push(e)), e;
@@ -11390,7 +11390,7 @@ function Qw({ stores: e, config: t, validateErrors: n, validateWarnings: r, _get
11390
11390
  function ne(R) {
11391
11391
  return async function(re) {
11392
11392
  var Z, te, z, _e, Te, je, ae;
11393
- const { createErrorEvent: Ee, createSubmitEvent: Ce, createSuccessEvent: pe } = Hw(), xe = Ce();
11393
+ const { createErrorEvent: Ee, createSubmitEvent: Ce, createSuccessEvent: me } = Hw(), xe = Ce();
11394
11394
  a?.dispatchEvent(xe);
11395
11395
  const ke = (te = (Z = xe.onError) !== null && Z !== void 0 ? Z : R?.onError) !== null && te !== void 0 ? te : t.onError, Me = (_e = (z = xe.onSuccess) !== null && z !== void 0 ? z : R?.onSuccess) !== null && _e !== void 0 ? _e : t.onSuccess, ue = (ae = (je = (Te = xe.onSubmit) !== null && Te !== void 0 ? Te : R?.onSubmit) !== null && je !== void 0 ? je : t.onSubmit) !== null && ae !== void 0 ? ae : qw(a);
11396
11396
  if (!ue || (re?.preventDefault(), xe.defaultPrevented))
@@ -11427,7 +11427,7 @@ function Qw({ stores: e, config: t, validateErrors: n, validateWarnings: r, _get
11427
11427
  };
11428
11428
  try {
11429
11429
  const Xe = await ue(K, bt);
11430
- a?.dispatchEvent(pe(Object.assign({ response: Xe }, bt))), await Me?.(Xe, bt);
11430
+ a?.dispatchEvent(me(Object.assign({ response: Xe }, bt))), await Me?.(Xe, bt);
11431
11431
  } catch (Xe) {
11432
11432
  const hn = Ee(Object.assign({ error: Xe }, bt));
11433
11433
  if (a?.dispatchEvent(hn), !ke && !hn.defaultPrevented)
@@ -11594,7 +11594,7 @@ function Kw({ helpers: e, stores: t, config: n, extender: r, createSubmitHandler
11594
11594
  function Ce(ue) {
11595
11595
  !Array.from(ue.addedNodes).some((K) => x1(K) ? Ut(K) ? !0 : E1(K).length > 0 : !1) || je();
11596
11596
  }
11597
- function pe(ue) {
11597
+ function me(ue) {
11598
11598
  for (const K of ue.removedNodes) {
11599
11599
  if (!x1(K))
11600
11600
  continue;
@@ -11604,7 +11604,7 @@ function Kw({ helpers: e, stores: t, config: n, extender: r, createSubmitHandler
11604
11604
  }
11605
11605
  function xe(ue) {
11606
11606
  for (const K of ue)
11607
- K.type === "childList" && (K.addedNodes.length > 0 && Ce(K), K.removedNodes.length > 0 && pe(K));
11607
+ K.type === "childList" && (K.addedNodes.length > 0 && Ce(K), K.removedNodes.length > 0 && me(K));
11608
11608
  }
11609
11609
  const ke = new MutationObserver(xe);
11610
11610
  ke.observe(Q, _e), Q.addEventListener("input", re), Q.addEventListener("change", Z), Q.addEventListener("focusout", te), Q.addEventListener("submit", o), Q.addEventListener("reset", z);
@@ -11726,7 +11726,7 @@ function n_(e, t) {
11726
11726
  return Te ? !ds(lt, (xt) => Array.isArray(xt) ? xt.length >= 1 : !!xt) : (Te = !0, !t.validate && !(!((_t = t.debounced) === null || _t === void 0) && _t.validate));
11727
11727
  }, !t.validate && !(!((n = t.debounced) === null || n === void 0) && n.validate));
11728
11728
  delete je.set, delete je.update;
11729
- const Ce = e(!1), pe = e(!1), xe = e(null), ke = $(P), Me = $(V), ue = $(A), K = $(W), be = Td(ue, (a = (i = (r = t.debounced) === null || r === void 0 ? void 0 : r.validateTimeout) !== null && i !== void 0 ? i : (o = t.debounced) === null || o === void 0 ? void 0 : o.timeout) !== null && a !== void 0 ? a : 300, {
11729
+ const Ce = e(!1), me = e(!1), xe = e(null), ke = $(P), Me = $(V), ue = $(A), K = $(W), be = Td(ue, (a = (i = (r = t.debounced) === null || r === void 0 ? void 0 : r.validateTimeout) !== null && i !== void 0 ? i : (o = t.debounced) === null || o === void 0 ? void 0 : o.timeout) !== null && a !== void 0 ? a : 300, {
11730
11730
  onInit: () => {
11731
11731
  y.update((lt) => lt + 1);
11732
11732
  },
@@ -11788,7 +11788,7 @@ function n_(e, t) {
11788
11788
  touched: p,
11789
11789
  isValid: je,
11790
11790
  isSubmitting: Ce,
11791
- isDirty: pe,
11791
+ isDirty: me,
11792
11792
  isValidating: v,
11793
11793
  interacted: xe,
11794
11794
  validateErrors: bt,
@@ -11925,7 +11925,7 @@ function o_(e) {
11925
11925
  const [o] = n[i.toString()];
11926
11926
  return o();
11927
11927
  }
11928
- return me(() => {
11928
+ return pe(() => {
11929
11929
  const i = e(), o = Object.keys(t);
11930
11930
  for (const a of o) {
11931
11931
  const s = t[a], l = qp(i, s), [d, c] = n[s.toString()];
@@ -11935,7 +11935,7 @@ function o_(e) {
11935
11935
  }
11936
11936
  function a_(e) {
11937
11937
  return function(t) {
11938
- return Do((n) => (me(() => t(e())), n));
11938
+ return Do((n) => (pe(() => t(e())), n));
11939
11939
  };
11940
11940
  }
11941
11941
  const s_ = (e) => {
@@ -17613,11 +17613,11 @@ function _M(e) {
17613
17613
  setLoading: r,
17614
17614
  setDisabled: i
17615
17615
  }] = wn(hf), o = e.error ? `${t.id}-error` : e.helpText ? `${t.id}-help` : void 0;
17616
- me(() => {
17616
+ pe(() => {
17617
17617
  n(e.error || "");
17618
- }), me(() => {
17618
+ }), pe(() => {
17619
17619
  r(e.loading || !1);
17620
- }), me(() => {
17620
+ }), pe(() => {
17621
17621
  i(e.disabled || !1);
17622
17622
  });
17623
17623
  const a = H(() => typeof e.label == "string"), s = H(() => typeof e?.contextText == "string");
@@ -17724,7 +17724,7 @@ function pn(e) {
17724
17724
  const u = c.currentTarget;
17725
17725
  !isNaN(u.valueAsNumber) && typeof r.onInput == "function" && r.onInput(c);
17726
17726
  };
17727
- return me(() => {
17727
+ return pe(() => {
17728
17728
  o() && setTimeout(() => {
17729
17729
  a(!1);
17730
17730
  }, 1e3);
@@ -17869,7 +17869,7 @@ function NM(e) {
17869
17869
  }
17870
17870
  function Es(e) {
17871
17871
  let [t, n] = U();
17872
- return me(() => {
17872
+ return pe(() => {
17873
17873
  let r = t();
17874
17874
  r && "ref" in e && NM(e.ref) && e.ref(r);
17875
17875
  }), [t, n];
@@ -18141,7 +18141,7 @@ function KM(e, t, n, r) {
18141
18141
  var mn = KM, YM = Ss("button");
18142
18142
  function g6(e) {
18143
18143
  let [t, n] = Es(e);
18144
- return me(() => {
18144
+ return pe(() => {
18145
18145
  let r = t();
18146
18146
  r instanceof HTMLElement && r.tagName !== "BUTTON" && mn(r, "keydown", (i) => {
18147
18147
  switch (i.key) {
@@ -18286,7 +18286,7 @@ function hD(e) {
18286
18286
  } })) : PM(Fe(e, { onChange(l) {
18287
18287
  e.onSelectChange && e.onSelectChange(l);
18288
18288
  } })), s = nD();
18289
- return me(() => {
18289
+ return pe(() => {
18290
18290
  o.isOpen() ? s.save() : s.load();
18291
18291
  }), g($6.Provider, { value: { get multiple() {
18292
18292
  return e.multiple;
@@ -18305,7 +18305,7 @@ function hD(e) {
18305
18305
  }
18306
18306
  function fD(e) {
18307
18307
  let t = yf("ListboxButton"), n = ou(), r = pf(), [i, o] = Es(e), a = () => n.disabled() || e.disabled;
18308
- return me(() => {
18308
+ return pe(() => {
18309
18309
  let s = i();
18310
18310
  s instanceof HTMLElement && (t.anchor = s, mn(s, "click", () => {
18311
18311
  a() || n.toggle();
@@ -18375,7 +18375,7 @@ function bD(e) {
18375
18375
  a.setFirstMatch(l);
18376
18376
  });
18377
18377
  return Ze(() => {
18378
- me(() => {
18378
+ pe(() => {
18379
18379
  let l = i();
18380
18380
  l instanceof HTMLElement && r.isOpen() && (a.setRef(l), Sn(() => {
18381
18381
  a.clearRef();
@@ -18482,7 +18482,7 @@ function _D(e) {
18482
18482
  h.addEventListener("transitionend", _, { once: !0 }), h.addEventListener("animationend", _, { once: !0 });
18483
18483
  }
18484
18484
  }
18485
- return me(() => {
18485
+ return pe(() => {
18486
18486
  let h = t.show;
18487
18487
  h && s(!0);
18488
18488
  let f = l();
@@ -18965,9 +18965,9 @@ Hn.remove = (e) => {
18965
18965
  toastId: e
18966
18966
  });
18967
18967
  };
18968
- const KD = /* @__PURE__ */ b("<div><style>.sldt-active{z-index:9999;}.sldt-active>*{pointer-events:auto;}</style></div>"), YD = (e) => (me(() => {
18968
+ const KD = /* @__PURE__ */ b("<div><style>.sldt-active{z-index:9999;}.sldt-active>*{pointer-events:auto;}</style></div>"), YD = (e) => (pe(() => {
18969
18969
  jD(e);
18970
- }), me(() => {
18970
+ }), pe(() => {
18971
18971
  const t = DD();
18972
18972
  Sn(() => {
18973
18973
  !t || t.forEach((n) => n && clearTimeout(n));
@@ -18993,7 +18993,7 @@ const KD = /* @__PURE__ */ b("<div><style>.sldt-active{z-index:9999;}.sldt-activ
18993
18993
  }), t;
18994
18994
  })()), nl = /* @__PURE__ */ b("<div></div>"), ZD = /* @__PURE__ */ b("<div><div></div></div>"), XD = (e) => {
18995
18995
  let t;
18996
- return me(() => {
18996
+ return pe(() => {
18997
18997
  if (!t)
18998
18998
  return;
18999
18999
  const n = HD(e.toast, e.position);
@@ -19500,7 +19500,7 @@ function ga(e) {
19500
19500
  "sm:max-w-lg": t.size === "lg",
19501
19501
  "sm:max-w-sm": t.size === "md"
19502
19502
  }));
19503
- return me(() => {
19503
+ return pe(() => {
19504
19504
  window?.zE && (t.open ? window.zE("messenger", "hide") : window.zE("messenger", "show"));
19505
19505
  }), (() => {
19506
19506
  const r = EF.cloneNode(!0);
@@ -19693,7 +19693,7 @@ function RF(e) {
19693
19693
  TF(l, () => {
19694
19694
  n(!1);
19695
19695
  });
19696
- }), me(() => {
19696
+ }), pe(() => {
19697
19697
  t.selected && s(e.displayValue(t.selected)), t.typing && s(""), t.open || s(e.displayValue(t.selected) || "");
19698
19698
  }), [(() => {
19699
19699
  const d = O6.cloneNode(!0), c = l;
@@ -19728,9 +19728,9 @@ function zF(e) {
19728
19728
  }] = T6();
19729
19729
  return Ze(() => {
19730
19730
  e.value && n(e.value), e.setSelected && e.setSelected(t.selected);
19731
- }), me(() => {
19731
+ }), pe(() => {
19732
19732
  t.selected && e.setSelected?.(t.selected);
19733
- }), me(() => {
19733
+ }), pe(() => {
19734
19734
  e.value && n(e.value);
19735
19735
  }), (() => {
19736
19736
  const r = MF.cloneNode(!0);
@@ -26974,7 +26974,7 @@ var $f = { exports: {} }, I6 = { exports: {} };
26974
26974
  "+": "+",
26975
26975
  "*": "*",
26976
26976
  "#": "#"
26977
- }, pe = {
26977
+ }, me = {
26978
26978
  0: "0",
26979
26979
  1: "1",
26980
26980
  2: "2",
@@ -27053,7 +27053,7 @@ var $f = { exports: {} }, I6 = { exports: {} };
27053
27053
  return 2 > m.length ? !1 : gr(xi, m);
27054
27054
  }
27055
27055
  function _t(m) {
27056
- return gr(bt, m) ? er(m, pe) : er(m, Ee);
27056
+ return gr(bt, m) ? er(m, me) : er(m, Ee);
27057
27057
  }
27058
27058
  function xt(m) {
27059
27059
  var w = _t(m.toString());
@@ -27813,7 +27813,7 @@ function NR(e) {
27813
27813
  });
27814
27814
  s?.patient && r(s?.patient);
27815
27815
  };
27816
- me(() => {
27816
+ pe(() => {
27817
27817
  e.patientId && i();
27818
27818
  });
27819
27819
  const o = H(() => e.address || n()?.address), a = H(() => {
@@ -28190,9 +28190,9 @@ function QR(e) {
28190
28190
  }
28191
28191
  });
28192
28192
  };
28193
- return me(() => {
28193
+ return pe(() => {
28194
28194
  e.patientId && o();
28195
- }), me(() => {
28195
+ }), pe(() => {
28196
28196
  e?.newMedication?.id && a(e.newMedication.id);
28197
28197
  }), g(En, {
28198
28198
  get children() {
@@ -28380,7 +28380,7 @@ function tz(e) {
28380
28380
  const p = await YR(t(), c);
28381
28381
  l(p);
28382
28382
  };
28383
- return me(() => {
28383
+ return pe(() => {
28384
28384
  t() && f();
28385
28385
  }), g(ga, {
28386
28386
  get open() {
@@ -28582,11 +28582,11 @@ function L6(e) {
28582
28582
  const L = l() || [], V = [...c().filter((I) => L.some((ne) => ne.id === I.id)), ...L], W = V.map((I) => I.id);
28583
28583
  return V.filter((I, ne) => W.indexOf(I.id) === ne);
28584
28584
  });
28585
- me(() => {
28585
+ pe(() => {
28586
28586
  a()?.latitude && a()?.longitude && (d(null), f(!0), N());
28587
28587
  });
28588
28588
  const G = H(() => A() === null || A()?.length === 0 ? [] : i() === "" ? A() : A()?.filter((L) => L.name.toLowerCase().includes(i().toLowerCase())) || []);
28589
- me(() => {
28589
+ pe(() => {
28590
28590
  n()?.id && (o(""), e?.setPharmacy?.(n()));
28591
28591
  });
28592
28592
  const B = (L) => `${a0(L.address?.street1 || "")}, ${a0(L.address?.city || "")}, ${L.address?.state}`;
@@ -28601,9 +28601,9 @@ function L6(e) {
28601
28601
  $(L), e?.address && Q(e.address || "", L);
28602
28602
  }
28603
28603
  });
28604
- }), me(() => {
28604
+ }), pe(() => {
28605
28605
  e?.patientId && P(e?.patientId);
28606
- }), me(() => {
28606
+ }), pe(() => {
28607
28607
  e?.address && (f(!0), Q(e.address, _()));
28608
28608
  }), (() => {
28609
28609
  const L = az.cloneNode(!0);
@@ -29919,7 +29919,7 @@ const Vz = /* @__PURE__ */ b('<div class="mr-1"></div>'), Uz = {
29919
29919
  };
29920
29920
  function Kz(e) {
29921
29921
  const [t, n] = U(""), [r, i] = U("gray"), [o, a] = U(), [s, l] = U("");
29922
- return me(() => {
29922
+ return pe(() => {
29923
29923
  if (e.orderState === "PLACED" && e.fulfillmentState) {
29924
29924
  const d = e.fulfillmentState;
29925
29925
  n(Hz?.[d]), l(qz[d] || t), i(Qz[d] || r());
@@ -30660,7 +30660,7 @@ function Lr(e) {
30660
30660
  });
30661
30661
  }
30662
30662
  }
30663
- return me(() => {
30663
+ return pe(() => {
30664
30664
  e.patientId && o();
30665
30665
  }), g(j6.Provider, {
30666
30666
  value: i,
@@ -30763,9 +30763,9 @@ const $j = (e) => g(YD, {
30763
30763
  });
30764
30764
  t?.dispatchEvent(l);
30765
30765
  };
30766
- me(() => {
30766
+ pe(() => {
30767
30767
  n().status === "COMPLETE" && o();
30768
- }), me(() => {
30768
+ }), pe(() => {
30769
30769
  i();
30770
30770
  });
30771
30771
  const s = async () => {
@@ -31171,11 +31171,9 @@ class Vj {
31171
31171
  authentication;
31172
31172
  getSDK;
31173
31173
  clinical;
31174
- autoLogin;
31175
- redirectPath;
31176
- constructor(t, n, r) {
31177
- this.sdk = t, this.autoLogin = n, this.redirectPath = r;
31178
- const [i, o] = wi({
31174
+ constructor(t) {
31175
+ this.sdk = t;
31176
+ const [n, r] = wi({
31179
31177
  authentication: {
31180
31178
  isAuthenticated: !1,
31181
31179
  isInOrg: !1,
@@ -31213,24 +31211,24 @@ class Vj {
31213
31211
  data: void 0
31214
31212
  }
31215
31213
  });
31216
- this.setStore = o, this.store = i, this.authentication = {
31217
- state: i.authentication,
31218
- handleRedirect: async (a) => {
31214
+ this.setStore = r, this.store = n, this.authentication = {
31215
+ state: n.authentication,
31216
+ handleRedirect: async (i) => {
31219
31217
  try {
31220
- const s = await this.sdk.authentication.handleRedirect(a);
31221
- zj(s?.appState);
31222
- } catch (s) {
31223
- const d = new URLSearchParams(window.location.search).get("error_description");
31224
- s.message.includes("must be an organization id") ? this.setStore("authentication", {
31218
+ const o = await this.sdk.authentication.handleRedirect(i);
31219
+ zj(o?.appState);
31220
+ } catch (o) {
31221
+ const s = new URLSearchParams(window.location.search).get("error_description");
31222
+ o.message.includes("must be an organization id") ? this.setStore("authentication", {
31225
31223
  ...this.store.authentication,
31226
31224
  error: "The provided organization id is invalid or does not exist"
31227
- }) : d?.includes("is not part of the org") ? this.setStore("authentication", {
31225
+ }) : s?.includes("is not part of the org") ? this.setStore("authentication", {
31228
31226
  ...this.store.authentication,
31229
31227
  error: "User is not authorized",
31230
31228
  isLoading: !1
31231
31229
  }) : this.setStore("authentication", {
31232
31230
  ...this.store.authentication,
31233
- error: s.message
31231
+ error: o.message
31234
31232
  });
31235
31233
  }
31236
31234
  },
@@ -31239,27 +31237,27 @@ class Vj {
31239
31237
  logout: this.logout.bind(this)
31240
31238
  }, this.getSDK = this._getSDK.bind(this), this.clinical = {
31241
31239
  catalog: {
31242
- state: i.catalog,
31240
+ state: n.catalog,
31243
31241
  getCatalog: this.getCatalog.bind(this)
31244
31242
  },
31245
31243
  catalogs: {
31246
- state: i.catalogs,
31244
+ state: n.catalogs,
31247
31245
  getCatalogs: this.getCatalogs.bind(this)
31248
31246
  },
31249
31247
  dispenseUnits: {
31250
- state: i.dispenseUnits,
31248
+ state: n.dispenseUnits,
31251
31249
  getDispenseUnits: this.getDispenseUnits.bind(this)
31252
31250
  },
31253
31251
  patients: {
31254
- state: i.patients,
31252
+ state: n.patients,
31255
31253
  getPatients: this.getPatients.bind(this)
31256
31254
  },
31257
31255
  patient: {
31258
- state: i.patient,
31256
+ state: n.patient,
31259
31257
  getPatient: this.getPatient.bind(this)
31260
31258
  },
31261
31259
  prescription: {
31262
- state: i.prescription,
31260
+ state: n.prescription,
31263
31261
  createPrescription: this.createPrescription.bind(this)
31264
31262
  }
31265
31263
  };
@@ -31271,11 +31269,6 @@ class Vj {
31271
31269
  try {
31272
31270
  await this.sdk.authentication.checkSession();
31273
31271
  const t = await this.sdk.authentication.isAuthenticated();
31274
- if (this.autoLogin && !t) {
31275
- const o = { appState: {} };
31276
- this.redirectPath && (o.appState.returnTo = this.redirectPath), await this.authentication.login(o);
31277
- return;
31278
- }
31279
31272
  this.setStore("authentication", {
31280
31273
  ...this.store.authentication,
31281
31274
  isAuthenticated: t
@@ -31421,7 +31414,7 @@ class Vj {
31421
31414
  }
31422
31415
  }
31423
31416
  }
31424
- const Uj = /[?&]code=[^&]+/, Bj = /[?&]state=[^&]+/, Hj = /[?&]error=[^&]+/, qj = (e = window.location.search) => (Uj.test(e) || Hj.test(e)) && Bj.test(e), Wj = (e) => /^\d+$/.test(e) && e.length >= 5, G6 = Fn(), Nn = () => wn(G6), Gj = "@photonhealth/elements", Qj = "0.6.0", Kj = "", Yj = "dist/index.js", Zj = "./dist/index.d.ts", Xj = {
31417
+ const Uj = /[?&]code=[^&]+/, Bj = /[?&]state=[^&]+/, Hj = /[?&]error=[^&]+/, qj = (e = window.location.search) => (Uj.test(e) || Hj.test(e)) && Bj.test(e), Wj = (e) => /^\d+$/.test(e) && e.length >= 5, G6 = Fn(), Nn = () => wn(G6), Gj = "@photonhealth/elements", Qj = "0.7.0-rc1", Kj = "", Yj = "dist/index.js", Zj = "./dist/index.d.ts", Xj = {
31425
31418
  start: "vite --port 3000",
31426
31419
  build: "rimraf dist && NODE_ENV=development vite build",
31427
31420
  "build:prod": "npx nx run elements:build",
@@ -31594,7 +31587,7 @@ st("photon-client", {
31594
31587
  redirectURI: e.redirectUri ? e.redirectUri : window.location.origin,
31595
31588
  organization: e.org,
31596
31589
  developmentMode: e.developmentMode
31597
- }, uV), r = new Vj(n, e.autoLogin, e.redirectPath);
31590
+ }, uV), r = new Vj(n);
31598
31591
  e.developmentMode && console.info("[PhotonClient]: Development mode enabled");
31599
31592
  const [i] = U(r), o = async () => {
31600
31593
  await i()?.authentication.handleRedirect(), e.redirectPath && window.location.replace(e.redirectPath);
@@ -31603,9 +31596,9 @@ st("photon-client", {
31603
31596
  await i()?.authentication.checkSession();
31604
31597
  }, 6e4, setInterval);
31605
31598
  };
31606
- return me(() => {
31599
+ return pe(() => {
31607
31600
  qj() && i() ? o() : i() && a();
31608
- }), me(() => {
31601
+ }), pe(() => {
31609
31602
  if (!i()?.authentication.state.isLoading && e.externalUserId != null && i().authentication.state.user.sub?.split("|").reverse()[0] !== e.externalUserId) {
31610
31603
  i()?.authentication.logout();
31611
31604
  const s = {
@@ -31613,6 +31606,13 @@ st("photon-client", {
31613
31606
  };
31614
31607
  e.redirectPath && (s.appState.returnTo = e.redirectPath), i()?.authentication.login(s);
31615
31608
  }
31609
+ }), pe(() => {
31610
+ if (!i()?.authentication.state.isLoading && !i()?.authentication.state.isAuthenticated && e.autoLogin) {
31611
+ const s = {
31612
+ appState: {}
31613
+ };
31614
+ e.redirectPath && (s.appState.returnTo = e.redirectPath), i()?.authentication.login(s);
31615
+ }
31616
31616
  }), (() => {
31617
31617
  const s = cV.cloneNode(!0), l = t;
31618
31618
  return typeof l == "function" ? He(l, s) : t = s, O(s, g(G6.Provider, {
@@ -31643,7 +31643,7 @@ st("photon-auth-button", {
31643
31643
  }
31644
31644
  }, (e) => {
31645
31645
  const t = Nn();
31646
- return me(() => {
31646
+ return pe(() => {
31647
31647
  t || console.error("[photon-auth-button] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element");
31648
31648
  }), [(() => {
31649
31649
  const n = hV.cloneNode(!0);
@@ -31670,7 +31670,7 @@ st("photon-login", {
31670
31670
  }
31671
31671
  }, (e) => {
31672
31672
  const t = Nn();
31673
- return me(() => {
31673
+ return pe(() => {
31674
31674
  t || console.error("[photon-login] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element");
31675
31675
  }), [(() => {
31676
31676
  const n = pV.cloneNode(!0);
@@ -35492,9 +35492,9 @@ const _i = (e) => {
35492
35492
  }, 250), x = new IntersectionObserver(async (N) => {
35493
35493
  N?.at(-1)?.isIntersecting && e.hasMore && e.fetchMore && await e.fetchMore();
35494
35494
  });
35495
- me(() => {
35495
+ pe(() => {
35496
35496
  e.data.length === 0 && d(void 0);
35497
- }), me(() => {
35497
+ }), pe(() => {
35498
35498
  p() && x.observe(p());
35499
35499
  });
35500
35500
  const _ = (N) => {
@@ -35517,9 +35517,9 @@ const _i = (e) => {
35517
35517
  });
35518
35518
  t?.dispatchEvent(N);
35519
35519
  };
35520
- me(() => {
35520
+ pe(() => {
35521
35521
  e.selectedData && (d(e.selectedData), $(e.selectedData)), e.selectedData === void 0 && d(void 0);
35522
- }), me(() => {
35522
+ }), pe(() => {
35523
35523
  const N = e.data.length * 36.8;
35524
35524
  r.style.minHeight = `${N}px`;
35525
35525
  const P = c4({
@@ -35545,11 +35545,11 @@ const _i = (e) => {
35545
35545
  return () => ae() ? (() => {
35546
35546
  const Ee = VU.cloneNode(!0), Ce = Ee.firstChild;
35547
35547
  return O(Ce, () => e.label), O(Ee, (() => {
35548
- const pe = H(() => !!e.required);
35549
- return () => pe() ? UU.cloneNode(!0) : null;
35548
+ const me = H(() => !!e.required);
35549
+ return () => me() ? UU.cloneNode(!0) : null;
35550
35550
  })(), null), O(Ee, (() => {
35551
- const pe = H(() => !!e.optional);
35552
- return () => pe() ? BU.cloneNode(!0) : null;
35551
+ const me = H(() => !!e.optional);
35552
+ return () => me() ? BU.cloneNode(!0) : null;
35553
35553
  })(), null), Ee;
35554
35554
  })() : null;
35555
35555
  })(), Q);
@@ -35593,12 +35593,12 @@ const _i = (e) => {
35593
35593
  children: (ae) => {
35594
35594
  const Ee = ae.index > e.data.length - 1, Ce = e.data[ae.index];
35595
35595
  return (() => {
35596
- const pe = ce(() => document.importNode(w0, !0));
35596
+ const me = ce(() => document.importNode(w0, !0));
35597
35597
  return He((xe) => {
35598
35598
  Ee && ae.index > 0 && y(xe);
35599
- }, pe), pe.$$click = () => {
35599
+ }, me), me.$$click = () => {
35600
35600
  Ee || (d(Ce), u(ae.index), i.value = "", v(""), $(Ce), n.hide());
35601
- }, pe.style.setProperty("width", "100%"), pe._$owner = de(), O(pe, () => Ee ? e.hasMore ? u4.cloneNode(!0) : h4.cloneNode(!0) : (() => {
35601
+ }, me.style.setProperty("width", "100%"), me._$owner = de(), O(me, () => Ee ? e.hasMore ? u4.cloneNode(!0) : h4.cloneNode(!0) : (() => {
35602
35602
  const xe = f4.cloneNode(!0);
35603
35603
  return O(xe, () => e.displayAccessor(Ce, !0)), ee((ke) => {
35604
35604
  const Me = !e.showOverflow, ue = !e.showOverflow, K = !e.showOverflow, be = !!e.showOverflow;
@@ -35611,11 +35611,11 @@ const _i = (e) => {
35611
35611
  }), xe;
35612
35612
  })()), ee((xe) => {
35613
35613
  const ke = Ce && Ce.id === l()?.id && !Ee ? "selected default" : "default", Me = `${ae.size}px`;
35614
- return ke !== xe._v$13 && H0(pe, xe._v$13 = ke), Me !== xe._v$14 && pe.style.setProperty("min-height", xe._v$14 = Me), xe;
35614
+ return ke !== xe._v$13 && H0(me, xe._v$13 = ke), Me !== xe._v$14 && me.style.setProperty("min-height", xe._v$14 = Me), xe;
35615
35615
  }, {
35616
35616
  _v$13: void 0,
35617
35617
  _v$14: void 0
35618
- }), pe;
35618
+ }), me;
35619
35619
  })();
35620
35620
  }
35621
35621
  });
@@ -35637,16 +35637,16 @@ const _i = (e) => {
35637
35637
  return h().getVirtualItems().filter((Ee) => ae.filter(e.data[Ee.index]));
35638
35638
  },
35639
35639
  children: (Ee) => {
35640
- const Ce = Ee.index > e.data.length - 1, pe = e.data[Ee.index];
35640
+ const Ce = Ee.index > e.data.length - 1, me = e.data[Ee.index];
35641
35641
  return (() => {
35642
35642
  const xe = ce(() => document.importNode(w0, !0));
35643
35643
  return He((ke) => {
35644
35644
  Ce && Ee.index > 0 && y(ke);
35645
35645
  }, xe), xe.$$click = () => {
35646
- Ce || (d(pe), u(Ee.index), i.value = "", v(""), $(pe), n.hide());
35646
+ Ce || (d(me), u(Ee.index), i.value = "", v(""), $(me), n.hide());
35647
35647
  }, xe.style.setProperty("width", "100%"), xe._$owner = de(), O(xe, () => Ce ? e.hasMore ? u4.cloneNode(!0) : h4.cloneNode(!0) : (() => {
35648
35648
  const ke = f4.cloneNode(!0);
35649
- return O(ke, () => e.displayAccessor(pe, !0)), ee((Me) => {
35649
+ return O(ke, () => e.displayAccessor(me, !0)), ee((Me) => {
35650
35650
  const ue = !e.showOverflow, K = !e.showOverflow, be = !e.showOverflow, Ne = !!e.showOverflow;
35651
35651
  return ue !== Me._v$21 && ke.classList.toggle("overflow-hidden", Me._v$21 = ue), K !== Me._v$22 && ke.classList.toggle("overflow-ellipsis", Me._v$22 = K), be !== Me._v$23 && ke.classList.toggle("whitespace-nowrap", Me._v$23 = be), Ne !== Me._v$24 && ke.classList.toggle("whitespace-normal", Me._v$24 = Ne), Me;
35652
35652
  }, {
@@ -35656,7 +35656,7 @@ const _i = (e) => {
35656
35656
  _v$24: void 0
35657
35657
  }), ke;
35658
35658
  })()), ee((ke) => {
35659
- const Me = pe && pe.id === l()?.id && !Ce ? "selected default" : "default", ue = `${Ee.size}px`;
35659
+ const Me = me && me.id === l()?.id && !Ce ? "selected default" : "default", ue = `${Ee.size}px`;
35660
35660
  return Me !== ke._v$19 && H0(xe, ke._v$19 = Me), ue !== ke._v$20 && xe.style.setProperty("min-height", ke._v$20 = ue), ke;
35661
35661
  }, {
35662
35662
  _v$19: void 0,
@@ -35684,8 +35684,8 @@ const _i = (e) => {
35684
35684
  return ae._$owner = de(), ae;
35685
35685
  }
35686
35686
  }), null), ee((ae) => {
35687
- const Ee = e.forceLabelSize && !e.invalid ? -20 : e.invalid ? -18 : 0, Ce = e.disabled ?? !1, pe = T(), xe = e.disabled ?? !1, ke = !!(e.invalid ?? !1), Me = !!(e.disabled ?? !1), ue = !l() && i.value === "", K = e.required, be = !!e.forceLabelSize, Ne = !e.isLoading, bt = !!e.isLoading, Xe = a() ? "chevron-up" : "chevron-down";
35688
- return Ee !== ae._v$ && (Q.distance = ae._v$ = Ee), Ce !== ae._v$2 && (Q.disabled = ae._v$2 = Ce), pe !== ae._v$3 && (L.placeholder = ae._v$3 = pe), xe !== ae._v$4 && (L.disabled = ae._v$4 = xe), ke !== ae._v$5 && L.classList.toggle("invalid", ae._v$5 = ke), Me !== ae._v$6 && L.classList.toggle("disabled", ae._v$6 = Me), ue !== ae._v$7 && L.classList.toggle("placeholder", ae._v$7 = ue), K !== ae._v$8 && (L.required = ae._v$8 = K), be !== ae._v$9 && V.classList.toggle("h-[21px]", ae._v$9 = be), Ne !== ae._v$10 && W.classList.toggle("hidden", ae._v$10 = Ne), bt !== ae._v$11 && ne.classList.toggle("hidden", ae._v$11 = bt), Xe !== ae._v$12 && (ie.name = ae._v$12 = Xe), ae;
35687
+ const Ee = e.forceLabelSize && !e.invalid ? -20 : e.invalid ? -18 : 0, Ce = e.disabled ?? !1, me = T(), xe = e.disabled ?? !1, ke = !!(e.invalid ?? !1), Me = !!(e.disabled ?? !1), ue = !l() && i.value === "", K = e.required, be = !!e.forceLabelSize, Ne = !e.isLoading, bt = !!e.isLoading, Xe = a() ? "chevron-up" : "chevron-down";
35688
+ return Ee !== ae._v$ && (Q.distance = ae._v$ = Ee), Ce !== ae._v$2 && (Q.disabled = ae._v$2 = Ce), me !== ae._v$3 && (L.placeholder = ae._v$3 = me), xe !== ae._v$4 && (L.disabled = ae._v$4 = xe), ke !== ae._v$5 && L.classList.toggle("invalid", ae._v$5 = ke), Me !== ae._v$6 && L.classList.toggle("disabled", ae._v$6 = Me), ue !== ae._v$7 && L.classList.toggle("placeholder", ae._v$7 = ue), K !== ae._v$8 && (L.required = ae._v$8 = K), be !== ae._v$9 && V.classList.toggle("h-[21px]", ae._v$9 = be), Ne !== ae._v$10 && W.classList.toggle("hidden", ae._v$10 = Ne), bt !== ae._v$11 && ne.classList.toggle("hidden", ae._v$11 = bt), Xe !== ae._v$12 && (ie.name = ae._v$12 = Xe), ae;
35689
35689
  }, {
35690
35690
  _v$: void 0,
35691
35691
  _v$2: void 0,
@@ -35869,7 +35869,7 @@ st("photon-patient-select", {
35869
35869
  });
35870
35870
  t?.dispatchEvent(d);
35871
35871
  }, s = H(() => r.selectedPatient.data ? [r.selectedPatient.data, ...r.patients.data.filter((l) => l?.id !== r.selectedPatient.data.id)] : r.patients.data);
35872
- return me(async () => {
35872
+ return pe(async () => {
35873
35873
  e.selected && !r.selectedPatient.data && ce(async () => {
35874
35874
  await i.getSelectedPatient(n ? n.getSDK() : e.sdk, e.selected);
35875
35875
  });
@@ -35940,12 +35940,20 @@ st("photon-auth-wrapper", {
35940
35940
  }
35941
35941
  }, (e) => {
35942
35942
  const t = Nn(), [n, r] = U(!1), [i, o] = U(!0);
35943
- return me(() => {
35943
+ return pe(() => {
35944
35944
  t || console.error("[photon-auth-wrapper] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element");
35945
- }), me(() => {
35946
- t?.authentication.state.isLoading ? o(!0) : t?.authentication.checkSession().then(() => {
35947
- o(!1), r(t?.authentication.state.isAuthenticated || !1);
35948
- });
35945
+ }), pe(() => {
35946
+ if (t?.authentication.state.isLoading)
35947
+ o(!0);
35948
+ else {
35949
+ if (o(!1), !t?.authentication.state.isAuthenticated && e.autoLogin) {
35950
+ const a = {
35951
+ appState: {}
35952
+ };
35953
+ e.redirectPath && (a.appState.returnTo = e.redirectPath), t?.authentication.login(a);
35954
+ }
35955
+ r(t?.authentication.state.isAuthenticated || !1);
35956
+ }
35949
35957
  }), [(() => {
35950
35958
  const a = _0.cloneNode(!0);
35951
35959
  return O(a, Mt), a;
@@ -36698,13 +36706,13 @@ const $9 = (e) => {
36698
36706
  const t = Fe({
36699
36707
  permissions: []
36700
36708
  }, e), n = Nn(), [r, i] = U(n?.authentication.state.isLoading || !1), [o, a] = U(n?.authentication.state.isAuthenticated || !1), [s, l] = U(n?.authentication.state.isInOrg || !1), [d, c] = U(g4(t.permissions, n?.authentication.state.permissions || []));
36701
- me(() => {
36709
+ pe(() => {
36702
36710
  i(n?.authentication.state.isLoading || !1);
36703
- }), me(() => {
36711
+ }), pe(() => {
36704
36712
  a(n?.authentication.state.isAuthenticated || !1);
36705
- }), me(() => {
36713
+ }), pe(() => {
36706
36714
  l(n?.authentication.state.isInOrg || !1);
36707
- }), me(() => {
36715
+ }), pe(() => {
36708
36716
  c(g4(t.permissions, n?.authentication.state.permissions || []));
36709
36717
  });
36710
36718
  const u = H(() => o() && s() && d());
@@ -42292,18 +42300,18 @@ function GQ(e, t, n, r) {
42292
42300
  weekStartsOn: Q,
42293
42301
  locale: G
42294
42302
  }, V = [new NH()], W = P.match(UQ).map(function(Ce) {
42295
- var pe = Ce[0];
42296
- if (pe in c2) {
42297
- var xe = c2[pe];
42303
+ var me = Ce[0];
42304
+ if (me in c2) {
42305
+ var xe = c2[me];
42298
42306
  return xe(Ce, G.formatLong);
42299
42307
  }
42300
42308
  return Ce;
42301
42309
  }).join("").match(VQ), I = [], ne = Nm(W), ie;
42302
42310
  try {
42303
42311
  var R = function() {
42304
- var pe = ie.value;
42305
- !(r != null && r.useAdditionalWeekYearTokens) && A9(pe) && Jd(pe, P, e), !(r != null && r.useAdditionalDayOfYearTokens) && P9(pe) && Jd(pe, P, e);
42306
- var xe = pe[0], ke = zQ[xe];
42312
+ var me = ie.value;
42313
+ !(r != null && r.useAdditionalWeekYearTokens) && A9(me) && Jd(me, P, e), !(r != null && r.useAdditionalDayOfYearTokens) && P9(me) && Jd(me, P, e);
42314
+ var xe = me[0], ke = zQ[xe];
42307
42315
  if (ke) {
42308
42316
  var Me = ke.incompatibleTokens;
42309
42317
  if (Array.isArray(Me)) {
@@ -42311,14 +42319,14 @@ function GQ(e, t, n, r) {
42311
42319
  return Me.includes(be.token) || be.token === xe;
42312
42320
  });
42313
42321
  if (ue)
42314
- throw new RangeError("The format string mustn't contain `".concat(ue.fullToken, "` and `").concat(pe, "` at the same time"));
42322
+ throw new RangeError("The format string mustn't contain `".concat(ue.fullToken, "` and `").concat(me, "` at the same time"));
42315
42323
  } else if (ke.incompatibleTokens === "*" && I.length > 0)
42316
- throw new RangeError("The format string mustn't contain `".concat(pe, "` and any other token at the same time"));
42324
+ throw new RangeError("The format string mustn't contain `".concat(me, "` and any other token at the same time"));
42317
42325
  I.push({
42318
42326
  token: xe,
42319
- fullToken: pe
42327
+ fullToken: me
42320
42328
  });
42321
- var K = ke.run(N, pe, G.match, L);
42329
+ var K = ke.run(N, me, G.match, L);
42322
42330
  if (!K)
42323
42331
  return {
42324
42332
  v: new Date(NaN)
@@ -42327,8 +42335,8 @@ function GQ(e, t, n, r) {
42327
42335
  } else {
42328
42336
  if (xe.match(WQ))
42329
42337
  throw new RangeError("Format string contains an unescaped latin alphabet character `" + xe + "`");
42330
- if (pe === "''" ? pe = "'" : xe === "'" && (pe = QQ(pe)), N.indexOf(pe) === 0)
42331
- N = N.slice(pe.length);
42338
+ if (me === "''" ? me = "'" : xe === "'" && (me = QQ(me)), N.indexOf(me) === 0)
42339
+ N = N.slice(me.length);
42332
42340
  else
42333
42341
  return {
42334
42342
  v: new Date(NaN)
@@ -42349,15 +42357,15 @@ function GQ(e, t, n, r) {
42349
42357
  return new Date(NaN);
42350
42358
  var Z = V.map(function(Ce) {
42351
42359
  return Ce.priority;
42352
- }).sort(function(Ce, pe) {
42353
- return pe - Ce;
42354
- }).filter(function(Ce, pe, xe) {
42355
- return xe.indexOf(Ce) === pe;
42360
+ }).sort(function(Ce, me) {
42361
+ return me - Ce;
42362
+ }).filter(function(Ce, me, xe) {
42363
+ return xe.indexOf(Ce) === me;
42356
42364
  }).map(function(Ce) {
42357
- return V.filter(function(pe) {
42358
- return pe.priority === Ce;
42359
- }).sort(function(pe, xe) {
42360
- return xe.subPriority - pe.subPriority;
42365
+ return V.filter(function(me) {
42366
+ return me.priority === Ce;
42367
+ }).sort(function(me, xe) {
42368
+ return xe.subPriority - me.subPriority;
42361
42369
  });
42362
42370
  }).map(function(Ce) {
42363
42371
  return Ce[0];
@@ -43495,8 +43503,8 @@ const aK = {
43495
43503
  onClick: f,
43496
43504
  children: "Add Prescription to Order"
43497
43505
  })), ee((z) => {
43498
- const _e = e.store.treatment?.value ?? void 0, Te = e.store.treatment?.error ?? !1, je = e.store.treatment?.error, ae = i(), Ee = n(), Ce = e.store.effectiveDate?.error ?? !1, pe = e.store.effectiveDate?.error, xe = e.store.dispenseQuantity?.error ?? !1, ke = e.store.dispenseQuantity?.error, Me = e.store.dispenseUnit?.value ?? a()?.name, ue = e.store.daysSupply?.error ?? !1, K = e.store.daysSupply?.error, be = e.store.refillsInput?.error ?? !1, Ne = e.store.refillsInput?.error, bt = e.store.instructions?.error ?? !1, Xe = e.store.instructions?.error;
43499
- return _e !== z._v$3 && (_.selected = z._v$3 = _e), Te !== z._v$4 && (_.invalid = z._v$4 = Te), je !== z._v$5 && (_.helpText = z._v$5 = je), ae !== z._v$6 && (_.offCatalogOption = z._v$6 = ae), Ee !== z._v$7 && (N.open = z._v$7 = Ee), Ce !== z._v$8 && (A.invalid = z._v$8 = Ce), pe !== z._v$9 && (A.helpText = z._v$9 = pe), xe !== z._v$10 && (Q.invalid = z._v$10 = xe), ke !== z._v$11 && (Q.helpText = z._v$11 = ke), Me !== z._v$12 && (W.selected = z._v$12 = Me), ue !== z._v$13 && (ne.invalid = z._v$13 = ue), K !== z._v$14 && (ne.helpText = z._v$14 = K), be !== z._v$15 && (ie.invalid = z._v$15 = be), Ne !== z._v$16 && (ie.helpText = z._v$16 = Ne), bt !== z._v$17 && (R.invalid = z._v$17 = bt), Xe !== z._v$18 && (R.helpText = z._v$18 = Xe), z;
43506
+ const _e = e.store.treatment?.value ?? void 0, Te = e.store.treatment?.error ?? !1, je = e.store.treatment?.error, ae = i(), Ee = n(), Ce = e.store.effectiveDate?.error ?? !1, me = e.store.effectiveDate?.error, xe = e.store.dispenseQuantity?.error ?? !1, ke = e.store.dispenseQuantity?.error, Me = e.store.dispenseUnit?.value ?? a()?.name, ue = e.store.daysSupply?.error ?? !1, K = e.store.daysSupply?.error, be = e.store.refillsInput?.error ?? !1, Ne = e.store.refillsInput?.error, bt = e.store.instructions?.error ?? !1, Xe = e.store.instructions?.error;
43507
+ return _e !== z._v$3 && (_.selected = z._v$3 = _e), Te !== z._v$4 && (_.invalid = z._v$4 = Te), je !== z._v$5 && (_.helpText = z._v$5 = je), ae !== z._v$6 && (_.offCatalogOption = z._v$6 = ae), Ee !== z._v$7 && (N.open = z._v$7 = Ee), Ce !== z._v$8 && (A.invalid = z._v$8 = Ce), me !== z._v$9 && (A.helpText = z._v$9 = me), xe !== z._v$10 && (Q.invalid = z._v$10 = xe), ke !== z._v$11 && (Q.helpText = z._v$11 = ke), Me !== z._v$12 && (W.selected = z._v$12 = Me), ue !== z._v$13 && (ne.invalid = z._v$13 = ue), K !== z._v$14 && (ne.helpText = z._v$14 = K), be !== z._v$15 && (ie.invalid = z._v$15 = be), Ne !== z._v$16 && (ie.helpText = z._v$16 = Ne), bt !== z._v$17 && (R.invalid = z._v$17 = bt), Xe !== z._v$18 && (R.helpText = z._v$18 = Xe), z;
43500
43508
  }, {
43501
43509
  _v$3: void 0,
43502
43510
  _v$4: void 0,
@@ -43924,7 +43932,7 @@ const U9 = (e) => {
43924
43932
  value: h.detail.patient.address
43925
43933
  });
43926
43934
  };
43927
- me(() => {
43935
+ pe(() => {
43928
43936
  l?.selectedPatient?.data && e?.patientId && d({
43929
43937
  detail: {
43930
43938
  patient: l?.selectedPatient?.data
@@ -44054,7 +44062,7 @@ const U9 = (e) => {
44054
44062
  r(a.pharmacy);
44055
44063
  }
44056
44064
  };
44057
- return me(() => {
44065
+ return pe(() => {
44058
44066
  e.pharmacyId && i(e.pharmacyId);
44059
44067
  }), (() => {
44060
44068
  const o = ce(() => document.importNode(SK, !0)), a = o.firstChild;
@@ -44117,15 +44125,15 @@ function LK(e) {
44117
44125
  notes: pd(e.weight, e?.weightUnit)
44118
44126
  } : void 0);
44119
44127
  });
44120
- }), me(() => {
44128
+ }), pe(() => {
44121
44129
  !n?.authentication.state.isAuthenticated && !n?.authentication.state.isLoading && !n?.authentication.state.error && n?.authentication.login({
44122
44130
  appState: {
44123
44131
  returnTo: window.location.pathname
44124
44132
  }
44125
44133
  });
44126
- }), me(() => {
44134
+ }), pe(() => {
44127
44135
  l(n?.authentication.state.isLoading || !1);
44128
- }), me(() => {
44136
+ }), pe(() => {
44129
44137
  h(n?.authentication.state.isAuthenticated || !1);
44130
44138
  });
44131
44139
  const p = H(() => {
@@ -44287,9 +44295,9 @@ function LK(e) {
44287
44295
  } else
44288
44296
  a(Q);
44289
44297
  }, N = () => e.enableCombineAndDuplicate && f.hasRoutingOrder() ? k() : T(e.enableOrder);
44290
- me(() => {
44298
+ pe(() => {
44291
44299
  e.triggerSubmit && N();
44292
- }), me(() => {
44300
+ }), pe(() => {
44293
44301
  $(Boolean(e.formStore.draftPrescriptions?.value?.length > 0 && e.formStore.patient?.value));
44294
44302
  });
44295
44303
  const P = n.sdk.apolloClinical;
@@ -45107,7 +45115,7 @@ st("photon-checkbox", {
45107
45115
  };
45108
45116
  return Ze(() => {
45109
45117
  i(t());
45110
- }), me(() => {
45118
+ }), pe(() => {
45111
45119
  e.checked !== t() && n(e.checked);
45112
45120
  }), [(() => {
45113
45121
  const o = A0.cloneNode(!0);
@@ -49638,7 +49646,7 @@ st("photon-patient-form", {
49638
49646
  });
49639
49647
  t?.dispatchEvent(c);
49640
49648
  };
49641
- return me(() => {
49649
+ return pe(() => {
49642
49650
  r.selectedPatient.data && (s.updateFormValue({
49643
49651
  key: "firstName",
49644
49652
  value: r.selectedPatient.data.name.first
@@ -49676,7 +49684,7 @@ st("photon-patient-form", {
49676
49684
  key: "preferredPharmacy",
49677
49685
  value: r.selectedPatient.data.preferredPharmacies?.[0]?.id
49678
49686
  }));
49679
- }), me(() => {
49687
+ }), pe(() => {
49680
49688
  l(a);
49681
49689
  }), Sn(() => {
49682
49690
  i.clearSelectedPatient(), s.reset();
@@ -49750,8 +49758,8 @@ st("photon-patient-form", {
49750
49758
  value: I.detail.input
49751
49759
  });
49752
49760
  }), W._$owner = de(), ee((I) => {
49753
- const ne = a.firstName?.error, ie = a.firstName?.error, R = a.lastName?.error, re = a.lastName?.error, Z = a.dateOfBirth?.error, te = a.dateOfBirth?.error, z = a.phone?.error, _e = a.phone?.error, Te = a.gender?.error, je = a.gender?.error !== void 0, ae = r.selectedPatient.data?.gender, Ee = a.sex?.error, Ce = a.sex?.error !== void 0, pe = r.selectedPatient.data?.sex, xe = a.email?.error, ke = a.email?.error;
49754
- return ne !== I._v$ && ($.invalid = I._v$ = ne), ie !== I._v$2 && ($.helpText = I._v$2 = ie), R !== I._v$3 && (k.invalid = I._v$3 = R), re !== I._v$4 && (k.helpText = I._v$4 = re), Z !== I._v$5 && (N.invalid = I._v$5 = Z), te !== I._v$6 && (N.helpText = I._v$6 = te), z !== I._v$7 && (P.invalid = I._v$7 = z), _e !== I._v$8 && (P.helpText = I._v$8 = _e), Te !== I._v$9 && (B.helpText = I._v$9 = Te), je !== I._v$10 && (B.invalid = I._v$10 = je), ae !== I._v$11 && (B.selected = I._v$11 = ae), Ee !== I._v$12 && (L.helpText = I._v$12 = Ee), Ce !== I._v$13 && (L.invalid = I._v$13 = Ce), pe !== I._v$14 && (L.selected = I._v$14 = pe), xe !== I._v$15 && (W.invalid = I._v$15 = xe), ke !== I._v$16 && (W.helpText = I._v$16 = ke), I;
49761
+ const ne = a.firstName?.error, ie = a.firstName?.error, R = a.lastName?.error, re = a.lastName?.error, Z = a.dateOfBirth?.error, te = a.dateOfBirth?.error, z = a.phone?.error, _e = a.phone?.error, Te = a.gender?.error, je = a.gender?.error !== void 0, ae = r.selectedPatient.data?.gender, Ee = a.sex?.error, Ce = a.sex?.error !== void 0, me = r.selectedPatient.data?.sex, xe = a.email?.error, ke = a.email?.error;
49762
+ return ne !== I._v$ && ($.invalid = I._v$ = ne), ie !== I._v$2 && ($.helpText = I._v$2 = ie), R !== I._v$3 && (k.invalid = I._v$3 = R), re !== I._v$4 && (k.helpText = I._v$4 = re), Z !== I._v$5 && (N.invalid = I._v$5 = Z), te !== I._v$6 && (N.helpText = I._v$6 = te), z !== I._v$7 && (P.invalid = I._v$7 = z), _e !== I._v$8 && (P.helpText = I._v$8 = _e), Te !== I._v$9 && (B.helpText = I._v$9 = Te), je !== I._v$10 && (B.invalid = I._v$10 = je), ae !== I._v$11 && (B.selected = I._v$11 = ae), Ee !== I._v$12 && (L.helpText = I._v$12 = Ee), Ce !== I._v$13 && (L.invalid = I._v$13 = Ce), me !== I._v$14 && (L.selected = I._v$14 = me), xe !== I._v$15 && (W.invalid = I._v$15 = xe), ke !== I._v$16 && (W.helpText = I._v$16 = ke), I;
49755
49763
  }, {
49756
49764
  _v$: void 0,
49757
49765
  _v$2: void 0,
@@ -50321,9 +50329,9 @@ const HJ = /* @__PURE__ */ q('<div class="w-full"></div>'), qJ = /* @__PURE__ */
50321
50329
  });
50322
50330
  s(c?.medicationConcepts ? [...c.medicationConcepts].sort((u, h) => u.name.localeCompare(h.name)) : []), r(!1);
50323
50331
  }, 300);
50324
- return me(() => {
50332
+ return pe(() => {
50325
50333
  i().length > 0 && (r(!0), l(i()));
50326
- }), me(() => {
50334
+ }), pe(() => {
50327
50335
  e.conceptId || s([]);
50328
50336
  }), (() => {
50329
50337
  const d = HJ.cloneNode(!0);
@@ -50388,7 +50396,7 @@ const HJ = /* @__PURE__ */ q('<div class="w-full"></div>'), qJ = /* @__PURE__ */
50388
50396
  query: l,
50389
50397
  key: d
50390
50398
  } = XJ[e.filterType];
50391
- me(() => {
50399
+ pe(() => {
50392
50400
  e?.conceptId && (s(void 0), o([]));
50393
50401
  });
50394
50402
  const c = H(() => e?.medicationId || e.conceptId), u = async () => {
@@ -50402,7 +50410,7 @@ const HJ = /* @__PURE__ */ q('<div class="w-full"></div>'), qJ = /* @__PURE__ */
50402
50410
  });
50403
50411
  o(h[d] ?? []), r(!1);
50404
50412
  };
50405
- return me(() => {
50413
+ return pe(() => {
50406
50414
  c() && !a() && (r(!0), u());
50407
50415
  }), (() => {
50408
50416
  const h = QJ.cloneNode(!0);
@@ -50476,9 +50484,9 @@ st("photon-med-search", {
50476
50484
  query: iee
50477
50485
  });
50478
50486
  $.catalogs.length > 0 && v($.catalogs[0].id);
50479
- }), me(() => {
50487
+ }), pe(() => {
50480
50488
  e.open || (i(""), l(""), c([]));
50481
- }), me(() => {
50489
+ }), pe(() => {
50482
50490
  const $ = async (k) => {
50483
50491
  const {
50484
50492
  data: T
@@ -50491,7 +50499,7 @@ st("photon-med-search", {
50491
50499
  h(!1), p(void 0), c(T.medicationProducts);
50492
50500
  };
50493
50501
  x() && $(x());
50494
- }), me(() => {
50502
+ }), pe(() => {
50495
50503
  f() && _(f(), u());
50496
50504
  }), (() => {
50497
50505
  const $ = ree.cloneNode(!0), k = $.firstChild, T = k.nextSibling, N = T.nextSibling, P = N.nextSibling, A = P.nextSibling, G = t;
@@ -50790,7 +50798,7 @@ st("photon-radio-card", {
50790
50798
  });
50791
50799
  function lee(e) {
50792
50800
  const [t, n] = wi(Array());
50793
- return me(() => {
50801
+ return pe(() => {
50794
50802
  if (!e)
50795
50803
  return;
50796
50804
  const r = () => {
@@ -51037,8 +51045,8 @@ st("photon-multirx-form-wrapper", {
51037
51045
  }), Z.addEventListener("photon-signature-attestation-canceled", () => {
51038
51046
  T(), x.clearSelectedPatient();
51039
51047
  }), Z._$owner = de(), ee((te) => {
51040
- const z = e.hideTemplates, _e = y(), Te = e.patientId, je = e.templateIds, ae = e.prescriptionIds, Ee = e.weight, Ce = e.weightUnit, pe = e.enableMedHistory, xe = e.enableOrder, ke = e.enableLocalPickup, Me = e.enableSendToPatient, ue = e.enableCombineAndDuplicate, K = e.mailOrderIds, be = y(), Ne = e?.toastBuffer || 0;
51041
- return z !== te._v$3 && (Z.hideTemplates = te._v$3 = z), _e !== te._v$4 && (Z.loading = te._v$4 = _e), Te !== te._v$5 && (Z.patientId = te._v$5 = Te), je !== te._v$6 && (Z.templateIds = te._v$6 = je), ae !== te._v$7 && (Z.prescriptionIds = te._v$7 = ae), Ee !== te._v$8 && (Z.weight = te._v$8 = Ee), Ce !== te._v$9 && (Z.weightUnit = te._v$9 = Ce), pe !== te._v$10 && (Z.enableMedHistory = te._v$10 = pe), xe !== te._v$11 && (Z.enableOrder = te._v$11 = xe), ke !== te._v$12 && (Z.enableLocalPickup = te._v$12 = ke), Me !== te._v$13 && (Z.enableSendToPatient = te._v$13 = Me), ue !== te._v$14 && (Z.enableCombineAndDuplicate = te._v$14 = ue), K !== te._v$15 && (Z.mailOrderIds = te._v$15 = K), be !== te._v$16 && (Z.triggerSubmit = te._v$16 = be), Ne !== te._v$17 && (Z.toastBuffer = te._v$17 = Ne), te;
51048
+ const z = e.hideTemplates, _e = y(), Te = e.patientId, je = e.templateIds, ae = e.prescriptionIds, Ee = e.weight, Ce = e.weightUnit, me = e.enableMedHistory, xe = e.enableOrder, ke = e.enableLocalPickup, Me = e.enableSendToPatient, ue = e.enableCombineAndDuplicate, K = e.mailOrderIds, be = y(), Ne = e?.toastBuffer || 0;
51049
+ return z !== te._v$3 && (Z.hideTemplates = te._v$3 = z), _e !== te._v$4 && (Z.loading = te._v$4 = _e), Te !== te._v$5 && (Z.patientId = te._v$5 = Te), je !== te._v$6 && (Z.templateIds = te._v$6 = je), ae !== te._v$7 && (Z.prescriptionIds = te._v$7 = ae), Ee !== te._v$8 && (Z.weight = te._v$8 = Ee), Ce !== te._v$9 && (Z.weightUnit = te._v$9 = Ce), me !== te._v$10 && (Z.enableMedHistory = te._v$10 = me), xe !== te._v$11 && (Z.enableOrder = te._v$11 = xe), ke !== te._v$12 && (Z.enableLocalPickup = te._v$12 = ke), Me !== te._v$13 && (Z.enableSendToPatient = te._v$13 = Me), ue !== te._v$14 && (Z.enableCombineAndDuplicate = te._v$14 = ue), K !== te._v$15 && (Z.mailOrderIds = te._v$15 = K), be !== te._v$16 && (Z.triggerSubmit = te._v$16 = be), Ne !== te._v$17 && (Z.toastBuffer = te._v$17 = Ne), te;
51042
51050
  }, {
51043
51051
  _v$3: void 0,
51044
51052
  _v$4: void 0,