webim-adapter 0.18.0 → 0.20.0

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.
@@ -1941,7 +1941,7 @@ function st({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1941
1941
  display: A === "success" ? "none" : "flex"
1942
1942
  },
1943
1943
  children: c && s ? /* @__PURE__ */ f(u, { children: [
1944
- P && /* @__PURE__ */ d(St, {
1944
+ P && /* @__PURE__ */ d(Ot, {
1945
1945
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1946
1946
  active: F + 1,
1947
1947
  style: { marginBottom: 8 }
@@ -2027,24 +2027,36 @@ function st({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2027
2027
  ]
2028
2028
  });
2029
2029
  }
2030
- var ct = null, lt = () => ct || (ct = new Promise((e) => {
2031
- if (typeof window > "u") return;
2032
- if (window.grecaptcha?.render) return e(window.grecaptcha);
2033
- window.__webimRecaptchaReady = () => e(window.grecaptcha);
2034
- let t = document.createElement("script");
2035
- t.src = "https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit", t.async = !0, document.head.appendChild(t);
2036
- }), ct);
2037
- function ut({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
2038
- let l = i(H), u = l?.settings && typeof l.settings == "object" ? l.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof u == "string" ? u.trim() : ""), m = c(null), h = c(!1);
2030
+ var Q = null, ct = null, lt = (e) => {
2031
+ let t = typeof e == "string" && e.trim() ? e.trim() : "";
2032
+ if (Q && ct === t) return Q;
2033
+ if (Q && typeof window < "u") {
2034
+ for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2035
+ delete window[e];
2036
+ } catch {
2037
+ window[e] = void 0;
2038
+ }
2039
+ document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2040
+ }
2041
+ return ct = t, Q = new Promise((e) => {
2042
+ if (typeof window > "u") return;
2043
+ if (window.grecaptcha?.render) return e(window.grecaptcha);
2044
+ window.__webimRecaptchaReady = () => e(window.grecaptcha);
2045
+ let n = document.createElement("script");
2046
+ n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2047
+ }), Q;
2048
+ };
2049
+ function ut({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l }) {
2050
+ let u = i(H), p = u?.settings && typeof u.settings == "object" ? u.settings["google.recaptchaKey"] : "", m = typeof e == "string" && e.trim() || (typeof p == "string" ? p.trim() : ""), h = c(null);
2039
2051
  if (a(() => {
2040
- if (s || !p || h.current || !m.current) return;
2052
+ if (l || !m || !h.current) return;
2041
2053
  let e = !0;
2042
- return lt().then((r) => {
2043
- if (!(!e || h.current || !m.current || !r?.render)) {
2044
- h.current = !0;
2054
+ return lt(r).then((r) => {
2055
+ if (!(!e || !h.current || !r?.render)) {
2056
+ h.current.innerHTML = "";
2045
2057
  try {
2046
- r.render(m.current, {
2047
- sitekey: p,
2058
+ r.render(h.current, {
2059
+ sitekey: m,
2048
2060
  theme: t === "dark" ? "dark" : "light",
2049
2061
  size: n === "compact" ? "compact" : "normal"
2050
2062
  });
@@ -2054,15 +2066,16 @@ function ut({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
2054
2066
  e = !1;
2055
2067
  };
2056
2068
  }, [
2057
- s,
2058
- p,
2069
+ l,
2070
+ m,
2059
2071
  t,
2060
- n
2061
- ]), s) {
2072
+ n,
2073
+ r
2074
+ ]), l) {
2062
2075
  let e = t === "dark";
2063
2076
  return /* @__PURE__ */ f("div", {
2064
- ref: o,
2065
- style: C(r),
2077
+ ref: s,
2078
+ style: C(o),
2066
2079
  children: [/* @__PURE__ */ f("div", {
2067
2080
  style: {
2068
2081
  width: n === "compact" ? 164 : 302,
@@ -2101,7 +2114,7 @@ function ut({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
2101
2114
  children: "reCAPTCHA"
2102
2115
  })
2103
2116
  ]
2104
- }), !p && /* @__PURE__ */ d("div", {
2117
+ }), !m && /* @__PURE__ */ d("div", {
2105
2118
  style: {
2106
2119
  marginTop: 6,
2107
2120
  fontSize: 11,
@@ -2111,10 +2124,10 @@ function ut({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
2111
2124
  })]
2112
2125
  });
2113
2126
  }
2114
- return p ? /* @__PURE__ */ d("div", {
2115
- ref: o,
2116
- style: C(r),
2117
- children: /* @__PURE__ */ d("div", { ref: m })
2127
+ return m ? /* @__PURE__ */ d("div", {
2128
+ ref: s,
2129
+ style: C(o),
2130
+ children: /* @__PURE__ */ d("div", { ref: h })
2118
2131
  }) : null;
2119
2132
  }
2120
2133
  function dt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
@@ -2513,7 +2526,243 @@ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
2513
2526
  ]
2514
2527
  });
2515
2528
  }
2516
- function St({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2529
+ var St = "webim.page_mode", Ct = () => {
2530
+ if (typeof window > "u") return "auto";
2531
+ try {
2532
+ let e = window.localStorage.getItem(St);
2533
+ return e === "light" || e === "dark" ? e : "auto";
2534
+ } catch {
2535
+ return "auto";
2536
+ }
2537
+ }, wt = (e) => {
2538
+ let t = {
2539
+ width: 16,
2540
+ height: 16,
2541
+ viewBox: "0 0 24 24",
2542
+ fill: "none",
2543
+ stroke: "currentColor",
2544
+ strokeWidth: 2,
2545
+ strokeLinecap: "round",
2546
+ strokeLinejoin: "round",
2547
+ "aria-hidden": !0
2548
+ };
2549
+ return e === "light" ? /* @__PURE__ */ f("svg", {
2550
+ ...t,
2551
+ children: [/* @__PURE__ */ d("circle", {
2552
+ cx: "12",
2553
+ cy: "12",
2554
+ r: "4"
2555
+ }), /* @__PURE__ */ d("path", { d: "M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" })]
2556
+ }) : e === "dark" ? /* @__PURE__ */ d("svg", {
2557
+ ...t,
2558
+ children: /* @__PURE__ */ d("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
2559
+ }) : /* @__PURE__ */ f("svg", {
2560
+ ...t,
2561
+ children: [/* @__PURE__ */ d("rect", {
2562
+ x: "2",
2563
+ y: "3",
2564
+ width: "20",
2565
+ height: "14",
2566
+ rx: "2"
2567
+ }), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
2568
+ });
2569
+ }, $ = {
2570
+ light: "Light theme",
2571
+ dark: "Dark theme",
2572
+ auto: "Follow the device theme"
2573
+ };
2574
+ function Tt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
2575
+ let [o, s] = l(i ? "auto" : Ct), u = c(null), f = (e) => {
2576
+ u.current = e, typeof r == "function" && r(e);
2577
+ };
2578
+ a(() => {
2579
+ if (i) return;
2580
+ let e = u.current?.closest?.(".webim-page");
2581
+ e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
2582
+ try {
2583
+ o === "auto" ? window.localStorage.removeItem(St) : window.localStorage.setItem(St, o);
2584
+ } catch {}
2585
+ }, [o, i]);
2586
+ let p = t === !1 ? ["light", "dark"] : [
2587
+ "light",
2588
+ "dark",
2589
+ "auto"
2590
+ ], m = p.includes(o) ? o : p[0], h = {
2591
+ appearance: "none",
2592
+ border: 0,
2593
+ margin: 0,
2594
+ display: "inline-flex",
2595
+ alignItems: "center",
2596
+ justifyContent: "center",
2597
+ background: "transparent",
2598
+ color: "inherit",
2599
+ font: "inherit",
2600
+ cursor: i ? "default" : "pointer",
2601
+ borderRadius: 999
2602
+ };
2603
+ if (e === "buttons") return /* @__PURE__ */ d("div", {
2604
+ ref: f,
2605
+ role: "group",
2606
+ "aria-label": "Theme",
2607
+ style: {
2608
+ display: "inline-flex",
2609
+ alignItems: "center",
2610
+ gap: 2,
2611
+ padding: 3,
2612
+ borderRadius: 999,
2613
+ border: "1px solid rgba(148, 163, 184, 0.4)",
2614
+ ...C(n)
2615
+ },
2616
+ children: p.map((e) => /* @__PURE__ */ d("button", {
2617
+ type: "button",
2618
+ title: $[e],
2619
+ "aria-label": $[e],
2620
+ "aria-pressed": e === m,
2621
+ onClick: i ? void 0 : () => s(e),
2622
+ style: {
2623
+ ...h,
2624
+ width: 28,
2625
+ height: 28,
2626
+ color: e === m ? "var(--page-accent-text, #ffffff)" : "inherit",
2627
+ background: e === m ? "var(--page-accent, #111827)" : "transparent",
2628
+ opacity: e === m ? 1 : .7
2629
+ },
2630
+ children: wt(e)
2631
+ }, e))
2632
+ });
2633
+ let g = p[(p.indexOf(m) + 1) % p.length];
2634
+ return /* @__PURE__ */ d("button", {
2635
+ ref: f,
2636
+ type: "button",
2637
+ title: $[m],
2638
+ "aria-label": `Theme: ${$[m]} — switch to ${$[g]}`,
2639
+ onClick: i ? void 0 : () => s(g),
2640
+ style: {
2641
+ ...h,
2642
+ width: 36,
2643
+ height: 36,
2644
+ border: "1px solid rgba(148, 163, 184, 0.4)",
2645
+ ...C(n)
2646
+ },
2647
+ children: wt(m)
2648
+ });
2649
+ }
2650
+ var Et = {
2651
+ facebook: {
2652
+ label: "Facebook",
2653
+ color: "#1877f2",
2654
+ d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
2655
+ },
2656
+ instagram: {
2657
+ label: "Instagram",
2658
+ color: "#e4405f",
2659
+ d: "M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06zm0 5.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"
2660
+ },
2661
+ x: {
2662
+ label: "X (Twitter)",
2663
+ color: "#000000",
2664
+ d: "M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"
2665
+ },
2666
+ linkedin: {
2667
+ label: "LinkedIn",
2668
+ color: "#0a66c2",
2669
+ d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
2670
+ },
2671
+ youtube: {
2672
+ label: "YouTube",
2673
+ color: "#ff0000",
2674
+ d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
2675
+ },
2676
+ tiktok: {
2677
+ label: "TikTok",
2678
+ color: "#000000",
2679
+ d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"
2680
+ },
2681
+ whatsapp: {
2682
+ label: "WhatsApp",
2683
+ color: "#25d366",
2684
+ d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"
2685
+ },
2686
+ telegram: {
2687
+ label: "Telegram",
2688
+ color: "#26a5e4",
2689
+ d: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"
2690
+ },
2691
+ pinterest: {
2692
+ label: "Pinterest",
2693
+ color: "#bd081c",
2694
+ d: "M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.03-.655 2.569-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z"
2695
+ },
2696
+ github: {
2697
+ label: "GitHub",
2698
+ color: "#181717",
2699
+ d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
2700
+ },
2701
+ discord: {
2702
+ label: "Discord",
2703
+ color: "#5865f2",
2704
+ d: "M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.058a.082.082 0 00.031.056 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.873-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.009c.12.099.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"
2705
+ },
2706
+ email: {
2707
+ label: "E-mail",
2708
+ color: "#64748b",
2709
+ d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"
2710
+ },
2711
+ website: {
2712
+ label: "Website",
2713
+ color: "#64748b",
2714
+ d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
2715
+ }
2716
+ };
2717
+ function Dt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
2718
+ let l = Array.isArray(e) ? e.filter((e) => e && Et[e.network]) : [];
2719
+ if (!l.length) return null;
2720
+ let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
2721
+ return /* @__PURE__ */ d("div", {
2722
+ ref: s,
2723
+ style: {
2724
+ display: "flex",
2725
+ flexWrap: "wrap",
2726
+ alignItems: "center",
2727
+ gap: p,
2728
+ ...C(o)
2729
+ },
2730
+ children: l.map((e, r) => {
2731
+ let i = Et[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
2732
+ return /* @__PURE__ */ d("a", {
2733
+ href: e.url || "#",
2734
+ onClick: h,
2735
+ "aria-label": e.label || i.label,
2736
+ title: e.label || i.label,
2737
+ ...a !== !1 && !c ? {
2738
+ target: "_blank",
2739
+ rel: "noopener noreferrer"
2740
+ } : {},
2741
+ style: {
2742
+ display: "inline-flex",
2743
+ alignItems: "center",
2744
+ justifyContent: "center",
2745
+ width: t === "plain" ? u : f,
2746
+ height: t === "plain" ? u : f,
2747
+ borderRadius: "50%",
2748
+ background: o ? m(i) : "transparent",
2749
+ border: t === "outline" ? `1px solid ${m(i)}` : "none",
2750
+ color: "inherit",
2751
+ textDecoration: "none"
2752
+ },
2753
+ children: /* @__PURE__ */ d("svg", {
2754
+ width: u,
2755
+ height: u,
2756
+ viewBox: "0 0 24 24",
2757
+ fill: s,
2758
+ "aria-hidden": !0,
2759
+ children: /* @__PURE__ */ d("path", { d: i.d })
2760
+ })
2761
+ }, `${e.network}-${r}`);
2762
+ })
2763
+ });
2764
+ }
2765
+ function Ot({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2517
2766
  if (!e.length) return null;
2518
2767
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
2519
2768
  width: 32,
@@ -2591,7 +2840,7 @@ function St({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2591
2840
  })
2592
2841
  });
2593
2842
  }
2594
- var Ct = {
2843
+ var kt = {
2595
2844
  small: {
2596
2845
  w: 132,
2597
2846
  h: 46,
@@ -2613,10 +2862,10 @@ var Ct = {
2613
2862
  title: 12.5,
2614
2863
  avatar: 46
2615
2864
  }
2616
- }, wt = (e) => Ct[e] ?? Ct.medium;
2617
- Ct.medium.w, Ct.medium.h;
2618
- function Tt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2619
- let r = wt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2865
+ }, At = (e) => kt[e] ?? kt.medium;
2866
+ kt.medium.w, kt.medium.h;
2867
+ function jt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2868
+ let r = At(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2620
2869
  for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
2621
2870
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2622
2871
  if (t.has(e.id)) return 0;
@@ -2668,18 +2917,18 @@ function Tt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2668
2917
  horizontal: n
2669
2918
  };
2670
2919
  }
2671
- var Et = (e, t) => {
2920
+ var Mt = (e, t) => {
2672
2921
  let n = String(e ?? "");
2673
2922
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2674
- }, Dt = (e) => {
2923
+ }, Nt = (e) => {
2675
2924
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2676
2925
  if (!t) return "#ffffff";
2677
2926
  let n = t[1];
2678
2927
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2679
2928
  let r = parseInt(n, 16);
2680
2929
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2681
- }, Ot = (e) => !!(e?.cv?.trim?.() || e?.photo);
2682
- function kt(e, t = {}) {
2930
+ }, Pt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2931
+ function Ft(e, t = {}) {
2683
2932
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
2684
2933
  return n.map((e) => {
2685
2934
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -2694,11 +2943,11 @@ function kt(e, t = {}) {
2694
2943
  };
2695
2944
  });
2696
2945
  }
2697
- var At = {
2946
+ var It = {
2698
2947
  size: 36,
2699
2948
  pad: 10
2700
2949
  };
2701
- function jt({ node: e, onClose: t }) {
2950
+ function Lt({ node: e, onClose: t }) {
2702
2951
  return a(() => {
2703
2952
  let e = (e) => e.key === "Escape" && t();
2704
2953
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -2816,7 +3065,7 @@ function jt({ node: e, onClose: t }) {
2816
3065
  })
2817
3066
  });
2818
3067
  }
2819
- function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
3068
+ function Rt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
2820
3069
  let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
2821
3070
  a(() => {
2822
3071
  if (!t || E) return;
@@ -2833,14 +3082,14 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2833
3082
  T,
2834
3083
  E
2835
3084
  ]);
2836
- let k = t ? kt(E ?? D ?? [], {
3085
+ let k = t ? Ft(E ?? D ?? [], {
2837
3086
  nameField: n,
2838
3087
  titleField: r,
2839
3088
  photoField: s,
2840
3089
  parentField: c,
2841
3090
  cvField: p,
2842
3091
  hrefField: m
2843
- }) : e, A = wt(h), { boxes: j, links: M, width: N, height: P } = Tt(k, {
3092
+ }) : e, A = At(h), { boxes: j, links: M, width: N, height: P } = jt(k, {
2844
3093
  size: h,
2845
3094
  horizontal: g
2846
3095
  });
@@ -2886,7 +3135,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2886
3135
  stroke: "rgba(148, 163, 184, 0.7)",
2887
3136
  strokeWidth: "1.5"
2888
3137
  }, t)), j.map(({ node: e, x: t, y: n }) => {
2889
- let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Dt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Dt(e.color2) : s, l = y && (Ot(e) || e.href), p = () => Ot(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + At.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
3138
+ let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Nt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Nt(e.color2) : s, l = y && (Pt(e) || e.href), p = () => Pt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + It.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2890
3139
  return /* @__PURE__ */ f("g", {
2891
3140
  onClick: l ? p : void 0,
2892
3141
  style: l ? { cursor: "pointer" } : void 0,
@@ -2950,13 +3199,13 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2950
3199
  e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
2951
3200
  id: `${b}-${e.id}`,
2952
3201
  children: /* @__PURE__ */ d("circle", {
2953
- cx: t + At.pad + A.avatar / 2,
3202
+ cx: t + It.pad + A.avatar / 2,
2954
3203
  cy: n + A.h / 2,
2955
3204
  r: A.avatar / 2
2956
3205
  })
2957
3206
  }), /* @__PURE__ */ d("image", {
2958
3207
  href: e.photo,
2959
- x: t + At.pad,
3208
+ x: t + It.pad,
2960
3209
  y: n + (A.h - A.avatar) / 2,
2961
3210
  width: A.avatar,
2962
3211
  height: A.avatar,
@@ -2970,7 +3219,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2970
3219
  fontSize: A.title,
2971
3220
  fontWeight: "600",
2972
3221
  fill: s,
2973
- children: Et(e.title, g + 4)
3222
+ children: Mt(e.title, g + 4)
2974
3223
  }), e.name && /* @__PURE__ */ d("text", {
2975
3224
  x: m,
2976
3225
  y: n + _ + _ / 2 + A.name * .35,
@@ -2978,7 +3227,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2978
3227
  fontSize: A.name,
2979
3228
  fontWeight: "600",
2980
3229
  fill: c,
2981
- children: Et(e.name, g)
3230
+ children: Mt(e.name, g)
2982
3231
  })] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
2983
3232
  x: m,
2984
3233
  y: n + (v[1] ? A.h * .43 : A.h * .57),
@@ -2986,7 +3235,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2986
3235
  fontSize: A.name,
2987
3236
  fontWeight: "600",
2988
3237
  fill: s,
2989
- children: Et(v[0], g)
3238
+ children: Mt(v[0], g)
2990
3239
  }), v[1] && /* @__PURE__ */ d("text", {
2991
3240
  x: m,
2992
3241
  y: n + A.h * .73,
@@ -2994,18 +3243,18 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2994
3243
  fontSize: A.title,
2995
3244
  opacity: "0.7",
2996
3245
  fill: s,
2997
- children: Et(v[1], g + 4)
3246
+ children: Mt(v[1], g + 4)
2998
3247
  })] })
2999
3248
  ]
3000
3249
  }, e.id);
3001
3250
  })]
3002
- }), x && /* @__PURE__ */ d(jt, {
3251
+ }), x && /* @__PURE__ */ d(Lt, {
3003
3252
  node: x,
3004
3253
  onClose: () => S(null)
3005
3254
  })]
3006
3255
  });
3007
3256
  }
3008
- function Nt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, paged: u, emptyText: p, style: m, nodeRef: h }) {
3257
+ function zt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, paged: u, emptyText: p, style: m, nodeRef: h }) {
3009
3258
  let { tenant: g, apiUrl: _ } = i(H), v = i(U), y = v?.[n], b = u ? W(v) : 1, [x, S] = l(null);
3010
3259
  if (a(() => {
3011
3260
  if (!n || y) return;
@@ -3071,7 +3320,7 @@ function Nt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
3071
3320
  })
3072
3321
  });
