webim-adapter 2.6.0 → 2.6.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.
@@ -9048,12 +9048,37 @@ function Ja(e, t, n = !0) {
9048
9048
  ...i
9049
9049
  };
9050
9050
  }
9051
- var Ya = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "", Xa = "/product/{slug}", Za = (e) => !e || e === "/product?product={slug}" ? Xa : e, Qa = (e, t) => String(Za(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
9052
- function $a(e) {
9051
+ var Ya = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
9052
+ function Xa({ value: e, label: t, onCommit: n }) {
9053
+ let [r, i] = d(null), a = () => {
9054
+ if (r === null) return;
9055
+ let t = Math.max(1, Math.round(Number(r)) || 1);
9056
+ i(null), t !== Number(e) && n(t);
9057
+ };
9058
+ return /* @__PURE__ */ m("input", {
9059
+ type: "number",
9060
+ ...X("quantity-input"),
9061
+ min: 1,
9062
+ "aria-label": t,
9063
+ value: r ?? e,
9064
+ onChange: (e) => i(e.target.value),
9065
+ onBlur: a,
9066
+ onKeyDown: (e) => {
9067
+ e.key === "Enter" && a();
9068
+ },
9069
+ style: {
9070
+ ...Z,
9071
+ width: "64px",
9072
+ padding: "4px 8px"
9073
+ }
9074
+ });
9075
+ }
9076
+ var Za = "/product/{slug}", Qa = (e) => !e || e === "/product?product={slug}" ? Za : e, $a = (e, t) => String(Qa(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
9077
+ function eo(e) {
9053
9078
  let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
9054
9079
  return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
9055
9080
  }
9056
- function eo({ product: e, variant: t, locale: n, size: r = 16 }) {
9081
+ function to({ product: e, variant: t, locale: n, size: r = 16 }) {
9057
9082
  let i = e.currency, a = t?.price ?? e.price;
9058
9083
  return /* @__PURE__ */ h("span", {
9059
9084
  ...X("price"),
@@ -9078,7 +9103,7 @@ function eo({ product: e, variant: t, locale: n, size: r = 16 }) {
9078
9103
  })]
9079
9104
  });
9080
9105
  }
9081
- var to = [
9106
+ var no = [
9082
9107
  1,
9083
9108
  2,
9084
9109
  3
@@ -9094,7 +9119,7 @@ var to = [
9094
9119
  currency: "USD",
9095
9120
  sample: !0
9096
9121
  }));
9097
- function no({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: c = "", source: l = "catalog", loginHref: u = "", style: f, nodeRef: p, inert: g = !1, sample: _ = !1, noNavigate: v = !1 }) {
9122
+ function ro({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: c = "", source: l = "catalog", loginHref: u = "", style: f, nodeRef: p, inert: g = !1, sample: _ = !1, noNavigate: v = !1 }) {
9098
9123
  let { tenant: y, apiUrl: b, locale: x, words: S } = qa(), C = wa(), [w, T] = d(null), [E, D] = d(null), [O, k] = d(""), [A, j] = d({}), [M, N] = d(!1), { store: F, currency: I } = Ja(b, y, !g), L = l === "favorites";
9099
9124
  s(() => {
9100
9125
  let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = I ? `&currency=${encodeURIComponent(I)}` : "";
@@ -9123,7 +9148,7 @@ function no({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9123
9148
  L,
9124
9149
  g
9125
9150
  ]);
9126
- let R = w?.length || !_ ? w ?? [] : to, z = async (e) => {
9151
+ let R = w?.length || !_ ? w ?? [] : no, z = async (e) => {
9127
9152
  if (!(g || e.sample)) {
9128
9153
  k(e.id);
9129
9154
  try {
@@ -9179,7 +9204,7 @@ function no({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9179
9204
  gap: `${n}px`
9180
9205
  },
9181
9206
  children: R.map((e) => {
9182
- let t = $a(e) === 0, n = Qa(r, e);
9207
+ let t = eo(e) === 0, n = $a(r, e);
9183
9208
  return /* @__PURE__ */ h("div", {
9184
9209
  ...X("card"),
9185
9210
  style: {
@@ -9244,7 +9269,7 @@ function no({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9244
9269
  ")"
9245
9270
  ]
9246
9271
  }),
9247
- /* @__PURE__ */ m(eo, {
9272
+ /* @__PURE__ */ m(to, {
9248
9273
  product: e,
9249
9274
  locale: x
9250
9275
  }),
@@ -9283,7 +9308,7 @@ function no({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9283
9308
  ]
9284
9309
  });
9285
9310
  }
9286
- function ro({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: c = !1, sample: l = !1, noNavigate: u = !1 }) {
9311
+ function io({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: c = !1, sample: l = !1, noNavigate: u = !1 }) {
9287
9312
  let { tenant: f, apiUrl: p, locale: g, param: _, words: v } = qa(), [y, b] = d(null), [x, S] = d(!1), [C, w] = d(0), [T, E] = d(""), [D, O] = d(1), [k, A] = d(!1), [j, M] = d(""), { store: N, currency: F } = Ja(p, f, !c), I = e || _ || Ya("product"), L = F ? `?currency=${encodeURIComponent(F)}` : "";
9288
9313
  if (s(() => {
9289
9314
  let e = !0;
@@ -9291,7 +9316,7 @@ function ro({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9291
9316
  let t = await Q(p, f, "/store/config"), n = I ? await Q(p, f, `/store/products/${encodeURIComponent(I)}${L}`) : l || u ? (await Q(p, f, `/store/products?limit=1${F ? `&currency=${encodeURIComponent(F)}` : ""}`))?.data?.[0] : null;
9292
9317
  if (e) {
9293
9318
  if (!n) {
9294
- S(!0), b(l ? to[0] : null);
9319
+ S(!0), b(l ? no[0] : null);
9295
9320
  return;
9296
9321
  }
9297
9322
  b({
@@ -9300,7 +9325,7 @@ function ro({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9300
9325
  }), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
9301
9326
  }
9302
9327
  })().catch(() => {
9303
- e && (S(!0), b(l ? to[0] : null));
9328
+ e && (S(!0), b(l ? no[0] : null));
9304
9329
  }), () => {
9305
9330
  e = !1;
9306
9331
  };
@@ -9430,7 +9455,7 @@ function ro({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9430
9455
  inert: c,
9431
9456
  sample: l && !!y.sample
9432
9457
  }),
9433
- /* @__PURE__ */ m(eo, {
9458
+ /* @__PURE__ */ m(to, {
9434
9459
  product: y,
9435
9460
  variant: R,
9436
9461
  locale: g,
@@ -9535,13 +9560,13 @@ function ro({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9535
9560
  ]
9536
9561
  });
9537
9562
  }
9538
- function io(e) {
9539
- return /* @__PURE__ */ m(no, {
9563
+ function ao(e) {
9564
+ return /* @__PURE__ */ m(ro, {
9540
9565
  ...e,
9541
9566
  source: "favorites"
9542
9567
  });
9543
9568
  }
9544
- var ao = /* @__PURE__ */ h("svg", {
9569
+ var oo = /* @__PURE__ */ h("svg", {
9545
9570
  width: "20",
9546
9571
  height: "20",
9547
9572
  viewBox: "0 0 24 24",
@@ -9554,7 +9579,7 @@ var ao = /* @__PURE__ */ h("svg", {
9554
9579
  ...X("icon"),
9555
9580
  children: [/* @__PURE__ */ m("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ m("path", { d: "M9 7a3 3 0 0 1 6 0" })]
9556
9581
  });
9557
- function oo({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
9582
+ function so({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
9558
9583
  let { tenant: c, apiUrl: l, words: u } = qa(), { cart: d } = Ja(l, c, !a), f = o && !d.count ? 2 : d.count;
9559
9584
  return /* @__PURE__ */ h("a", {
9560
9585
  ref: i,
@@ -9572,7 +9597,7 @@ function oo({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
9572
9597
  ...P(r)
9573
9598
  },
9574
9599
  children: [
9575
- ao,
9600
+ oo,
9576
9601
  n && /* @__PURE__ */ m("span", {
9577
9602
  ...X("label"),
9578
9603
  children: t || u("cart")
@@ -9600,7 +9625,7 @@ function oo({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
9600
9625
  ]
9601
9626
  });
9602
9627
  }
9603
- function so(e, t, n) {
9628
+ function co(e, t, n) {
9604
9629
  if (t === "code") return e;
9605
9630
  try {
9606
9631
  if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
@@ -9613,7 +9638,7 @@ function so(e, t, n) {
9613
9638
  return e;
9614
9639
  }
9615
9640
  }
9616
- function co({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
9641
+ function lo({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
9617
9642
  let { tenant: a, apiUrl: o, locale: c } = qa(), { store: l, currency: u } = Ja(o, a, !i), [f, p] = d(null), g = {
9618
9643
  display: "inline-flex",
9619
9644
  alignItems: "center",
@@ -9662,24 +9687,24 @@ function co({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
9662
9687
  },
9663
9688
  children: _.map((t) => /* @__PURE__ */ m("option", {
9664
9689
  value: t,
9665
- children: so(t, e, c)
9690
+ children: co(t, e, c)
9666
9691
  }, t))
9667
9692
  })]
9668
9693
  });
9669
9694
  }
9670
- var lo = {
9695
+ var uo = {
9671
9696
  display: "flex",
9672
9697
  flexDirection: "column",
9673
9698
  gap: "6px",
9674
9699
  fontSize: "13px"
9675
- }, uo = {
9700
+ }, fo = {
9676
9701
  margin: "0 0 12px",
9677
9702
  fontSize: "18px"
9678
9703
  };
9679
- function fo({ label: e, required: t, children: n }) {
9704
+ function po({ label: e, required: t, children: n }) {
9680
9705
  return /* @__PURE__ */ h("label", {
9681
9706
  ...X("field"),
9682
- style: lo,
9707
+ style: uo,
9683
9708
  children: [/* @__PURE__ */ h("span", {
9684
9709
  ...X("field-label"),
9685
9710
  style: { fontWeight: 500 },
@@ -9691,7 +9716,7 @@ function fo({ label: e, required: t, children: n }) {
9691
9716
  }), n]
9692
9717
  });
9693
9718
  }
9694
- var po = [{
9719
+ var mo = [{
9695
9720
  id: "ship:standard",
9696
9721
  type: "shipping",
9697
9722
  name: "Standard",
@@ -9707,7 +9732,7 @@ var po = [{
9707
9732
  min_days: null,
9708
9733
  max_days: null,
9709
9734
  detail: "Main Street 1"
9710
- }], mo = {
9735
+ }], ho = {
9711
9736
  name: "",
9712
9737
  email: "",
9713
9738
  phone: "",
@@ -9722,8 +9747,8 @@ var po = [{
9722
9747
  recipient: "",
9723
9748
  gift_message: ""
9724
9749
  };
9725
- function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
9726
- let { tenant: o, apiUrl: c, locale: u, words: f, orderId: p } = qa(), { store: g, cart: _, loaded: v } = Ja(c, o, !r), [y, b] = d(null), [x, S] = d(mo), [C, w] = d(""), [T, E] = d(!1), [D, O] = d(""), [k, A] = d(null), [j, M] = d(""), [N, F] = d(!1), I = !r && Ya("cancelled") === "1", L = (e) => ua(e, _.currency || y?.currency, u);
9750
+ function go({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
9751
+ let { tenant: o, apiUrl: c, locale: u, words: f, orderId: p } = qa(), { store: g, cart: _, loaded: v } = Ja(c, o, !r), [y, b] = d(null), [x, S] = d(ho), [C, w] = d(""), [T, E] = d(!1), [D, O] = d(""), [k, A] = d(null), [j, M] = d(""), [N, F] = d(!1), I = !r && Ya("cancelled") === "1", L = (e) => ua(e, _.currency || y?.currency, u);
9727
9752
  s(() => {
9728
9753
  Q(c, o, "/store/config").then((e) => {
9729
9754
  b(e), w((t) => t || e?.methods?.[0] || "");
@@ -9815,7 +9840,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9815
9840
  E(!1);
9816
9841
  }
9817
9842
  }
9818
- }, H = { ...P(t) }, U = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, ee = Array.isArray(_.discounts) ? _.discounts : [], te = ee.filter((e) => e.type !== "shipping"), W = ee.find((e) => e.type === "shipping") ?? null, ne = r && i && !_.lines.length ? po : Array.isArray(_.delivery_options) ? _.delivery_options : [], G = ne.find((e) => e.id === _.delivery) ?? (r && i ? ne[0] : null), K = G?.type === "pickup", re = (e) => {
9843
+ }, H = { ...P(t) }, U = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, ee = Array.isArray(_.discounts) ? _.discounts : [], te = ee.filter((e) => e.type !== "shipping"), W = ee.find((e) => e.type === "shipping") ?? null, ne = r && i && !_.lines.length ? mo : Array.isArray(_.delivery_options) ? _.delivery_options : [], G = ne.find((e) => e.id === _.delivery) ?? (r && i ? ne[0] : null), K = G?.type === "pickup", re = (e) => {
9819
9844
  r || e === _.delivery || (O(""), g.setDelivery(e).catch((e) => O(pa(f, e))));
9820
9845
  };
9821
9846
  if (k) {
@@ -9910,11 +9935,11 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9910
9935
  ua(k.total, k.currency, u)
9911
9936
  ]
9912
9937
  }),
9913
- !t && /* @__PURE__ */ m(bo, {
9938
+ !t && /* @__PURE__ */ m(xo, {
9914
9939
  reference: k.transfer_reference,
9915
9940
  words: f
9916
9941
  }),
9917
- /* @__PURE__ */ m(xo, {
9942
+ /* @__PURE__ */ m(So, {
9918
9943
  downloads: k.downloads,
9919
9944
  apiUrl: c,
9920
9945
  words: f,
@@ -9934,7 +9959,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9934
9959
  ]
9935
9960
  });
9936
9961
  }
9937
- let ie = r && i && !_.lines.length ? to.slice(0, 2).map((e) => ({
9962
+ let ie = r && i && !_.lines.length ? no.slice(0, 2).map((e) => ({
9938
9963
  ...e,
9939
9964
  product_id: e.id,
9940
9965
  variant_id: null,
@@ -10018,7 +10043,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10018
10043
  ...X("section"),
10019
10044
  children: [/* @__PURE__ */ m("h3", {
10020
10045
  ...X("heading"),
10021
- style: uo,
10046
+ style: fo,
10022
10047
  children: f("contact")
10023
10048
  }), /* @__PURE__ */ h("div", {
10024
10049
  ...X("fields"),
@@ -10026,7 +10051,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10026
10051
  display: "grid",
10027
10052
  gap: "12px"
10028
10053
  },
10029
- children: [/* @__PURE__ */ m(fo, {
10054
+ children: [/* @__PURE__ */ m(po, {
10030
10055
  label: f("name"),
10031
10056
  required: !0,
10032
10057
  children: /* @__PURE__ */ m("input", {
@@ -10043,7 +10068,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10043
10068
  gridTemplateColumns: "1fr 1fr",
10044
10069
  gap: "12px"
10045
10070
  },
10046
- children: [/* @__PURE__ */ m(fo, {
10071
+ children: [/* @__PURE__ */ m(po, {
10047
10072
  label: f("email"),
10048
10073
  required: !0,
10049
10074
  children: /* @__PURE__ */ m("input", {
@@ -10054,7 +10079,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10054
10079
  onChange: R("email"),
10055
10080
  autoComplete: "email"
10056
10081
  })
10057
- }), /* @__PURE__ */ m(fo, {
10082
+ }), /* @__PURE__ */ m(po, {
10058
10083
  label: f("phone"),
10059
10084
  children: /* @__PURE__ */ m("input", {
10060
10085
  type: "tel",
@@ -10073,7 +10098,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10073
10098
  children: [
10074
10099
  /* @__PURE__ */ m("h3", {
10075
10100
  ...X("heading"),
10076
- style: uo,
10101
+ style: fo,
10077
10102
  children: f("delivery")
10078
10103
  }),
10079
10104
  /* @__PURE__ */ m("div", {
@@ -10085,7 +10110,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10085
10110
  gridTemplateColumns: "1fr 1fr",
10086
10111
  gap: "12px"
10087
10112
  },
10088
- children: [/* @__PURE__ */ m(fo, {
10113
+ children: [/* @__PURE__ */ m(po, {
10089
10114
  label: f("postal"),
10090
10115
  children: /* @__PURE__ */ m("input", {
10091
10116
  ...X("input"),
@@ -10095,7 +10120,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10095
10120
  onBlur: () => !r && x.country && g.setCountry(x.country, x.postal_code).catch((e) => O(pa(f, e))),
10096
10121
  autoComplete: "postal-code"
10097
10122
  })
10098
- }), /* @__PURE__ */ m(fo, {
10123
+ }), /* @__PURE__ */ m(po, {
10099
10124
  label: f("country"),
10100
10125
  required: !K,
10101
10126
  children: /* @__PURE__ */ h("select", {
@@ -10209,7 +10234,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10209
10234
  ...X("section"),
10210
10235
  children: [/* @__PURE__ */ m("h3", {
10211
10236
  ...X("heading"),
10212
- style: uo,
10237
+ style: fo,
10213
10238
  children: f("address")
10214
10239
  }), /* @__PURE__ */ h("div", {
10215
10240
  ...X("fields"),
@@ -10218,7 +10243,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10218
10243
  gap: "12px"
10219
10244
  },
10220
10245
  children: [
10221
- /* @__PURE__ */ m(fo, {
10246
+ /* @__PURE__ */ m(po, {
10222
10247
  label: f("line1"),
10223
10248
  required: !0,
10224
10249
  children: /* @__PURE__ */ m("input", {
@@ -10229,7 +10254,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10229
10254
  autoComplete: "address-line1"
10230
10255
  })
10231
10256
  }),
10232
- /* @__PURE__ */ m(fo, {
10257
+ /* @__PURE__ */ m(po, {
10233
10258
  label: f("line2"),
10234
10259
  children: /* @__PURE__ */ m("input", {
10235
10260
  ...X("input"),
@@ -10246,7 +10271,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10246
10271
  gridTemplateColumns: "1fr 1fr",
10247
10272
  gap: "12px"
10248
10273
  },
10249
- children: [/* @__PURE__ */ m(fo, {
10274
+ children: [/* @__PURE__ */ m(po, {
10250
10275
  label: f("city"),
10251
10276
  required: !0,
10252
10277
  children: /* @__PURE__ */ m("input", {
@@ -10256,7 +10281,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10256
10281
  onChange: R("city"),
10257
10282
  autoComplete: "address-level2"
10258
10283
  })
10259
- }), /* @__PURE__ */ m(fo, {
10284
+ }), /* @__PURE__ */ m(po, {
10260
10285
  label: f("region"),
10261
10286
  children: /* @__PURE__ */ m("input", {
10262
10287
  ...X("input"),
@@ -10267,7 +10292,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10267
10292
  })
10268
10293
  })]
10269
10294
  }),
10270
- /* @__PURE__ */ m(fo, {
10295
+ /* @__PURE__ */ m(po, {
10271
10296
  label: f("note"),
10272
10297
  children: /* @__PURE__ */ m("textarea", {
10273
10298
  rows: 2,
@@ -10322,7 +10347,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10322
10347
  display: "grid",
10323
10348
  gap: "12px"
10324
10349
  },
10325
- children: [U && !K && /* @__PURE__ */ m(fo, {
10350
+ children: [U && !K && /* @__PURE__ */ m(po, {
10326
10351
  label: f("giftRecipient"),
10327
10352
  children: /* @__PURE__ */ m("input", {
10328
10353
  ...X("input"),
@@ -10332,7 +10357,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10332
10357
  maxLength: 200,
10333
10358
  autoComplete: "off"
10334
10359
  })
10335
- }), /* @__PURE__ */ m(fo, {
10360
+ }), /* @__PURE__ */ m(po, {
10336
10361
  label: f("giftMessage"),
10337
10362
  children: /* @__PURE__ */ m("textarea", {
10338
10363
  rows: 3,
@@ -10353,7 +10378,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10353
10378
  children: [
10354
10379
  /* @__PURE__ */ m("h3", {
10355
10380
  ...X("heading"),
10356
- style: uo,
10381
+ style: fo,
10357
10382
  children: f("payment")
10358
10383
  }),
10359
10384
  !oe.length && !r && /* @__PURE__ */ m("p", {
@@ -10411,7 +10436,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10411
10436
  /* @__PURE__ */ m("h3", {
10412
10437
  ...X("summary-title"),
10413
10438
  style: {
10414
- ...uo,
10439
+ ...fo,
10415
10440
  margin: 0
10416
10441
  },
10417
10442
  children: f("cart")
@@ -10474,18 +10499,10 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10474
10499
  gap: "8px",
10475
10500
  marginTop: "4px"
10476
10501
  },
10477
- children: [/* @__PURE__ */ m("input", {
10478
- type: "number",
10479
- ...X("quantity-input"),
10480
- min: 1,
10481
- "aria-label": f("quantity"),
10502
+ children: [/* @__PURE__ */ m(Xa, {
10482
10503
  value: e.quantity,
10483
- onChange: (t) => !r && g.setLine(e.product_id, e.variant_id, Math.max(1, Number(t.target.value) || 1)).catch((e) => O(pa(f, e))),
10484
- style: {
10485
- ...Z,
10486
- width: "64px",
10487
- padding: "4px 8px"
10488
- }
10504
+ label: f("quantity"),
10505
+ onCommit: (t) => !r && g.setLine(e.product_id, e.variant_id, t).catch((e) => O(pa(f, e)))
10489
10506
  }), /* @__PURE__ */ m("button", {
10490
10507
  type: "button",
10491
10508
  onClick: () => !r && g.setLine(e.product_id, e.variant_id, 0).catch((e) => O(pa(f, e))),
@@ -10724,7 +10741,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10724
10741
  },
10725
10742
  children: f(T ? "placing" : "placeOrder")
10726
10743
  }),
10727
- /* @__PURE__ */ m(_o, {
10744
+ /* @__PURE__ */ m(vo, {
10728
10745
  apiUrl: c,
10729
10746
  tenant: o,
10730
10747
  words: f,
@@ -10736,7 +10753,7 @@ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10736
10753
  })]
10737
10754
  });
10738
10755
  }
10739
- var go = [
10756
+ var _o = [
10740
10757
  "refund",
10741
10758
  "privacy",
10742
10759
  "terms",
@@ -10747,8 +10764,8 @@ var go = [
10747
10764
  fields: {},
10748
10765
  updated_at: null
10749
10766
  }));
10750
- function _o({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
10751
- let [o, c] = d(i ? go : []), [l, u] = d(null);
10767
+ function vo({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
10768
+ let [o, c] = d(i ? _o : []), [l, u] = d(null);
10752
10769
  if (s(() => {
10753
10770
  if (i) return;
10754
10771
  let n = !0;
@@ -10800,7 +10817,7 @@ function _o({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
10800
10817
  },
10801
10818
  children: o.map(g)
10802
10819
  }),
10803
- l && /* @__PURE__ */ m(vo, {
10820
+ l && /* @__PURE__ */ m(yo, {
10804
10821
  policy: l,
10805
10822
  words: n,
10806
10823
  locale: r,
@@ -10809,7 +10826,7 @@ function _o({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
10809
10826
  ]
10810
10827
  });
10811
10828
  }
10812
- function vo({ policy: e, words: t, locale: n, onClose: r }) {
10829
+ function yo({ policy: e, words: t, locale: n, onClose: r }) {
10813
10830
  s(() => {
10814
10831
  let e = (e) => {
10815
10832
  e.key === "Escape" && r();
@@ -10931,12 +10948,12 @@ function vo({ policy: e, words: t, locale: n, onClose: r }) {
10931
10948
  })
10932
10949
  });
10933
10950
  }
10934
- var yo = {
10951
+ var bo = {
10935
10952
  year: "numeric",
10936
10953
  month: "short",
10937
10954
  day: "numeric"
10938
10955
  };
10939
- function bo({ reference: e, words: t }) {
10956
+ function xo({ reference: e, words: t }) {
10940
10957
  let [n, r] = d(!1);
10941
10958
  if (!e) return null;
10942
10959
  let i = () => {
@@ -11001,7 +11018,7 @@ function bo({ reference: e, words: t }) {
11001
11018
  ]
11002
11019
  });
11003
11020
  }
11004
- function xo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11021
+ function So({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11005
11022
  let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
11006
11023
  if (!a.length) return null;
11007
11024
  let o = (e) => {
@@ -11079,7 +11096,7 @@ function xo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11079
11096
  })]
11080
11097
  });
11081
11098
  }
11082
- function So({ tracking: e, words: t, noNavigate: n }) {
11099
+ function Co({ tracking: e, words: t, noNavigate: n }) {
11083
11100
  let r = typeof e?.carrier == "string" ? e.carrier : "", i = typeof e?.number == "string" ? e.number : "", a = typeof e?.url == "string" && /^https?:\/\//i.test(e.url) ? e.url : "";
11084
11101
  return !r && !i && !a ? null : /* @__PURE__ */ h("div", {
11085
11102
  ...X("tracking"),
@@ -11114,7 +11131,7 @@ function So({ tracking: e, words: t, noNavigate: n }) {
11114
11131
  ]
11115
11132
  });
11116
11133
  }
11117
- function Co({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
11134
+ function wo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
11118
11135
  let { tenant: c, apiUrl: l, locale: u, words: f, orderId: p } = qa(), [g, _] = d(null), [v, y] = d(!1), [b, x] = d("");
11119
11136
  s(() => {
11120
11137
  if (i) return;
@@ -11150,7 +11167,7 @@ function Co({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11150
11167
  items: []
11151
11168
  }] : g ?? [], C = (e) => {
11152
11169
  try {
11153
- return new Intl.DateTimeFormat(u || void 0, yo).format(new Date(e));
11170
+ return new Intl.DateTimeFormat(u || void 0, bo).format(new Date(e));
11154
11171
  } catch {
11155
11172
  return String(e).slice(0, 10);
11156
11173
  }
@@ -11273,16 +11290,16 @@ function Co({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11273
11290
  children: ua(t.total, e.currency, u)
11274
11291
  })]
11275
11292
  }, t.id)),
11276
- e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ m(bo, {
11293
+ e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ m(xo, {
11277
11294
  reference: e.transfer_reference,
11278
11295
  words: f
11279
11296
  }),
11280
- /* @__PURE__ */ m(So, {
11297
+ /* @__PURE__ */ m(Co, {
11281
11298
  tracking: e.tracking,
11282
11299
  words: f,
11283
11300
  noNavigate: o
11284
11301
  }),
11285
- /* @__PURE__ */ m(xo, {
11302
+ /* @__PURE__ */ m(So, {
11286
11303
  downloads: e.downloads,
11287
11304
  apiUrl: l,
11288
11305
  words: f,
@@ -11297,21 +11314,21 @@ function Co({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11297
11314
  }
11298
11315
  //#endregion
11299
11316
  //#region ../ui/src/components/builder/apps/language/views.jsx
11300
- function wo(e) {
11317
+ function To(e) {
11301
11318
  let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
11302
11319
  return [...new Set(n.map((e) => e.trim()))];
11303
11320
  }
11304
- var To = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
11305
- function Eo(e, t) {
11321
+ var Eo = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
11322
+ function Do(e, t) {
11306
11323
  let n = String(e ?? "").toUpperCase();
11307
11324
  if (t === "code") return n;
11308
11325
  let r = "";
11309
11326
  try {
11310
- r = To(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
11327
+ r = Eo(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
11311
11328
  } catch {}
11312
11329
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
11313
11330
  }
11314
- function Do(e, t) {
11331
+ function Oo(e, t) {
11315
11332
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
11316
11333
  if (typeof window > "u") return n || "?";
11317
11334
  try {
@@ -11321,8 +11338,8 @@ function Do(e, t) {
11321
11338
  return n || "/";
11322
11339
  }
11323
11340
  }
11324
- function Oo({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: s, inert: c }) {
11325
- let l = o(Y), u = wo(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
11341
+ function ko({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: s, inert: c }) {
11342
+ let l = o(Y), u = To(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
11326
11343
  display: "inline-flex",
11327
11344
  alignItems: "center",
11328
11345
  gap: 8,
@@ -11360,7 +11377,7 @@ function Oo({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
11360
11377
  children: n ?? "·"
11361
11378
  }), /* @__PURE__ */ m("a", {
11362
11379
  ...X("link", e === f && "link-current"),
11363
- href: Do(e, e === d),
11380
+ href: Oo(e, e === d),
11364
11381
  hrefLang: e,
11365
11382
  "aria-current": e === f ? "true" : void 0,
11366
11383
  onClick: c ? (e) => e.preventDefault() : void 0,
@@ -11370,7 +11387,7 @@ function Oo({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
11370
11387
  textDecoration: "none",
11371
11388
  cursor: c ? "default" : "pointer"
11372
11389
  },
11373
- children: Eo(e, t)
11390
+ children: Do(e, t)
11374
11391
  })]
11375
11392
  }, e))]
11376
11393
  }) : /* @__PURE__ */ h("div", {
@@ -11382,7 +11399,7 @@ function Oo({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
11382
11399
  value: f,
11383
11400
  onChange: c ? void 0 : (e) => {
11384
11401
  let t = e.target.value;
11385
- window.location.assign(Do(t, t === d));
11402
+ window.location.assign(Oo(t, t === d));
11386
11403
  },
11387
11404
  onKeyDown: c ? (e) => e.preventDefault() : void 0,
11388
11405
  style: {
@@ -11398,54 +11415,54 @@ function Oo({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
11398
11415
  ...X("option", e === f && "option-current"),
11399
11416
  key: e,
11400
11417
  value: e
11401
- }, Eo(e, t)))
11418
+ }, Do(e, t)))
11402
11419
  })]
11403
11420
  });
11404
11421
  }
11405
11422
  //#endregion
11406
11423
  //#region ../ui/src/components/builder/apps/index.js
11407
- var ko = [
11424
+ var Ao = [
11408
11425
  Ei,
11409
11426
  Gi,
11410
11427
  Ri,
11411
11428
  Ki,
11412
11429
  Qi
11413
- ], Ao = {
11430
+ ], jo = {
11414
11431
  SiteLoginForm: Ii,
11415
11432
  SiteAccountMenu: Li,
11416
- SiteLanguagePicker: Oo,
11433
+ SiteLanguagePicker: ko,
11417
11434
  CookieConsent: Wi,
11418
11435
  SiteSearch: Zi,
11419
- ShopProductGrid: no,
11420
- ShopProduct: ro,
11421
- ShopCartButton: oo,
11422
- ShopCheckout: ho,
11423
- ShopOrderHistory: Co,
11424
- ShopCurrencyPicker: co,
11425
- ShopFavorites: io
11436
+ ShopProductGrid: ro,
11437
+ ShopProduct: io,
11438
+ ShopCartButton: so,
11439
+ ShopCheckout: go,
11440
+ ShopOrderHistory: wo,
11441
+ ShopCurrencyPicker: lo,
11442
+ ShopFavorites: ao
11426
11443
  };
11427
- new Set(ko.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
11444
+ new Set(Ao.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
11428
11445
  //#endregion
11429
11446
  //#region ../ui/src/components/builder/three/runtime.js
11430
- var jo = "0.185.1", Mo = "4.2.0", No = "https://cdn.jsdelivr.net/npm", Po = `${No}/three@${jo}/+esm`, Fo = `${No}/@google/model-viewer@${Mo}/dist/model-viewer.min.js`, Io = (e) => import(
11447
+ var Mo = "0.185.1", No = "4.2.0", Po = "https://cdn.jsdelivr.net/npm", Fo = `${Po}/three@${Mo}/+esm`, Io = `${Po}/@google/model-viewer@${No}/dist/model-viewer.min.js`, Lo = (e) => import(
11431
11448
  /* @vite-ignore */
11432
11449
  /* webpackIgnore: true */
11433
11450
  e
11434
- ), Lo = /* @__PURE__ */ new Map();
11435
- function Ro(e) {
11436
- if (Lo.has(e)) return Lo.get(e);
11451
+ ), Ro = /* @__PURE__ */ new Map();
11452
+ function zo(e) {
11453
+ if (Ro.has(e)) return Ro.get(e);
11437
11454
  if (typeof window > "u") return new Promise(() => {});
11438
- let t = Io(e).catch((t) => {
11439
- throw Lo.delete(e), t;
11455
+ let t = Lo(e).catch((t) => {
11456
+ throw Ro.delete(e), t;
11440
11457
  });
11441
- return Lo.set(e, t), t;
11458
+ return Ro.set(e, t), t;
11442
11459
  }
11443
- var zo = () => Ro(Po), Bo = (e) => Ro(`${No}/three@${jo}/examples/jsm/${e}/+esm`);
11444
- function Vo() {
11445
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Ro(Fo);
11460
+ var Bo = () => zo(Fo), Vo = (e) => zo(`${Po}/three@${Mo}/examples/jsm/${e}/+esm`);
11461
+ function Ho() {
11462
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : zo(Io);
11446
11463
  }
11447
- var Ho = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Uo = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
11448
- function Wo(e, t) {
11464
+ var Uo = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Wo = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
11465
+ function Go(e, t) {
11449
11466
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
11450
11467
  n = requestAnimationFrame(o), i ||= e;
11451
11468
  let a = r ? (e - r) / 1e3 : 0;
@@ -11464,7 +11481,7 @@ function Wo(e, t) {
11464
11481
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
11465
11482
  };
11466
11483
  }
11467
- function Go(e, t, n = {}) {
11484
+ function Ko(e, t, n = {}) {
11468
11485
  let r = {
11469
11486
  radius: n.distance ?? 4,
11470
11487
  polar: n.polar ?? Math.PI / 2.4,
@@ -11513,13 +11530,13 @@ function Go(e, t, n = {}) {
11513
11530
  }
11514
11531
  //#endregion
11515
11532
  //#region ../ui/src/components/builder/three/views.jsx
11516
- var Ko = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, qo = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Jo = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Yo = (e) => typeof e == "string" && !!e.trim();
11517
- function Xo({ label: e, note: t, height: n, nodeRef: r, style: i }) {
11533
+ var qo = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Jo = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Yo = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Xo = (e) => typeof e == "string" && !!e.trim();
11534
+ function Zo({ label: e, note: t, height: n, nodeRef: r, style: i }) {
11518
11535
  return /* @__PURE__ */ h("div", {
11519
11536
  ref: r,
11520
11537
  style: {
11521
11538
  ...P(i),
11522
- minHeight: Ko(n, 320),
11539
+ minHeight: qo(n, 320),
11523
11540
  display: "flex",
11524
11541
  flexDirection: "column",
11525
11542
  alignItems: "center",
@@ -11547,24 +11564,24 @@ function Xo({ label: e, note: t, height: n, nodeRef: r, style: i }) {
11547
11564
  }) : null]
11548
11565
  });
11549
11566
  }
11550
- function Zo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: c, ar: l, exposure: u, shadow: f, fieldOfView: p, environment: h, style: g, nodeRef: _, inert: v }) {
11567
+ function Qo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: c, ar: l, exposure: u, shadow: f, fieldOfView: p, environment: h, style: g, nodeRef: _, inert: v }) {
11551
11568
  let [y, b] = d(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = d(!1);
11552
11569
  s(() => {
11553
11570
  if (y || !e) return;
11554
11571
  let t = !0;
11555
- return Vo().then(() => t && b(!0), () => t && S(!0)), () => {
11572
+ return Ho().then(() => t && b(!0), () => t && S(!0)), () => {
11556
11573
  t = !1;
11557
11574
  };
11558
11575
  }, [y, e]);
11559
11576
  let C = {
11560
11577
  display: "block",
11561
11578
  width: "100%",
11562
- minHeight: Ko(r, 360),
11563
- height: Ko(r, 360),
11579
+ minHeight: qo(r, 360),
11580
+ height: qo(r, 360),
11564
11581
  backgroundColor: i || "transparent",
11565
11582
  ...P(g)
11566
11583
  };
11567
- if (!e) return v ? /* @__PURE__ */ m(Xo, {
11584
+ if (!e) return v ? /* @__PURE__ */ m(Zo, {
11568
11585
  nodeRef: _,
11569
11586
  style: g,
11570
11587
  height: r,
@@ -11599,13 +11616,13 @@ function Zo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
11599
11616
  poster: t || void 0,
11600
11617
  style: C,
11601
11618
  "camera-controls": w(!v && c !== !1),
11602
- "auto-rotate": w(T && !Ho()),
11603
- "auto-rotate-delay": T ? String(Ko(o, 0)) : void 0,
11619
+ "auto-rotate": w(T && !Uo()),
11620
+ "auto-rotate-delay": T ? String(qo(o, 0)) : void 0,
11604
11621
  "rotation-per-second": "18deg",
11605
11622
  ar: w(!v && l === !0),
11606
11623
  "ar-modes": "webxr scene-viewer quick-look",
11607
- "shadow-intensity": String(qo(f, 100)),
11608
- exposure: String(qo(u, 100)),
11624
+ "shadow-intensity": String(Jo(f, 100)),
11625
+ exposure: String(Jo(u, 100)),
11609
11626
  "field-of-view": p ? `${Number(p)}deg` : void 0,
11610
11627
  "environment-image": h && h !== "neutral" ? h : "neutral",
11611
11628
  "interaction-prompt": v ? "none" : void 0,
@@ -11623,7 +11640,7 @@ function Zo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
11623
11640
  }) : null
11624
11641
  });
11625
11642
  }
11626
- var Qo = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), $o = [
11643
+ var $o = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), es = [
11627
11644
  "precision highp float;",
11628
11645
  "uniform vec2 u_res;",
11629
11646
  "uniform float u_time;",
@@ -11646,7 +11663,7 @@ var Qo = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
11646
11663
  " return v;",
11647
11664
  "}",
11648
11665
  ""
11649
- ].join("\n"), es = {
11666
+ ].join("\n"), ts = {
11650
11667
  gradient: [
11651
11668
  "void main(){",
11652
11669
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -11698,7 +11715,7 @@ var Qo = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
11698
11715
  "}"
11699
11716
  ].join("\n")
11700
11717
  };
11701
- function ts(e, t) {
11718
+ function ns(e, t) {
11702
11719
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
11703
11720
  if (!n) return t;
11704
11721
  let r = parseInt(n[1], 16);
@@ -11708,7 +11725,7 @@ function ts(e, t) {
11708
11725
  (r & 255) / 255
11709
11726
  ];
11710
11727
  }
11711
- function ns(e, t, n) {
11728
+ function rs(e, t, n) {
11712
11729
  let r = e.createShader(t);
11713
11730
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
11714
11731
  let t = e.getShaderInfoLog(r);
@@ -11716,13 +11733,13 @@ function ns(e, t, n) {
11716
11733
  }
11717
11734
  return r;
11718
11735
  }
11719
- function rs({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: c, interactive: l, style: f, nodeRef: p, inert: g }) {
11736
+ function is({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: c, interactive: l, style: f, nodeRef: p, inert: g }) {
11720
11737
  let _ = u(null), v = u(null), y = u(null), [b, x] = d("");
11721
11738
  s(() => () => {
11722
11739
  let e = y.current;
11723
11740
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
11724
11741
  }, []);
11725
- let S = typeof t == "string" && t.trim() ? t : es[e] ?? es.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = qo(a, 100), D = Math.max(.05, qo(o, 100));
11742
+ let S = typeof t == "string" && t.trim() ? t : ts[e] ?? ts.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Jo(a, 100), D = Math.max(.05, Jo(o, 100));
11726
11743
  return s(() => {
11727
11744
  let e = _.current, t = v.current;
11728
11745
  if (!e || !t) return;
@@ -11737,7 +11754,7 @@ function rs({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11737
11754
  }
11738
11755
  let r = null;
11739
11756
  try {
11740
- let e = ns(n, n.VERTEX_SHADER, Qo), t = ns(n, n.FRAGMENT_SHADER, $o + S);
11757
+ let e = rs(n, n.VERTEX_SHADER, $o), t = rs(n, n.FRAGMENT_SHADER, es + S);
11741
11758
  if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
11742
11759
  x("");
11743
11760
  } catch (e) {
@@ -11773,28 +11790,28 @@ function rs({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11773
11790
  };
11774
11791
  l !== !1 && t.addEventListener("pointermove", u);
11775
11792
  let d = () => {
11776
- let r = Uo(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
11793
+ let r = Wo(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
11777
11794
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
11778
11795
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
11779
11796
  f?.observe(t), d();
11780
- let p = Ho(), m = {
11781
- a: ts(C, [
11797
+ let p = Uo(), m = {
11798
+ a: ns(C, [
11782
11799
  .35,
11783
11800
  .4,
11784
11801
  .95
11785
11802
  ]),
11786
- b: ts(w, [
11803
+ b: ns(w, [
11787
11804
  .05,
11788
11805
  .06,
11789
11806
  .16
11790
11807
  ]),
11791
- c: ts(T, [
11808
+ c: ns(T, [
11792
11809
  .95,
11793
11810
  .35,
11794
11811
  .6
11795
11812
  ])
11796
11813
  }, h = {};
11797
- return h.stop = Wo(t, (t, r) => {
11814
+ return h.stop = Go(t, (t, r) => {
11798
11815
  d(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (p ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), p && h.stop?.();
11799
11816
  }), () => {
11800
11817
  h.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", u), n.deleteProgram(r), n.deleteBuffer(i);
@@ -11813,7 +11830,7 @@ function rs({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11813
11830
  },
11814
11831
  style: {
11815
11832
  position: "relative",
11816
- minHeight: Ko(c, 320),
11833
+ minHeight: qo(c, 320),
11817
11834
  overflow: "hidden",
11818
11835
  ...P(f)
11819
11836
  },
@@ -11845,7 +11862,7 @@ function rs({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11845
11862
  }) : null]
11846
11863
  });
11847
11864
  }
11848
- function is(e, t) {
11865
+ function as(e, t) {
11849
11866
  let n = new e.Scene(), r = new e.BoxGeometry();
11850
11867
  r.deleteAttribute("uv");
11851
11868
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -11861,23 +11878,23 @@ function is(e, t) {
11861
11878
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
11862
11879
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
11863
11880
  }
11864
- var as = /* @__PURE__ */ new Map();
11865
- function os(e) {
11866
- if (as.has(e)) return as.get(e);
11867
- let t = Bo("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
11881
+ var os = /* @__PURE__ */ new Map();
11882
+ function ss(e) {
11883
+ if (os.has(e)) return os.get(e);
11884
+ let t = Vo("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
11868
11885
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
11869
11886
  })).catch((t) => {
11870
- throw as.delete(e), t;
11887
+ throw os.delete(e), t;
11871
11888
  });
11872
- return as.set(e, t), t;
11889
+ return os.set(e, t), t;
11873
11890
  }
11874
- function ss(e, t) {
11891
+ function cs(e, t) {
11875
11892
  let n = new e.Box3().setFromObject(t);
11876
11893
  if (n.isEmpty()) return t;
11877
11894
  let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
11878
11895
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
11879
11896
  }
11880
- var cs = {
11897
+ var ls = {
11881
11898
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
11882
11899
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
11883
11900
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -11886,50 +11903,50 @@ var cs = {
11886
11903
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
11887
11904
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
11888
11905
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
11889
- }, ls = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
11890
- function us({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: c, height: l, style: f, nodeRef: p, inert: h }) {
11891
- let g = u(null), [_, v] = d(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Ho(), S = o !== !1 && !h;
11906
+ }, us = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
11907
+ function ds({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: c, height: l, style: f, nodeRef: p, inert: h }) {
11908
+ let g = u(null), [_, v] = d(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Uo(), S = o !== !1 && !h;
11892
11909
  return s(() => {
11893
11910
  let e = g.current;
11894
11911
  if (!e) return;
11895
11912
  let i = !0, o = null;
11896
- return zo().then((s) => {
11913
+ return Bo().then((s) => {
11897
11914
  if (!i || !e) return;
11898
11915
  let l = new s.WebGLRenderer({
11899
11916
  antialias: !0,
11900
11917
  alpha: !t
11901
11918
  });
11902
- l.setPixelRatio(Uo()), l.shadowMap.enabled = c !== !1, l.shadowMap.type = s.PCFSoftShadowMap, l.outputColorSpace = s.SRGBColorSpace, l.toneMapping = s.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
11919
+ l.setPixelRatio(Wo()), l.shadowMap.enabled = c !== !1, l.shadowMap.type = s.PCFSoftShadowMap, l.outputColorSpace = s.SRGBColorSpace, l.toneMapping = s.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
11903
11920
  let u = new s.Scene();
11904
- t && (u.background = new s.Color(t)), u.environment = is(s, l);
11905
- let d = new s.PerspectiveCamera(ls(r, 45), 1, .1, 400), f = Go(d, l.domElement, {
11906
- distance: ls(n, 5),
11921
+ t && (u.background = new s.Color(t)), u.environment = as(s, l);
11922
+ let d = new s.PerspectiveCamera(us(r, 45), 1, .1, 400), f = Ko(d, l.domElement, {
11923
+ distance: us(n, 5),
11907
11924
  enableZoom: S
11908
11925
  }), p = new s.DirectionalLight(16777215, 2.2);
11909
11926
  p.position.set(4, 7, 5), p.castShadow = c !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, u.add(p, new s.AmbientLight(16777215, .35));
11910
11927
  let m = [], h = new s.Group(), g = (e, t) => {
11911
- let n = ls(t.scale, 1);
11912
- e.position.set(ls(t.x, 0), ls(t.y, 0), ls(t.z, 0)), e.rotation.set(Jo(t.rx), Jo(t.ry), Jo(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Jo(t.spin);
11928
+ let n = us(t.scale, 1);
11929
+ e.position.set(us(t.x, 0), us(t.y, 0), us(t.z, 0)), e.rotation.set(Yo(t.rx), Yo(t.ry), Yo(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Yo(t.spin);
11913
11930
  };
11914
11931
  for (let e of y) {
11915
11932
  if (e.shape === "model") {
11916
- if (!Yo(e.src)) continue;
11933
+ if (!Xo(e.src)) continue;
11917
11934
  let t = new s.Group();
11918
- g(t, e), h.add(t), os(e.src).then((e) => {
11935
+ g(t, e), h.add(t), ss(e.src).then((e) => {
11919
11936
  if (!i) return;
11920
- let n = ss(s, e.clone(!0));
11937
+ let n = cs(s, e.clone(!0));
11921
11938
  n.traverse((e) => {
11922
11939
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
11923
11940
  }), t.add(n);
11924
11941
  }, () => {});
11925
11942
  continue;
11926
11943
  }
11927
- let t = (cs[e.shape] ?? cs.box)(s), n = new s.MeshStandardMaterial({
11944
+ let t = (ls[e.shape] ?? ls.box)(s), n = new s.MeshStandardMaterial({
11928
11945
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
11929
- metalness: Math.min(1, Math.max(0, qo(e.metalness, 10))),
11930
- roughness: Math.min(1, Math.max(0, qo(e.roughness, 35))),
11931
- transparent: qo(e.opacity, 100) < 1,
11932
- opacity: Math.min(1, Math.max(0, qo(e.opacity, 100))),
11946
+ metalness: Math.min(1, Math.max(0, Jo(e.metalness, 10))),
11947
+ roughness: Math.min(1, Math.max(0, Jo(e.roughness, 35))),
11948
+ transparent: Jo(e.opacity, 100) < 1,
11949
+ opacity: Math.min(1, Math.max(0, Jo(e.opacity, 100))),
11933
11950
  flatShading: e.flat === !0,
11934
11951
  wireframe: e.wireframe === !0,
11935
11952
  side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
@@ -11940,14 +11957,14 @@ function us({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
11940
11957
  let _ = null;
11941
11958
  if (c !== !1) {
11942
11959
  let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
11943
- _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = ls(c === !0 ? 0 : c, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
11960
+ _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = us(c === !0 ? 0 : c, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
11944
11961
  }
11945
11962
  let v = () => {
11946
11963
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
11947
11964
  l.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
11948
11965
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
11949
11966
  b?.observe(e), v();
11950
- let C = Jo(Number.isFinite(Number(a)) ? a : 20), w = Wo(e, (e) => {
11967
+ let C = Yo(Number.isFinite(Number(a)) ? a : 20), w = Go(e, (e) => {
11951
11968
  f.autoSpin(x ? C : 0, e), f.update();
11952
11969
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
11953
11970
  l.render(u, d);
@@ -11971,7 +11988,7 @@ function us({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
11971
11988
  a,
11972
11989
  S,
11973
11990
  c
11974
- ]), _ && h ? /* @__PURE__ */ m(Xo, {
11991
+ ]), _ && h ? /* @__PURE__ */ m(Zo, {
11975
11992
  nodeRef: p,
11976
11993
  style: f,
11977
11994
  height: l,
@@ -11982,27 +11999,27 @@ function us({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
11982
11999
  g.current = e, typeof p == "function" && p(e);
11983
12000
  },
11984
12001
  style: {
11985
- minHeight: Ko(l, 380),
11986
- height: Ko(l, 380),
12002
+ minHeight: qo(l, 380),
12003
+ height: qo(l, 380),
11987
12004
  overflow: "hidden",
11988
12005
  touchAction: S ? "pan-y" : void 0,
11989
12006
  ...P(f)
11990
12007
  }
11991
12008
  });
11992
12009
  }
11993
- function ds({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
12010
+ function fs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
11994
12011
  let o = u(null), [c, l] = d("");
11995
12012
  return s(() => {
11996
12013
  let t = o.current;
11997
12014
  if (a || !t || typeof e != "string" || !e.trim()) return;
11998
12015
  let r = !0, i = null;
11999
- return zo().then((a) => {
12016
+ return Bo().then((a) => {
12000
12017
  if (!r || !t) return;
12001
12018
  let o = new a.WebGLRenderer({
12002
12019
  antialias: !0,
12003
12020
  alpha: !n
12004
12021
  });
12005
- o.setPixelRatio(Uo()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
12022
+ o.setPixelRatio(Wo()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
12006
12023
  let s = new a.Scene();
12007
12024
  n && (s.background = new a.Color(n));
12008
12025
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -12025,7 +12042,7 @@ function ds({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12025
12042
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
12026
12043
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
12027
12044
  f?.observe(t), d();
12028
- let p = !1, m = Wo(t, (e, t) => {
12045
+ let p = !1, m = Go(t, (e, t) => {
12029
12046
  if (!p && typeof u?.frame == "function") try {
12030
12047
  u.frame(e, t);
12031
12048
  } catch (e) {
@@ -12047,7 +12064,7 @@ function ds({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12047
12064
  e,
12048
12065
  a,
12049
12066
  n
12050
- ]), a ? /* @__PURE__ */ m(Xo, {
12067
+ ]), a ? /* @__PURE__ */ m(Zo, {
12051
12068
  nodeRef: i,
12052
12069
  style: r,
12053
12070
  height: t,
@@ -12058,8 +12075,8 @@ function ds({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12058
12075
  o.current = e, typeof i == "function" && i(e);
12059
12076
  },
12060
12077
  style: {
12061
- minHeight: Ko(t, 380),
12062
- height: Ko(t, 380),
12078
+ minHeight: qo(t, 380),
12079
+ height: qo(t, 380),
12063
12080
  overflow: "hidden",
12064
12081
  position: "relative",
12065
12082
  touchAction: "pan-y",
@@ -12082,30 +12099,30 @@ function ds({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12082
12099
  }) : null
12083
12100
  });
12084
12101
  }
12085
- var fs = {
12086
- ModelViewerBlock: Zo,
12087
- ShaderBlock: rs,
12088
- SceneBlock: us,
12089
- ThreeCanvasBlock: ds
12090
- }, ps = "2.44.0", ms = "https://cdn.jsdelivr.net/npm", hs = `${ms}/@rive-app/canvas@${ps}/+esm`, gs = `${ms}/@rive-app/canvas@${ps}/rive.wasm`, _s = (e) => import(
12102
+ var ps = {
12103
+ ModelViewerBlock: Qo,
12104
+ ShaderBlock: is,
12105
+ SceneBlock: ds,
12106
+ ThreeCanvasBlock: fs
12107
+ }, ms = "2.44.0", hs = "https://cdn.jsdelivr.net/npm", gs = `${hs}/@rive-app/canvas@${ms}/+esm`, _s = `${hs}/@rive-app/canvas@${ms}/rive.wasm`, vs = (e) => import(
12091
12108
  /* @vite-ignore */
12092
12109
  /* webpackIgnore: true */
12093
12110
  e
12094
- ), vs = null;
12095
- function ys() {
12096
- return typeof window > "u" ? new Promise(() => {}) : vs || (vs = _s(hs).then((e) => {
12111
+ ), ys = null;
12112
+ function bs() {
12113
+ return typeof window > "u" ? new Promise(() => {}) : ys || (ys = vs(gs).then((e) => {
12097
12114
  let t = e?.default ?? e;
12098
- return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(gs), t;
12115
+ return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(_s), t;
12099
12116
  }).catch((e) => {
12100
- throw vs = null, e;
12101
- }), vs);
12117
+ throw ys = null, e;
12118
+ }), ys);
12102
12119
  }
12103
- var bs = /* @__PURE__ */ new Map(), xs = {
12120
+ var xs = /* @__PURE__ */ new Map(), Ss = {
12104
12121
  56: "number",
12105
12122
  58: "trigger",
12106
12123
  59: "boolean"
12107
- }, Ss = /* @__PURE__ */ new Set();
12108
- function Cs(e, t) {
12124
+ }, Cs = /* @__PURE__ */ new Set();
12125
+ function ws(e, t) {
12109
12126
  if (!e || !t) return;
12110
12127
  let n = (Array.isArray(t.artboards) ? t.artboards : []).map((e) => ({
12111
12128
  name: String(e?.name ?? ""),
@@ -12114,15 +12131,15 @@ function Cs(e, t) {
12114
12131
  name: String(e?.name ?? ""),
12115
12132
  inputs: (Array.isArray(e?.inputs) ? e.inputs : []).map((e) => ({
12116
12133
  name: String(e?.name ?? ""),
12117
- type: xs[e?.type] ?? "unknown"
12134
+ type: Ss[e?.type] ?? "unknown"
12118
12135
  }))
12119
12136
  }))
12120
12137
  }));
12121
- bs.set(e, { artboards: n }), Ss.forEach((t) => t(e));
12138
+ xs.set(e, { artboards: n }), Cs.forEach((t) => t(e));
12122
12139
  }
12123
12140
  //#endregion
12124
12141
  //#region ../ui/src/components/builder/rive/views.jsx
12125
- var ws = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ts = [
12142
+ var Ts = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Es = [
12126
12143
  "contain",
12127
12144
  "cover",
12128
12145
  "fill",
@@ -12131,7 +12148,7 @@ var ws = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
12131
12148
  "scaleDown",
12132
12149
  "none",
12133
12150
  "layout"
12134
- ], Es = [
12151
+ ], Ds = [
12135
12152
  "center",
12136
12153
  "topLeft",
12137
12154
  "topCenter",
@@ -12141,8 +12158,8 @@ var ws = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
12141
12158
  "bottomLeft",
12142
12159
  "bottomCenter",
12143
12160
  "bottomRight"
12144
- ], Ds = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Os = 131;
12145
- function ks(e, t, n, r) {
12161
+ ], Os = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ks = 131;
12162
+ function As(e, t, n, r) {
12146
12163
  if (!e || !t || !n) return;
12147
12164
  let i = [];
12148
12165
  try {
@@ -12153,15 +12170,15 @@ function ks(e, t, n, r) {
12153
12170
  let a = i.find((e) => e?.name === n);
12154
12171
  a && (a.type === 58 ? r && a.fire() : a.type === 59 ? a.value = !!r : a.type === 56 && (a.value = +!!r));
12155
12172
  }
12156
- function As({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: c, animation: l, fit: f = "contain", alignment: p = "center", autoplay: g = !0, hoverInput: _, clickInput: v, style: y, nodeRef: b, inert: x }) {
12173
+ function js({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: c, animation: l, fit: f = "contain", alignment: p = "center", autoplay: g = !0, hoverInput: _, clickInput: v, style: y, nodeRef: b, inert: x }) {
12157
12174
  let S = u(null), C = u(null), w = u(null), T = u(""), [E, D] = d(!1), [O, k] = d(!1);
12158
12175
  s(() => {
12159
12176
  let t = C.current, n = S.current;
12160
12177
  if (D(!1), k(!1), !e || !t) return;
12161
12178
  let r = !0, i = null, s = null, u = null;
12162
- return ys().then((d) => {
12179
+ return bs().then((d) => {
12163
12180
  if (!r) return;
12164
- let m = o !== "animation", h = g !== !1 && !Ds();
12181
+ let m = o !== "animation", h = g !== !1 && !Os();
12165
12182
  try {
12166
12183
  i = new d.Rive({
12167
12184
  src: e,
@@ -12171,8 +12188,8 @@ function As({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12171
12188
  animations: !m && l ? l : void 0,
12172
12189
  autoplay: h,
12173
12190
  layout: new d.Layout({
12174
- fit: Ts.includes(f) ? f : "contain",
12175
- alignment: Es.includes(p) ? p : "center"
12191
+ fit: Es.includes(f) ? f : "contain",
12192
+ alignment: Ds.includes(p) ? p : "center"
12176
12193
  }),
12177
12194
  shouldDisableRiveListeners: !!x,
12178
12195
  isTouchScrollEnabled: !0,
@@ -12180,7 +12197,7 @@ function As({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12180
12197
  if (!r) return;
12181
12198
  i.resizeDrawingSurfaceToCanvas();
12182
12199
  let t = i.contents;
12183
- if (Cs(e, t), m) {
12200
+ if (ws(e, t), m) {
12184
12201
  let e = ((t?.artboards ?? []).find((e) => e.name === (a || i.activeArtboard)) ?? t?.artboards?.[0])?.stateMachines?.[0]?.name ?? "";
12185
12202
  if (T.current = c || e, !c && e) try {
12186
12203
  i.play(e), h || i.pause(e);
@@ -12196,7 +12213,7 @@ function As({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12196
12213
  }
12197
12214
  w.current = i, n && (n.rive = i), i.on(d.EventType.RiveEvent, (e) => {
12198
12215
  let t = e?.data;
12199
- x || t?.type !== Os || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
12216
+ x || t?.type !== ks || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
12200
12217
  }), n && typeof ResizeObserver < "u" && (s = new ResizeObserver(() => i?.resizeDrawingSurfaceToCanvas()), s.observe(n)), n && typeof IntersectionObserver < "u" && (u = new IntersectionObserver(([e]) => {
12201
12218
  i && (e?.isIntersecting ? i.startRendering?.() : i.stopRendering?.());
12202
12219
  }), u.observe(n));
@@ -12217,11 +12234,11 @@ function As({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12217
12234
  g,
12218
12235
  x
12219
12236
  ]);
12220
- let A = !x && E, j = (e, t) => A && ks(w.current, T.current, e, t), M = {
12237
+ let A = !x && E, j = (e, t) => A && As(w.current, T.current, e, t), M = {
12221
12238
  position: "relative",
12222
12239
  display: "block",
12223
12240
  width: "100%",
12224
- height: ws(r, 360),
12241
+ height: Ts(r, 360),
12225
12242
  backgroundColor: i || "transparent",
12226
12243
  overflow: "hidden",
12227
12244
  ...P(y)
@@ -12283,35 +12300,35 @@ function As({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12283
12300
  }), /* @__PURE__ */ m("span", { children: "Pick a .riv file in the Settings panel." })]
12284
12301
  }) : null;
12285
12302
  }
12286
- var js = { RiveBlock: As }, Ms = /* @__PURE__ */ new Map();
12287
- function Ns(e) {
12288
- if (Ms.has(e)) return Ms.get(e);
12303
+ var Ms = { RiveBlock: js }, Ns = /* @__PURE__ */ new Map();
12304
+ function Ps(e) {
12305
+ if (Ns.has(e)) return Ns.get(e);
12289
12306
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
12290
12307
  /* @vite-ignore */
12291
12308
  /* webpackIgnore: true */
12292
12309
  t
12293
12310
  ).finally(() => URL.revokeObjectURL(t));
12294
- return Ms.set(e, n), n;
12311
+ return Ns.set(e, n), n;
12295
12312
  }
12296
- function Ps(e) {
12313
+ function Fs(e) {
12297
12314
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
12298
12315
  return n && typeof n == "object" ? n : {};
12299
12316
  }
12300
12317
  //#endregion
12301
12318
  //#region ../ui/src/components/builder/plugins/view.jsx
12302
- async function Fs(e, t) {
12303
- let n = await Ns(e);
12319
+ async function Is(e, t) {
12320
+ let n = await Ps(e);
12304
12321
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
12305
12322
  }
12306
- var Is = {
12323
+ var Ls = {
12307
12324
  padding: "10px 12px",
12308
12325
  border: "1px dashed rgba(148, 163, 184, 0.5)",
12309
12326
  borderRadius: 8,
12310
12327
  fontSize: 12,
12311
12328
  opacity: .6
12312
12329
  };
12313
- function Ls({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12314
- let a = o(Y), c = Ps(a?.settings)[e], l = u(null), d = u(null), f = {
12330
+ function Rs({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12331
+ let a = o(Y), c = Fs(a?.settings)[e], l = u(null), d = u(null), f = {
12315
12332
  tenant: a?.tenant ?? "",
12316
12333
  apiUrl: a?.apiUrl ?? "/api",
12317
12334
  locale: a?.locale ?? "",
@@ -12323,7 +12340,7 @@ function Ls({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12323
12340
  let e = l.current;
12324
12341
  if (!c?.code || !e) return;
12325
12342
  let n = !0;
12326
- return Fs(c.code, t).then((e) => {
12343
+ return Is(c.code, t).then((e) => {
12327
12344
  if (!(!n || !e || !l.current)) {
12328
12345
  d.current = e;
12329
12346
  try {
@@ -12353,7 +12370,7 @@ function Ls({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12353
12370
  }) : /* @__PURE__ */ h("div", {
12354
12371
  ref: i,
12355
12372
  style: {
12356
- ...Is,
12373
+ ...Ls,
12357
12374
  ...P(r)
12358
12375
  },
12359
12376
  children: [
@@ -12365,7 +12382,7 @@ function Ls({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12365
12382
  }
12366
12383
  //#endregion
12367
12384
  //#region ../ui/src/components/builder/render.jsx
12368
- function Rs(e, t) {
12385
+ function zs(e, t) {
12369
12386
  let n = { "data-wb": e };
12370
12387
  t.htmlId && (n.id = t.htmlId);
12371
12388
  let r = R(t.classNames);
@@ -12379,7 +12396,7 @@ function Rs(e, t) {
12379
12396
  classes: r
12380
12397
  };
12381
12398
  }
12382
- function zs({ View: e, markup: n, ...r }) {
12399
+ function Bs({ View: e, markup: n, ...r }) {
12383
12400
  let a = e(r);
12384
12401
  if (!i(a) || typeof a.type != "string") return a;
12385
12402
  let o = [a.props.className, ...n.classes].filter(Boolean).join(" ");
@@ -12388,14 +12405,14 @@ function zs({ View: e, markup: n, ...r }) {
12388
12405
  ...o ? { className: o } : {}
12389
12406
  });
12390
12407
  }
12391
- var Bs = {
12408
+ var Vs = {
12392
12409
  ...Ti,
12393
- ...Ao,
12394
- ...fs,
12395
- ...js,
12396
- PluginBlock: Ls
12410
+ ...jo,
12411
+ ...ps,
12412
+ ...Ms,
12413
+ PluginBlock: Rs
12397
12414
  };
12398
- function Vs(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12415
+ function Hs(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12399
12416
  let o = n[t];
12400
12417
  if (!o || o.hidden) return null;
12401
12418
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -12403,19 +12420,19 @@ function Vs(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12403
12420
  let n = o.props?.componentId, s = r?.[n];
12404
12421
  if (!s?.template || i.has(n)) return null;
12405
12422
  let c = new Set(i).add(n);
12406
- return /* @__PURE__ */ m(e, { children: Vs(s.template.rootId, s.template.nodes, r, c, a) }, t);
12423
+ return /* @__PURE__ */ m(e, { children: Hs(s.template.rootId, s.template.nodes, r, c, a) }, t);
12407
12424
  }
12408
- let l = Bs[s];
12425
+ let l = Vs[s];
12409
12426
  if (!l) return null;
12410
- let u = (o.nodes ?? []).map((e) => Vs(e, n, r, i, a)).filter(Boolean), d = Object.entries(o.linkedNodes ?? {}), f = d.length ? Object.fromEntries(d.map(([e, t]) => [e, Vs(t, n, r, i, a)])) : void 0, p = /* @__PURE__ */ m(typeof l == "function" ? zs : l, {
12427
+ let u = (o.nodes ?? []).map((e) => Hs(e, n, r, i, a)).filter(Boolean), d = Object.entries(o.linkedNodes ?? {}), f = d.length ? Object.fromEntries(d.map(([e, t]) => [e, Hs(t, n, r, i, a)])) : void 0, p = /* @__PURE__ */ m(typeof l == "function" ? Bs : l, {
12411
12428
  ...typeof l == "function" ? {
12412
12429
  View: l,
12413
- markup: Rs(t, c)
12430
+ markup: zs(t, c)
12414
12431
  } : null,
12415
12432
  ...c,
12416
12433
  ...s === "CollectionList" ? {
12417
12434
  templateId: o.linkedNodes?.card,
12418
- renderTemplate: o.linkedNodes?.card ? (e) => Vs(o.linkedNodes.card, n, r, i, {
12435
+ renderTemplate: o.linkedNodes?.card ? (e) => Hs(o.linkedNodes.card, n, r, i, {
12419
12436
  ...a,
12420
12437
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
12421
12438
  }) : void 0
@@ -12436,9 +12453,9 @@ function Vs(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12436
12453
  }
12437
12454
  //#endregion
12438
12455
  //#region ../ui/src/components/builder/PageRenderer.jsx
12439
- var Hs = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Us = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(q(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
12456
+ var Us = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ws = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(q(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
12440
12457
  .webim-page[data-webim-mode="dark"] { ${Object.entries(q(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
12441
- function Ws({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: u, datasets: d, locale: f, direction: p, settings: g, siteUser: _, param: v }) {
12458
+ function Gs({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: u, datasets: d, locale: f, direction: p, settings: g, siteUser: _, param: v }) {
12442
12459
  let y = a?.js?.trim();
12443
12460
  if (s(() => {
12444
12461
  if (!y) return;
@@ -12452,11 +12469,11 @@ function Ws({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12452
12469
  minHeight: "100%",
12453
12470
  display: "flex",
12454
12471
  flexDirection: "column"
12455
- }, T = Vs("ROOT", e, n), E = l(() => ({ render: (t, r) => Vs(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = fe(e, n), O = de(e, n), k = a?.css?.trim(), j = A(o), M = Ce(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !be[e]), P = [.../* @__PURE__ */ new Set([...C(e, n), ...N])].map((e) => /* @__PURE__ */ m("link", {
12472
+ }, T = Hs("ROOT", e, n), E = l(() => ({ render: (t, r) => Hs(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = fe(e, n), O = de(e, n), k = a?.css?.trim(), j = A(o), M = Ce(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !be[e]), P = [.../* @__PURE__ */ new Set([...C(e, n), ...N])].map((e) => /* @__PURE__ */ m("link", {
12456
12473
  rel: "stylesheet",
12457
12474
  precedence: "default",
12458
12475
  href: b(e)
12459
- }, e)), F = Us(M);
12476
+ }, e)), F = Ws(M);
12460
12477
  return r === "auto" ? /* @__PURE__ */ m(Y.Provider, {
12461
12478
  value: {
12462
12479
  tenant: c || "",
@@ -12480,8 +12497,8 @@ function Ws({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12480
12497
  ...i
12481
12498
  },
12482
12499
  children: [
12483
- /* @__PURE__ */ m("style", { children: `.webim-page { ${Hs(q(M.light))} }
12484
- @media (prefers-color-scheme: dark) { .webim-page { ${Hs(q(M.dark))} } }` }),
12500
+ /* @__PURE__ */ m("style", { children: `.webim-page { ${Us(q(M.light))} }
12501
+ @media (prefers-color-scheme: dark) { .webim-page { ${Us(q(M.dark))} } }` }),
12485
12502
  /* @__PURE__ */ m("style", { children: F }),
12486
12503
  P,
12487
12504
  /* @__PURE__ */ m("style", { children: S }),
@@ -12535,8 +12552,8 @@ function Ws({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12535
12552
  }
12536
12553
  //#endregion
12537
12554
  //#region src/WebimContent.jsx
12538
- function Gs({ bundle: e, mode: t = "auto", style: n }) {
12539
- return e?.blocks?.ROOT ? /* @__PURE__ */ m(Ws, {
12555
+ function Ks({ bundle: e, mode: t = "auto", style: n }) {
12556
+ return e?.blocks?.ROOT ? /* @__PURE__ */ m(Gs, {
12540
12557
  blocks: e.blocks,
12541
12558
  theme: e.theme,
12542
12559
  components: e.components,
@@ -12555,7 +12572,7 @@ function Gs({ bundle: e, mode: t = "auto", style: n }) {
12555
12572
  }
12556
12573
  //#endregion
12557
12574
  //#region src/WebimPage.jsx
12558
- function Ks({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mode: o = "auto", style: c, fallback: l = null, errorFallback: f = null, onLoad: p, onError: h }) {
12575
+ function qs({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mode: o = "auto", style: c, fallback: l = null, errorFallback: f = null, onLoad: p, onError: h }) {
12559
12576
  let [g, _] = d({ status: "loading" }), v = u({
12560
12577
  onLoad: p,
12561
12578
  onError: h
@@ -12592,11 +12609,11 @@ function Ks({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mo
12592
12609
  r,
12593
12610
  i,
12594
12611
  a
12595
- ]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ m(Gs, {
12612
+ ]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ m(Ks, {
12596
12613
  bundle: g.bundle,
12597
12614
  mode: o,
12598
12615
  style: c
12599
12616
  });
12600
12617
  }
12601
12618
  //#endregion
12602
- export { Ws as PageRenderer, Gs as WebimContent, Ks as WebimPage, je as fetchPage, an as renderRichContent, De as resolveTheme };
12619
+ export { Gs as PageRenderer, Ks as WebimContent, qs as WebimPage, je as fetchPage, an as renderRichContent, De as resolveTheme };