3073
3322
  }
3074
- var Pt = {
3323
+ var Bt = {
3075
3324
  PageRoot: he,
3076
3325
  Section: ge,
3077
3326
  Container: _e,
@@ -3088,9 +3337,11 @@ var Pt = {
3088
3337
  CollectionList: yt,
3089
3338
  BreadcrumbsBlock: bt,
3090
3339
  PaginationBlock: xt,
3091
- StepperBlock: St,
3092
- OrgChartBlock: Mt,
3093
- TableBlock: Nt,
3340
+ StepperBlock: Ot,
3341
+ SocialLinksBlock: Dt,
3342
+ ThemeModeBlock: Tt,
3343
+ OrgChartBlock: Rt,
3344
+ TableBlock: zt,
3094
3345
  MasonryBlock: Je,
3095
3346
  AccordionBlock: $e,
3096
3347
  NavbarBlock: Ze,
@@ -3120,26 +3371,26 @@ var Pt = {
3120
3371
  FormFile: gt,
3121
3372
  FormRecaptcha: ut,
3122
3373
  FormSubmit: _t
3123
- }, Ft = {
3374
+ }, Vt = {
3124
3375
  id: "auth",
3125
3376
  label: "Accounts",
3126
3377
  category: "Apps",
3127
3378
  keys: ["SiteLoginForm", "SiteAccountMenu"],
3128
3379
  ssr: "shell",
3129
3380
  settings: ["site.authRedirect"]
3130
- }, It = n({
3381
+ }, Ht = n({
3131
3382
  user: null,
3132
3383
  status: "idle",
3133
3384
  ensure: () => {},
3134
3385
  refresh: () => {},
3135
3386
  signOut: () => {}
3136
- }), Lt = () => {
3137
- let e = i(It);
3387
+ }), Ut = () => {
3388
+ let e = i(Ht);
3138
3389
  return a(() => {
3139
3390
  e.ensure();
3140
3391
  }, [e]), e;
3141
3392
  };
3142
- function Rt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
3393
+ function Wt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
3143
3394
  let u = i(H), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
3144
3395
  ...t,
3145
3396
  credentials: "include",
@@ -3172,18 +3423,18 @@ function Rt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o })
3172
3423
  b,
3173
3424
  x
3174
3425
  ]);
3175
- return /* @__PURE__ */ d(It.Provider, {
3426
+ return /* @__PURE__ */ d(Ht.Provider, {
3176
3427
  value: C,
3177
3428
  children: e
3178
3429
  });
3179
3430
  }
3180
- function zt({ when: e, children: t }) {
3181
- let { status: n } = Lt();
3431
+ function Gt({ when: e, children: t }) {
3432
+ let { status: n } = Ut();
3182
3433
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
3183
3434
  }
3184
3435
  //#endregion
3185
3436
  //#region ../ui/src/components/builder/apps/auth/views.jsx
3186
- function Bt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
3437
+ function Kt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
3187
3438
  let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
3188
3439
  if (e.preventDefault(), u) return;
3189
3440
  let n = new FormData(e.currentTarget);
@@ -3307,8 +3558,8 @@ function Bt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3307
3558
  ]
3308
3559
  });
3309
3560
  }
3310
- function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3311
- let { user: c, status: l, signOut: u } = Lt(), p = a ? s || "user" : l, m = a ? {
3561
+ function qt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3562
+ let { user: c, status: l, signOut: u } = Ut(), p = a ? s || "user" : l, m = a ? {
3312
3563
  name: "Ada Lovelace",
3313
3564
  email: "ada@example.com"
3314
3565
  } : c;
@@ -3373,42 +3624,42 @@ function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3373
3624
  }
3374
3625
  //#endregion
3375
3626
  //#region ../ui/src/components/builder/apps/index.js
3376
- var Ht = [Ft], Ut = {
3377
- SiteLoginForm: Bt,
3378
- SiteAccountMenu: Vt
3627
+ var Jt = [Vt], Yt = {
3628
+ SiteLoginForm: Kt,
3629
+ SiteAccountMenu: qt
3379
3630
  };
3380
- new Set(Ht.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3631
+ new Set(Jt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3381
3632
  //#endregion
3382
3633
  //#region ../ui/src/components/builder/plugins/runtime.js
3383
- var Wt = /* @__PURE__ */ new Map();
3384
- function Gt(e) {
3385
- if (Wt.has(e)) return Wt.get(e);
3634
+ var Xt = /* @__PURE__ */ new Map();
3635
+ function Zt(e) {
3636
+ if (Xt.has(e)) return Xt.get(e);
3386
3637
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
3387
3638
  /* @vite-ignore */
3388
3639
  /* webpackIgnore: true */
3389
3640
  t
3390
3641
  ).finally(() => URL.revokeObjectURL(t));
3391
- return Wt.set(e, n), n;
3642
+ return Xt.set(e, n), n;
3392
3643
  }
3393
- function Kt(e) {
3644
+ function Qt(e) {
3394
3645
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
3395
3646
  return n && typeof n == "object" ? n : {};
3396
3647
  }
3397
3648
  //#endregion
3398
3649
  //#region ../ui/src/components/builder/plugins/view.jsx
3399
- async function qt(e, t) {
3400
- let n = await Gt(e);
3650
+ async function $t(e, t) {
3651
+ let n = await Zt(e);
3401
3652
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
3402
3653
  }
3403
- var Jt = {
3654
+ var en = {
3404
3655
  padding: "10px 12px",
3405
3656
  border: "1px dashed rgba(148, 163, 184, 0.5)",
3406
3657
  borderRadius: 8,
3407
3658
  fontSize: 12,
3408
3659
  opacity: .6
3409
3660
  };
3410
- function Yt({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3411
- let s = i(H), l = Kt(s?.settings)[e], u = c(null), p = c(null), m = {
3661
+ function tn({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3662
+ let s = i(H), l = Qt(s?.settings)[e], u = c(null), p = c(null), m = {
3412
3663
  tenant: s?.tenant ?? "",
3413
3664
  apiUrl: s?.apiUrl ?? "/api",
3414
3665
  locale: s?.locale ?? "",
@@ -3420,7 +3671,7 @@ function Yt({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3420
3671
  let e = u.current;
3421
3672
  if (!l?.code || !e) return;
3422
3673
  let n = !0;
3423
- return qt(l.code, t).then((e) => {
3674
+ return $t(l.code, t).then((e) => {
3424
3675
  if (!(!n || !e || !u.current)) {
3425
3676
  p.current = e;
3426
3677
  try {
@@ -3450,7 +3701,7 @@ function Yt({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3450
3701
  }) : /* @__PURE__ */ f("div", {
3451
3702
  ref: o,
3452
3703
  style: {
3453
- ...Jt,
3704
+ ...en,
3454
3705
  ...C(r)
3455
3706
  },
3456
3707
  children: [
@@ -3462,12 +3713,12 @@ function Yt({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3462
3713
  }
3463
3714
  //#endregion
3464
3715
  //#region ../ui/src/components/builder/render.jsx
3465
- var Xt = {
3466
- ...Pt,
3467
- ...Ut,
3468
- PluginBlock: Yt
3716
+ var nn = {
3717
+ ...Bt,
3718
+ ...Yt,
3719
+ PluginBlock: tn
3469
3720
  };
3470
- function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3721
+ function rn(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3471
3722
  let o = n[e];
3472
3723
  if (!o || o.hidden) return null;
3473
3724
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -3475,11 +3726,11 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3475
3726
  let n = o.props?.componentId, s = r?.[n];
3476
3727
  if (!s?.template || i.has(n)) return null;
3477
3728
  let c = new Set(i).add(n);
3478
- return /* @__PURE__ */ d(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
3729
+ return /* @__PURE__ */ d(t, { children: rn(s.template.rootId, s.template.nodes, r, c, a) }, e);
3479
3730
  }
3480
- let l = Xt[s];
3731
+ let l = nn[s];
3481
3732
  if (!l) return null;
3482
- let u = (o.nodes ?? []).map((e) => Q(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Q(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
3733
+ let u = (o.nodes ?? []).map((e) => rn(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, rn(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
3483
3734
  ...c,
3484
3735
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
3485
3736
  linked: p,
@@ -3488,15 +3739,16 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3488
3739
  },
3489
3740
  children: u.length ? u : void 0
3490
3741
  }, e);
3491
- return c.when && c.when !== "always" ? /* @__PURE__ */ d(zt, {
3742
+ return c.when && c.when !== "always" ? /* @__PURE__ */ d(Gt, {
3492
3743
  when: c.when,
3493
3744
  children: m
3494
3745
  }, e) : m;
3495
3746
  }
3496
3747
  //#endregion
3497
3748
  //#region ../ui/src/components/builder/PageRenderer.jsx
3498
- var Zt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3499
- function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
3749
+ var an = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), on = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(V(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
3750
+ .webim-page[data-webim-mode="dark"] { ${Object.entries(V(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
3751
+ function sn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
3500
3752
  let b = o?.js?.trim();
3501
3753
  if (a(() => {
3502
3754
  if (!b) return;
@@ -3510,19 +3762,19 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3510
3762
  minHeight: "100%",
3511
3763
  display: "flex",
3512
3764
  flexDirection: "column"
3513
- }, w = Q("ROOT", e, n), T = s(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = F(e, n), D = P(e, n), O = o?.css?.trim(), k = y(e, n).map((e) => /* @__PURE__ */ d("link", {
3765
+ }, w = rn("ROOT", e, n), T = s(() => ({ render: (t, r) => rn(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = F(e, n), D = P(e, n), O = o?.css?.trim(), k = y(e, n).map((e) => /* @__PURE__ */ d("link", {
3514
3766
  rel: "stylesheet",
3515
3767
  precedence: "default",
3516
3768
  href: _(e)
3517
- }, e));
3518
- if (r !== "auto") return /* @__PURE__ */ d(H.Provider, {
3769
+ }, e)), A = B(t), j = on(A);
3770
+ return r === "auto" ? /* @__PURE__ */ d(H.Provider, {
3519
3771
  value: {
3520
3772
  tenant: c || "",
3521
3773
  apiUrl: l || "/api",
3522
3774
  locale: p || "",
3523
3775
  settings: g ?? null
3524
3776
  },
3525
- children: /* @__PURE__ */ d(Rt, {
3777
+ children: /* @__PURE__ */ d(Wt, {
3526
3778
  initialUser: v,
3527
3779
  children: /* @__PURE__ */ d(U.Provider, {
3528
3780
  value: u ?? null,
@@ -3533,10 +3785,13 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3533
3785
  className: "webim-page",
3534
3786
  style: {
3535
3787
  ...C,
3536
- ...re(t, r),
3788
+ ...ne(t),
3537
3789
  ...i
3538
3790
  },
3539
3791
  children: [
3792
+ /* @__PURE__ */ d("style", { children: `.webim-page { ${an(V(A.light))} }
3793
+ @media (prefers-color-scheme: dark) { .webim-page { ${an(V(A.dark))} } }` }),
3794
+ /* @__PURE__ */ d("style", { children: j }),
3540
3795
  k,
3541
3796
  /* @__PURE__ */ d("style", { children: S }),
3542
3797
  E && /* @__PURE__ */ d("style", { children: E }),
@@ -3548,16 +3803,14 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3548
3803
  })
3549
3804
  })
3550
3805
  })
3551
- });
3552
- let A = B(t);
3553
- return /* @__PURE__ */ d(H.Provider, {
3806
+ }) : /* @__PURE__ */ d(H.Provider, {
3554
3807
  value: {
3555
3808
  tenant: c || "",
3556
3809
  apiUrl: l || "/api",
3557
3810
  locale: p || "",
3558
3811
  settings: g ?? null
3559
3812
  },
3560
- children: /* @__PURE__ */ d(Rt, {
3813
+ children: /* @__PURE__ */ d(Wt, {
3561
3814
  initialUser: v,
3562
3815
  children: /* @__PURE__ */ d(U.Provider, {
3563
3816
  value: u ?? null,
@@ -3568,13 +3821,12 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3568
3821
  className: "webim-page",
3569
3822
  style: {
3570
3823
  ...C,
3571
- ...ne(t),
3824
+ ...re(t, r),
3572
3825
  ...i
3573
3826
  },
3574
3827
  children: [
3575
- /* @__PURE__ */ d("style", { children: `.webim-page { ${Zt(V(A.light))} }
3576
- @media (prefers-color-scheme: dark) { .webim-page { ${Zt(V(A.dark))} } }` }),
3577
3828
  k,
3829
+ /* @__PURE__ */ d("style", { children: j }),
3578
3830
  /* @__PURE__ */ d("style", { children: S }),
3579
3831
  E && /* @__PURE__ */ d("style", { children: E }),
3580
3832
  D && /* @__PURE__ */ d("style", { children: D }),
@@ -3589,8 +3841,8 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3589
3841
  }
3590
3842
  //#endregion
3591
3843
  //#region src/WebimContent.jsx
3592
- function $t({ bundle: e, mode: t = "auto", style: n }) {
3593
- return e?.blocks?.ROOT ? /* @__PURE__ */ d(Qt, {
3844
+ function cn({ bundle: e, mode: t = "auto", style: n }) {
3845
+ return e?.blocks?.ROOT ? /* @__PURE__ */ d(sn, {
3594
3846
  blocks: e.blocks,
3595
3847
  theme: e.theme,
3596
3848
  components: e.components,
@@ -3607,7 +3859,7 @@ function $t({ bundle: e, mode: t = "auto", style: n }) {
3607
3859
  }
3608
3860
  //#endregion
3609
3861
  //#region src/bundle.js
3610
- function en({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3862
+ function ln({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3611
3863
  let a = {
3612
3864
  ...t?.global ?? {},
3613
3865
  ...t?.tenant ?? {}
@@ -3631,18 +3883,18 @@ function en({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3631
3883
  }
3632
3884
  //#endregion
3633
3885
  //#region src/fetchPage.js
3634
- var tn = async (e) => {
3886
+ var un = async (e) => {
3635
3887
  let t = await e.json().catch(() => null);
3636
3888
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
3637
3889
  return t?.payload ?? t;
3638
3890
  };
3639
- async function nn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
3891
+ async function dn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
3640
3892
  if (!e) throw Error("fetchPage: apiUrl is required");
3641
3893
  if (!n) throw Error("fetchPage: slug is required");
3642
3894
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
3643
3895
  ...t ? { "x-tenant": t } : {},
3644
3896
  ...a ? { authorization: `Bearer ${a}` } : {}
3645
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(tn), c(`${l}/settings/public`, { headers: u }).then(tn)]), p = en({
3897
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(un), c(`${l}/settings/public`, { headers: u }).then(un)]), p = ln({
3646
3898
  page: d,
3647
3899
  settings: f,
3648
3900
  tenant: t,
@@ -3650,7 +3902,7 @@ async function nn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
3650
3902
  locale: r
3651
3903
  }), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
3652
3904
  if (m.length) {
3653
- let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(tn).then((e) => {
3905
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(un).then((e) => {
3654
3906
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
3655
3907
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
3656
3908
  }).catch(() => [[t, []]])));
@@ -3664,40 +3916,40 @@ async function nn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
3664
3916
  }
3665
3917
  //#endregion
3666
3918
  //#region src/ssr.jsx
3667
- var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
3919
+ var fn = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
3668
3920
  "&": "&amp;",
3669
3921
  "<": "&lt;",
3670
3922
  ">": "&gt;",
3671
3923
  "\"": "&quot;"
3672
3924
  })[e]);
3673
- function rn(t, { mode: n = "auto", style: r } = {}) {
3674
- return e(/* @__PURE__ */ d($t, {
3925
+ function pn(t, { mode: n = "auto", style: r } = {}) {
3926
+ return e(/* @__PURE__ */ d(cn, {
3675
3927
  bundle: t,
3676
3928
  mode: n,
3677
3929
  style: r
3678
3930
  }));
3679
3931
  }
3680
- function an(e, { mode: t = "auto", lang: n } = {}) {
3932
+ function mn(e, { mode: t = "auto", lang: n } = {}) {
3681
3933
  let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
3682
3934
  "<meta charset=\"utf-8\"/>",
3683
3935
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
3684
- `<title>${$(o)}</title>`,
3685
- r.description && `<meta name="description" content="${$(r.description)}"/>`,
3686
- `<meta property="og:title" content="${$(o)}"/>`,
3687
- r.image && `<meta property="og:image" content="${$(r.image)}"/>`,
3936
+ `<title>${fn(o)}</title>`,
3937
+ r.description && `<meta name="description" content="${fn(r.description)}"/>`,
3938
+ `<meta property="og:title" content="${fn(o)}"/>`,
3939
+ r.image && `<meta property="og:image" content="${fn(r.image)}"/>`,
3688
3940
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
3689
3941
  "<style>html,body{margin:0;height:100%}</style>"
3690
3942
  ].filter(Boolean).join("\n");
3691
3943
  return `<!doctype html>
3692
- <html lang="${$(i)}"${a ? ` dir="${a}"` : ""}>
3944
+ <html lang="${fn(i)}"${a ? ` dir="${a}"` : ""}>
3693
3945
  <head>
3694
3946
  ${c}
3695
3947
  </head>
3696
3948
  <body>
3697
- ${rn(e, { mode: t })}
3949
+ ${pn(e, { mode: t })}
3698
3950
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
3699
3951
  </body>
3700
3952
  </html>`;
3701
3953
  }
3702
3954
  //#endregion
3703
- export { en as assembleBundle, nn as fetchPage, rn as renderBundleHtml, an as renderPageDocument };
3955
+ export { ln as assembleBundle, dn as fetchPage, pn as renderBundleHtml, mn as renderPageDocument };