@ikonai/sdk-react-ui 1.4.0 → 1.5.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.
package/index.js CHANGED
@@ -520,7 +520,7 @@ function Je(e, t) {
520
520
  cursor: t
521
521
  } : n;
522
522
  }
523
- function Ye(e) {
523
+ function H(e) {
524
524
  if (!e) return V;
525
525
  let t = Ke.get(e);
526
526
  if (t) return t;
@@ -534,7 +534,7 @@ function Ye(e) {
534
534
  }
535
535
  return Ke.set(e, n), n;
536
536
  }
537
- function Xe(e) {
537
+ function Ye(e) {
538
538
  let t = e.parentElement;
539
539
  for (; t;) {
540
540
  let e = window.getComputedStyle(t).overflowY;
@@ -543,34 +543,51 @@ function Xe(e) {
543
543
  }
544
544
  return null;
545
545
  }
546
- var Ze = 1.5;
547
- function Qe(e, t) {
546
+ var Xe = 1.5;
547
+ function Ze(e, t, n) {
548
548
  requestAnimationFrame(() => {
549
- let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = e.scrollTop + (r.bottom - n.bottom) + 16, a = Math.abs(i - e.scrollTop) > e.clientHeight * Ze ? "auto" : "smooth";
549
+ let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = e.scrollTop + (i.bottom - r.bottom) + 16, o = Math.abs(a - e.scrollTop), s = n ?? (o > e.clientHeight * Xe ? "auto" : "smooth");
550
550
  "scrollBehavior" in document.documentElement.style ? e.scrollTo({
551
- top: i,
552
- behavior: a
553
- }) : e.scrollTop = i;
551
+ top: a,
552
+ behavior: s
553
+ }) : e.scrollTop = a;
554
554
  });
555
555
  }
556
- var $e = "data-ikon-scroll-indicator", et = .15, H = "data-ikon-at-bottom";
557
- function tt(e) {
558
- return Math.max(e.clientHeight * et, 20);
556
+ var Qe = 3e3;
557
+ function $e(e, t) {
558
+ if (typeof ResizeObserver > "u") return () => void 0;
559
+ let n = !1, r = () => {
560
+ n = !0;
561
+ }, i = { passive: !0 };
562
+ e.addEventListener("wheel", r, i), e.addEventListener("touchmove", r, i), e.addEventListener("keydown", r, i);
563
+ let a = e.scrollHeight, o = new ResizeObserver(() => {
564
+ let r = e.scrollHeight > a;
565
+ a = e.scrollHeight, !(!r || n || !rt(e)) && Ze(e, t, "auto");
566
+ });
567
+ for (let t of Array.from(e.children)) o.observe(t);
568
+ let s = setTimeout(r, Qe);
569
+ return () => {
570
+ clearTimeout(s), o.disconnect(), e.removeEventListener("wheel", r), e.removeEventListener("touchmove", r), e.removeEventListener("keydown", r);
571
+ };
559
572
  }
573
+ var U = "data-ikon-scroll-indicator", et = .15, tt = "data-ikon-at-bottom";
560
574
  function nt(e) {
561
- return e.getAttribute(H) !== "false";
575
+ return Math.max(e.clientHeight * et, 20);
562
576
  }
563
577
  function rt(e) {
564
- e.getAttribute(H) === null && (e.setAttribute(H, "true"), e.addEventListener("scroll", () => {
565
- let { scrollTop: t, scrollHeight: n, clientHeight: r } = e, i = n - t - r <= tt(e);
566
- e.setAttribute(H, i ? "true" : "false");
567
- }, { passive: !0 }));
578
+ return e.getAttribute(tt) !== "false";
568
579
  }
569
580
  function it(e) {
570
- let t = e.parentElement ?? e, n = t.querySelector(`[${$e}]`);
581
+ e.getAttribute(tt) === null && (e.setAttribute(tt, "true"), e.addEventListener("scroll", () => {
582
+ let { scrollTop: t, scrollHeight: n, clientHeight: r } = e, i = n - t - r <= nt(e);
583
+ e.setAttribute(tt, i ? "true" : "false");
584
+ }, { passive: !0 }));
585
+ }
586
+ function at(e) {
587
+ let t = e.parentElement ?? e, n = t.querySelector(`[${U}]`);
571
588
  if (n) return n;
572
589
  let r = document.createElement("button");
573
- return r.setAttribute($e, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
590
+ return r.setAttribute(U, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
574
591
  position: "absolute",
575
592
  bottom: "12px",
576
593
  left: "50%",
@@ -598,36 +615,36 @@ function it(e) {
598
615
  r.style.opacity = "0.9";
599
616
  }), t.appendChild(r), r;
600
617
  }
601
- function at(e, t) {
602
- let n = it(e);
618
+ function ot(e, t) {
619
+ let n = at(e);
603
620
  n.style.display = "flex";
604
621
  let r = () => {
605
- Qe(e, t), n.style.display = "none";
622
+ Ze(e, t), n.style.display = "none";
606
623
  }, i = () => {
607
624
  let { scrollTop: t, scrollHeight: r, clientHeight: i } = e;
608
- r - t - i <= tt(e) && (n.style.display = "none");
625
+ r - t - i <= nt(e) && (n.style.display = "none");
609
626
  };
610
627
  return n.addEventListener("click", r), e.addEventListener("scroll", i, { passive: !0 }), () => {
611
628
  n.removeEventListener("click", r), e.removeEventListener("scroll", i);
612
629
  };
613
630
  }
614
- function ot() {
631
+ function st() {
615
632
  let e = D(function({ nodeId: e, context: t }) {
616
633
  let n = L(t.store, e), r = j(null), i = B(n?.props?.targetViewId), a = n?.props?.focusOnly, o = typeof a == "boolean" ? a : void 0, s = B(n?.props?.priority), c = B(n?.props?.key), l = n?.props?.preciseGeneratedAt;
617
634
  return k(() => {
618
635
  if (typeof document > "u") return;
619
636
  let e = r.current;
620
637
  if (!e || i && e.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i) return;
621
- let t;
638
+ let t, n;
622
639
  if (o !== !0) {
623
- let n = Xe(e);
624
- if (n) if (rt(n), s === "Polite" && !nt(n)) t = at(n, e);
640
+ let r = Ye(e);
641
+ if (r) if (it(r), s === "Polite" && !rt(r)) t = ot(r, e);
625
642
  else {
626
- let t = (n.parentElement ?? n).querySelector(`[${$e}]`);
627
- t && (t.style.display = "none"), Qe(n, e);
643
+ let t = (r.parentElement ?? r).querySelector(`[${U}]`);
644
+ t && (t.style.display = "none"), Ze(r, e), n = $e(r, e);
628
645
  }
629
646
  else typeof e.scrollIntoView == "function" && requestAnimationFrame(() => {
630
- let t = e.getBoundingClientRect().top, n = typeof window < "u" ? window.innerHeight : 0, r = Math.abs(t) > n * Ze ? "auto" : "smooth";
647
+ let t = e.getBoundingClientRect().top, n = typeof window < "u" ? window.innerHeight : 0, r = Math.abs(t) > n * Xe ? "auto" : "smooth";
631
648
  try {
632
649
  e.scrollIntoView({
633
650
  behavior: r,
@@ -639,13 +656,15 @@ function ot() {
639
656
  }
640
657
  });
641
658
  }
642
- let n = document.activeElement;
643
- if (!(n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n?.getAttribute("contenteditable") === "true") && typeof e.focus == "function") try {
659
+ let a = document.activeElement;
660
+ if (!(a instanceof HTMLInputElement || a instanceof HTMLTextAreaElement || a?.getAttribute("contenteditable") === "true") && typeof e.focus == "function") try {
644
661
  e.focus({ preventScroll: !0 });
645
662
  } catch {
646
663
  e.focus();
647
664
  }
648
- return t;
665
+ return () => {
666
+ t?.(), n?.();
667
+ };
649
668
  }, [
650
669
  o,
651
670
  s,
@@ -670,13 +689,13 @@ function ot() {
670
689
  if (t === "std.focus-hint") return e;
671
690
  };
672
691
  }
673
- function st() {
692
+ function ct() {
674
693
  let e = D(function({ nodeId: e, context: t, className: n }) {
675
694
  let r = L(t.store, e), i = We(r?.props?.onInvokeId), a = O(() => {
676
695
  i && t.dispatchAction(i);
677
696
  }, [i, t]);
678
697
  if (!r) return null;
679
- let o = Ye(r.props);
698
+ let o = H(r.props);
680
699
  delete o.onInvokeId;
681
700
  let s = Ge(B(r.props?.className), n), c = r.children?.length ? t.renderChildren(r.children) : void 0;
682
701
  return /* @__PURE__ */ F("div", {
@@ -698,11 +717,11 @@ function st() {
698
717
  if (t === "std.div") return e;
699
718
  };
700
719
  }
701
- function ct() {
720
+ function lt() {
702
721
  let e = D(function({ nodeId: e, context: t, className: n }) {
703
722
  let r = L(t.store, e);
704
723
  if (!r) return null;
705
- let i = Ye(r.props), a = Ge("relative", B(r.props?.className), n), o = r.children?.length ? t.renderChildren(r.children) : void 0;
724
+ let i = H(r.props), a = Ge("relative", B(r.props?.className), n), o = r.children?.length ? t.renderChildren(r.children) : void 0;
706
725
  return /* @__PURE__ */ F("div", {
707
726
  ...i,
708
727
  "data-ikon-node-id": r.id,
@@ -715,11 +734,11 @@ function ct() {
715
734
  if (t === "std.stack") return e;
716
735
  };
717
736
  }
718
- function lt() {
737
+ function ut() {
719
738
  let e = D(function({ nodeId: e, context: t, className: n }) {
720
739
  let r = L(t.store, e);
721
740
  if (!r) return null;
722
- let i = Ye(r.props), a = Ge("absolute", B(r.props?.className), n), o = r.children?.length ? t.renderChildren(r.children) : void 0;
741
+ let i = H(r.props), a = Ge("absolute", B(r.props?.className), n), o = r.children?.length ? t.renderChildren(r.children) : void 0;
723
742
  return /* @__PURE__ */ F("div", {
724
743
  ...i,
725
744
  "data-ikon-node-id": r.id,
@@ -732,23 +751,23 @@ function lt() {
732
751
  if (t === "std.layer") return e;
733
752
  };
734
753
  }
735
- function ut() {
754
+ function dt() {
736
755
  return [
737
- st(),
738
756
  ct(),
739
757
  lt(),
740
- ot()
758
+ ut(),
759
+ st()
741
760
  ];
742
761
  }
743
762
  //#endregion
744
763
  //#region src/base/base-module.ts
745
- var dt = "base", ft = async () => ut();
746
- function pt(e) {
747
- e.registerModule(dt, ft);
764
+ var ft = "base", pt = async () => dt();
765
+ function mt(e) {
766
+ e.registerModule(ft, pt);
748
767
  }
749
768
  //#endregion
750
769
  //#region src/media/audio-player.tsx
751
- function mt(e) {
770
+ function ht(e) {
752
771
  if (typeof e == "string") {
753
772
  let t = e.trim();
754
773
  return t.length > 0 ? t : void 0;
@@ -758,17 +777,17 @@ function mt(e) {
758
777
  return t.length > 0 ? t.join(" ") : void 0;
759
778
  }
760
779
  }
761
- function ht(...e) {
780
+ function gt(...e) {
762
781
  let t = [];
763
782
  for (let n of e) n && n.trim() && t.push(n.trim());
764
783
  return t.length > 0 ? t.join(" ") : void 0;
765
784
  }
766
- function gt(e) {
785
+ function _t(e) {
767
786
  if (typeof e != "string") return;
768
787
  let t = e.trim();
769
788
  return t.length > 0 ? t : void 0;
770
789
  }
771
- function _t(e) {
790
+ function vt(e) {
772
791
  if (typeof e == "boolean") return e;
773
792
  if (typeof e == "string") {
774
793
  let t = e.trim().toLowerCase();
@@ -776,13 +795,13 @@ function _t(e) {
776
795
  if (t === "false") return !1;
777
796
  }
778
797
  }
779
- function vt() {
798
+ function yt() {
780
799
  let e = D(function({ nodeId: e, context: t, className: n }) {
781
- let r = L(t.store, e), i = j(null), a = r ? _t(r.props?.autoplay) : void 0, o = r ? gt(r.props?.src) : void 0;
800
+ let r = L(t.store, e), i = j(null), a = r ? vt(r.props?.autoplay) : void 0, o = r ? _t(r.props?.src) : void 0;
782
801
  if (k(() => {
783
802
  a && i.current && i.current.play().catch(() => {});
784
803
  }, [a, o]), !r) return null;
785
- let s = ht(mt(r.props?.className), n), c = gt(r.props?.preload), l = _t(r.props?.controls), u = _t(r.props?.loop), d = _t(r.props?.muted);
804
+ let s = gt(ht(r.props?.className), n), c = _t(r.props?.preload), l = vt(r.props?.controls), u = vt(r.props?.loop), d = vt(r.props?.muted);
786
805
  return /* @__PURE__ */ F("audio", {
787
806
  ref: i,
788
807
  src: o,
@@ -801,8 +820,69 @@ function vt() {
801
820
  };
802
821
  }
803
822
  //#endregion
823
+ //#region src/media/video-stream-view.tsx
824
+ var bt = b("IkonVideoStreamView"), xt = D(function({ client: e, streamId: t, className: n, style: r, width: i, height: a, attributes: o, getPlayback: s }) {
825
+ let c = j(null), l = j(null), [, u] = M(0);
826
+ k(() => {
827
+ if (e?.isWebRtcEnabled) return e.addWebRtcTrackMapListener((e) => {
828
+ e.kind === "video" && u((e) => e + 1);
829
+ });
830
+ }, [e]);
831
+ let d = e?.isWebRtcEnabled && t ? e.getWebRtcVideoStreamByStreamId(t) : null;
832
+ k(() => {
833
+ let n = c.current;
834
+ if (!n || !t || d) return;
835
+ let r = !1, i, a = 0, o = () => s ? s() : e?.media?.video, l = () => {
836
+ if (r) return;
837
+ let e = o();
838
+ if (!e) {
839
+ if (a++ >= 50) {
840
+ bt.warn(`Gave up attaching the canvas for stream ${t}: video playback never became available`);
841
+ return;
842
+ }
843
+ i = setTimeout(l, 100);
844
+ return;
845
+ }
846
+ e.attachCanvas(t, n).catch((e) => {
847
+ bt.error(`Failed to attach the canvas for stream ${t}, it will stay blank: ${String(e)}`);
848
+ });
849
+ };
850
+ return l(), () => {
851
+ r = !0, i !== void 0 && clearTimeout(i), o()?.detachCanvas(t);
852
+ };
853
+ }, [
854
+ e,
855
+ t,
856
+ d,
857
+ s
858
+ ]), k(() => {
859
+ let e = l.current;
860
+ if (!(!e || !d)) return e.srcObject = d, () => {
861
+ e.srcObject = null;
862
+ };
863
+ }, [d]);
864
+ let f = {
865
+ ...o,
866
+ ...t ? { "data-ikon-video-stream-id": t } : {},
867
+ className: n,
868
+ style: r,
869
+ ...i ? { width: i } : {},
870
+ ...a ? { height: a } : {}
871
+ };
872
+ return d ? /* @__PURE__ */ F("video", {
873
+ ref: l,
874
+ autoPlay: !0,
875
+ playsInline: !0,
876
+ muted: !0,
877
+ ...f
878
+ }, t) : /* @__PURE__ */ F("canvas", {
879
+ ref: c,
880
+ ...f
881
+ }, t);
882
+ });
883
+ //#endregion
804
884
  //#region src/media/video-canvas.tsx
805
- function yt(e) {
885
+ function St(e) {
806
886
  if (typeof e == "string") {
807
887
  let t = e.trim();
808
888
  return t.length > 0 ? t : void 0;
@@ -812,87 +892,39 @@ function yt(e) {
812
892
  return t.length > 0 ? t.join(" ") : void 0;
813
893
  }
814
894
  }
815
- function bt(...e) {
895
+ function Ct(...e) {
816
896
  let t = [];
817
897
  for (let n of e) n && n.trim() && t.push(n.trim());
818
898
  return t.length > 0 ? t.join(" ") : void 0;
819
899
  }
820
- function xt(e) {
900
+ function wt(e) {
821
901
  if (typeof e == "number" && Number.isFinite(e)) return Math.floor(e);
822
902
  if (typeof e == "string" && e.trim().length > 0) {
823
903
  let t = Number(e);
824
904
  if (Number.isFinite(t)) return Math.floor(t);
825
905
  }
826
906
  }
827
- function St(e) {
907
+ function Tt(e) {
828
908
  if (typeof e != "string") return;
829
909
  let t = e.trim();
830
910
  return t.length > 0 ? t : void 0;
831
911
  }
832
- var Ct = b("IkonVideoCanvas"), wt = 100, Tt = 50, Et = "std.video-canvas", Dt = "std.video-url-player";
912
+ var Et = "std.video-canvas", Dt = "std.video-url-player";
833
913
  function Ot() {
834
914
  let e = D(function({ nodeId: e, context: t, className: n }) {
835
- let r = L(t.store, e), i = j(null), a = j(null), o = t.client, s = r ? St(r.props?.streamId) : void 0, c = r ? xt(r.props?.width) : void 0, l = r ? xt(r.props?.height) : void 0, u = r ? bt(yt(r.props?.className), n) : n, [, d] = M(0);
836
- k(() => {
837
- if (!o?.isWebRtcEnabled) return;
838
- let e = o.onWebRtcTrackMapChanged;
839
- return o.onWebRtcTrackMapChanged = (t) => {
840
- e?.(t), t.kind === "video" && d((e) => e + 1);
841
- }, () => {
842
- o.onWebRtcTrackMapChanged = e;
843
- };
844
- }, [o]);
845
- let f = o?.isWebRtcEnabled && s ? o.getWebRtcVideoStreamByStreamId(s) : null;
846
- return k(() => {
847
- let e = i.current;
848
- if (!e || !s || f) return;
849
- let n = !1, r, a = 0, o = () => {
850
- if (n) return;
851
- let i = t.video ?? t.client?.media?.video;
852
- if (!i) {
853
- if (a++ >= Tt) {
854
- Ct.warn(`Gave up attaching the canvas for stream ${s}: video playback never became available`);
855
- return;
856
- }
857
- r = setTimeout(o, wt);
858
- return;
859
- }
860
- i.attachCanvas(s, e).catch((e) => {
861
- Ct.error(`Failed to attach the canvas for stream ${s}, it will stay blank: ${String(e)}`);
862
- });
863
- };
864
- return o(), () => {
865
- n = !0, r !== void 0 && clearTimeout(r), (t.video ?? t.client?.media?.video)?.detachCanvas(s);
866
- };
867
- }, [
868
- t,
869
- s,
870
- f
871
- ]), k(() => {
872
- let e = a.current;
873
- if (!(!e || !f)) return e.srcObject = f, () => {
874
- e.srcObject = null;
875
- };
876
- }, [f]), r ? f ? /* @__PURE__ */ F("video", {
877
- ref: a,
878
- autoPlay: !0,
879
- playsInline: !0,
880
- muted: !0,
881
- "data-ikon-node-id": r.id,
882
- "data-ikon-source": r.sourceMarker,
883
- "data-ikon-video-stream-id": s,
884
- className: u,
885
- ...c ? { width: c } : {},
886
- ...l ? { height: l } : {}
887
- }, s) : /* @__PURE__ */ F("canvas", {
888
- ref: i,
889
- "data-ikon-node-id": r.id,
890
- "data-ikon-source": r.sourceMarker,
891
- "data-ikon-video-stream-id": s,
892
- className: u,
893
- ...c ? { width: c } : {},
894
- ...l ? { height: l } : {}
895
- }, s) : null;
915
+ let r = L(t.store, e), i = r ? Tt(r.props?.streamId) : void 0, a = r ? wt(r.props?.width) : void 0, o = r ? wt(r.props?.height) : void 0, s = r ? Ct(St(r.props?.className), n) : n, c = O(() => t.video ?? t.client?.media?.video, [t]);
916
+ return r ? /* @__PURE__ */ F(xt, {
917
+ client: t.client,
918
+ streamId: i,
919
+ className: s,
920
+ width: a,
921
+ height: o,
922
+ getPlayback: c,
923
+ attributes: {
924
+ "data-ikon-node-id": r.id,
925
+ ...r.sourceMarker ? { "data-ikon-source": r.sourceMarker } : {}
926
+ }
927
+ }) : null;
896
928
  });
897
929
  return ({ type: t }) => {
898
930
  if (t === "std.video-canvas") return e;
@@ -902,7 +934,7 @@ function kt() {
902
934
  return [
903
935
  Ot(),
904
936
  jt(),
905
- vt()
937
+ yt()
906
938
  ];
907
939
  }
908
940
  function At(e) {
@@ -915,11 +947,11 @@ function At(e) {
915
947
  }
916
948
  function jt() {
917
949
  let e = D(function({ nodeId: e, context: t, className: n }) {
918
- let r = L(t.store, e), i = j(null), a = r ? At(r.props?.autoplay) : void 0, o = r ? St(r.props?.src) : void 0;
950
+ let r = L(t.store, e), i = j(null), a = r ? At(r.props?.autoplay) : void 0, o = r ? Tt(r.props?.src) : void 0;
919
951
  if (k(() => {
920
952
  a && i.current && i.current.play().catch(() => {});
921
953
  }, [a, o]), !r) return null;
922
- let s = bt(yt(r.props?.className), n), c = St(r.props?.poster), l = At(r.props?.controls), u = At(r.props?.loop), d = At(r.props?.muted), f = At(r.props?.playsInline), p = xt(r.props?.width), m = xt(r.props?.height), h = r.children?.length ? t.renderChildren(r.children) : void 0;
954
+ let s = Ct(St(r.props?.className), n), c = Tt(r.props?.poster), l = At(r.props?.controls), u = At(r.props?.loop), d = At(r.props?.muted), f = At(r.props?.playsInline), p = wt(r.props?.width), m = wt(r.props?.height), h = r.children?.length ? t.renderChildren(r.children) : void 0;
923
955
  return /* @__PURE__ */ F("video", {
924
956
  ref: i,
925
957
  src: o,
@@ -1436,7 +1468,7 @@ var $t = b("UIRegistry"), en = class {
1436
1468
  };
1437
1469
  function tn() {
1438
1470
  let e = new en();
1439
- return pt(e), Pt(e), Qt(e), e.loadRegisteredModules(), e;
1471
+ return mt(e), Pt(e), Qt(e), e.loadRegisteredModules(), e;
1440
1472
  }
1441
1473
  function nn(e) {
1442
1474
  return Array.isArray(e) ? e : [e];
@@ -1632,7 +1664,7 @@ var sn = b("MotionController"), cn = {
1632
1664
  1.55
1633
1665
  ]
1634
1666
  };
1635
- function U(e) {
1667
+ function W(e) {
1636
1668
  return e <= 0 ? 0 : e >= 1 ? 1 : e;
1637
1669
  }
1638
1670
  function ln(e) {
@@ -1681,30 +1713,30 @@ function dn(e, t, n, r) {
1681
1713
  }
1682
1714
  function fn(e) {
1683
1715
  let t = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(e);
1684
- if (!t) return (e) => U(e);
1716
+ if (!t) return (e) => W(e);
1685
1717
  let n = Math.max(1, parseInt(t[1], 10)), r = (t[2] ?? "end").toLowerCase();
1686
- return r === "start" || r === "jump-start" ? (e) => U(Math.ceil(e * n) / n) : r === "none" || r === "jump-none" ? (e) => U(Math.round(e * n) / n) : r === "both" || r === "jump-both" ? (e) => U((Math.floor(e * n) + .5) / n) : (e) => U(Math.floor(e * n) / n);
1718
+ return r === "start" || r === "jump-start" ? (e) => W(Math.ceil(e * n) / n) : r === "none" || r === "jump-none" ? (e) => W(Math.round(e * n) / n) : r === "both" || r === "jump-both" ? (e) => W((Math.floor(e * n) + .5) / n) : (e) => W(Math.floor(e * n) / n);
1687
1719
  }
1688
1720
  function pn(e) {
1689
- if (!e) return (e) => U(e);
1721
+ if (!e) return (e) => W(e);
1690
1722
  let t = e.trim().toLowerCase();
1691
- if (!t || t === "linear") return (e) => U(e);
1723
+ if (!t || t === "linear") return (e) => W(e);
1692
1724
  if (cn[t]) {
1693
1725
  let [e, n, r, i] = cn[t], a = dn(e, n, r, i);
1694
- return (e) => U(a(U(e)));
1726
+ return (e) => W(a(W(e)));
1695
1727
  }
1696
1728
  if (t.startsWith("cubic-bezier(") && t.endsWith(")")) {
1697
1729
  let e = t.slice(13, -1).split(",").map((e) => Number.parseFloat(e.trim()));
1698
1730
  if (e.length === 4 && e.every((e) => Number.isFinite(e))) {
1699
1731
  let [t, n, r, i] = e, a = dn(t, n, r, i);
1700
- return (e) => U(a(U(e)));
1732
+ return (e) => W(a(W(e)));
1701
1733
  }
1702
1734
  }
1703
1735
  if (t.startsWith("steps(") && t.endsWith(")")) {
1704
1736
  let e = fn(t);
1705
- return (t) => e(U(t));
1737
+ return (t) => e(W(t));
1706
1738
  }
1707
- return (e) => U(e);
1739
+ return (e) => W(e);
1708
1740
  }
1709
1741
  function mn(e) {
1710
1742
  if (!e) return;
@@ -1866,7 +1898,7 @@ var hn = new class {
1866
1898
  case "freeze-start": return e < 0 ? 0 : e;
1867
1899
  case "freeze-end": return e > 1 ? 1 : e;
1868
1900
  case "unclamped": return e;
1869
- default: return U(e);
1901
+ default: return W(e);
1870
1902
  }
1871
1903
  }
1872
1904
  applyMap(e, t) {
@@ -2005,17 +2037,82 @@ function vn(e) {
2005
2037
  }, [e]), t;
2006
2038
  }
2007
2039
  //#endregion
2040
+ //#region src/media/use-sibling-client.ts
2041
+ function yn(e, t, n) {
2042
+ let [r, i] = M(null), [a, o] = M(null), s = j(n);
2043
+ s.current = n;
2044
+ let c = t ? JSON.stringify(Object.entries(t).sort(([e], [t]) => e < t ? -1 : +(e > t))) : null;
2045
+ return k(() => {
2046
+ if (!e || c === null) return;
2047
+ let t = Object.fromEntries(JSON.parse(c)), n = new u(e.deriveConfig(t, s.current)), r = !1;
2048
+ return o(null), n.connect().then(() => {
2049
+ r || i(n);
2050
+ }).catch((e) => {
2051
+ r || o(e instanceof Error ? e : Error(String(e)));
2052
+ }), () => {
2053
+ r = !0, i(null), n.disconnect();
2054
+ };
2055
+ }, [e, c]), {
2056
+ client: r,
2057
+ error: a
2058
+ };
2059
+ }
2060
+ //#endregion
2061
+ //#region src/media/use-media-capture.ts
2062
+ var bn = b("IkonMediaCaptureHooks");
2063
+ function xn(e, t, n, r) {
2064
+ let [i, a] = M(null), o = j(r);
2065
+ return o.current = r, k(() => {
2066
+ if (!e || !t) return;
2067
+ let r = !1, i = null;
2068
+ return a(null), (async () => {
2069
+ let t = await e.ensureMediaCapture();
2070
+ if (!r) {
2071
+ if (!t) {
2072
+ a(/* @__PURE__ */ Error(`Media capture is not available in this environment (${n})`));
2073
+ return;
2074
+ }
2075
+ try {
2076
+ i = await o.current(t);
2077
+ } catch (e) {
2078
+ r || (bn.error(`${n} capture start failed: ${String(e)}`), a(e instanceof Error ? e : Error(String(e))));
2079
+ return;
2080
+ }
2081
+ r && i.stop();
2082
+ }
2083
+ })(), () => {
2084
+ r = !0, i?.stop();
2085
+ };
2086
+ }, [
2087
+ e,
2088
+ t,
2089
+ n
2090
+ ]), { error: i };
2091
+ }
2092
+ function Sn(e, t, n) {
2093
+ let r = j(n);
2094
+ return r.current = n, xn(e, t, "microphone", O((e) => e.audio.startMic(r.current ?? {}), []));
2095
+ }
2096
+ function Cn(e, t, n) {
2097
+ let r = j(n);
2098
+ return r.current = n, xn(e, t, "camera", O((e) => e.video.startCamera(r.current), []));
2099
+ }
2100
+ function wn(e, t, n) {
2101
+ let r = j(n);
2102
+ return r.current = n, xn(e, t, "screen", O((e) => e.video.startScreen(r.current), []));
2103
+ }
2104
+ //#endregion
2008
2105
  //#region src/shared/render-motion-letters.tsx
2009
- var W = {
2106
+ var G = {
2010
2107
  None: 0,
2011
2108
  Letter: 1,
2012
2109
  Word: 2,
2013
2110
  Line: 4,
2014
2111
  Paragraph: 8,
2015
2112
  Emoji: 16
2016
- }, yn = [
2113
+ }, Tn = [
2017
2114
  {
2018
- flag: W.Letter,
2115
+ flag: G.Letter,
2019
2116
  hints: [
2020
2117
  "[data-motion-letter]",
2021
2118
  "[data-letter]",
@@ -2024,7 +2121,7 @@ var W = {
2024
2121
  ]
2025
2122
  },
2026
2123
  {
2027
- flag: W.Word,
2124
+ flag: G.Word,
2028
2125
  hints: [
2029
2126
  "[data-motion-word]",
2030
2127
  "[data-word]",
@@ -2033,7 +2130,7 @@ var W = {
2033
2130
  ]
2034
2131
  },
2035
2132
  {
2036
- flag: W.Line,
2133
+ flag: G.Line,
2037
2134
  hints: [
2038
2135
  "[data-motion-line]",
2039
2136
  "[data-line]",
@@ -2042,7 +2139,7 @@ var W = {
2042
2139
  ]
2043
2140
  },
2044
2141
  {
2045
- flag: W.Paragraph,
2142
+ flag: G.Paragraph,
2046
2143
  hints: [
2047
2144
  "[data-motion-paragraph]",
2048
2145
  "[data-paragraph]",
@@ -2053,7 +2150,7 @@ var W = {
2053
2150
  ]
2054
2151
  },
2055
2152
  {
2056
- flag: W.Emoji,
2153
+ flag: G.Emoji,
2057
2154
  hints: [
2058
2155
  ":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
2059
2156
  "[data-motion-emoji]",
@@ -2062,16 +2159,16 @@ var W = {
2062
2159
  "[data-emoji]"
2063
2160
  ]
2064
2161
  }
2065
- ], bn = W.Letter | W.Word | W.Line | W.Paragraph | W.Emoji, xn = W.Letter | W.Word | W.Line | W.Paragraph, Sn = /* @__PURE__ */ new Map(), Cn = 16384;
2066
- function wn(e, t) {
2067
- if (!e || e.length > Cn) return e;
2068
- let n = Qn(t), r = G(n, W.Emoji), i = n & xn;
2069
- if (i === W.None && !r) return e;
2162
+ ], En = G.Letter | G.Word | G.Line | G.Paragraph | G.Emoji, Dn = G.Letter | G.Word | G.Line | G.Paragraph, On = /* @__PURE__ */ new Map(), kn = 16384;
2163
+ function An(e, t) {
2164
+ if (!e || e.length > kn) return e;
2165
+ let n = ir(t), r = K(n, G.Emoji), i = n & Dn;
2166
+ if (i === G.None && !r) return e;
2070
2167
  let a = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
2071
- if (i === W.None) return Xn(a);
2072
- let o = qn(a);
2073
- if (o.length === 0) return r ? Xn(a) : e;
2074
- let s = Jn(o), c = {
2168
+ if (i === G.None) return nr(a);
2169
+ let o = $n(a);
2170
+ if (o.length === 0) return r ? nr(a) : e;
2171
+ let s = er(o), c = {
2075
2172
  letter: 0,
2076
2173
  word: 0,
2077
2174
  line: 0,
@@ -2080,58 +2177,58 @@ function wn(e, t) {
2080
2177
  emoji: 0
2081
2178
  }, l = [];
2082
2179
  for (let e of s) {
2083
- let t = Tn(e, n, c);
2180
+ let t = jn(e, n, c);
2084
2181
  l.push(...t);
2085
2182
  }
2086
2183
  return l;
2087
2184
  }
2088
- function Tn(e, t, n) {
2185
+ function jn(e, t, n) {
2089
2186
  let r = [];
2090
2187
  for (let i of e) {
2091
- let e = En(i, t, n);
2188
+ let e = Mn(i, t, n);
2092
2189
  r.push(...e);
2093
2190
  }
2094
- if (G(t, W.Paragraph)) {
2191
+ if (K(t, G.Paragraph)) {
2095
2192
  let e = n.paragraph++;
2096
2193
  return [/* @__PURE__ */ F("span", {
2097
2194
  "data-motion-paragraph": !0,
2098
- style: Yn(e),
2195
+ style: tr(e),
2099
2196
  children: r
2100
2197
  }, `motion-paragraph-${e}`)];
2101
2198
  }
2102
2199
  return r;
2103
2200
  }
2104
- function En(e, t, n) {
2105
- let r = Dn(e.text, t, n), i = [];
2106
- if (G(t, W.Line)) {
2201
+ function Mn(e, t, n) {
2202
+ let r = Nn(e.text, t, n), i = [];
2203
+ if (K(t, G.Line)) {
2107
2204
  let e = n.line++;
2108
2205
  i.push(/* @__PURE__ */ F("span", {
2109
2206
  "data-motion-line": !0,
2110
- style: Yn(e),
2207
+ style: tr(e),
2111
2208
  children: r
2112
2209
  }, `motion-line-${e}`));
2113
2210
  } else i.push(...r);
2114
2211
  for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */ F("br", {}, `motion-break-${n.br++}`));
2115
2212
  return i;
2116
2213
  }
2117
- function Dn(e, t, n) {
2214
+ function Nn(e, t, n) {
2118
2215
  if (!e) return [];
2119
- let r = G(t, W.Word), i = [], a = /(\s+)/g, o = 0, s;
2216
+ let r = K(t, G.Word), i = [], a = /(\s+)/g, o = 0, s;
2120
2217
  for (; (s = a.exec(e)) !== null;) {
2121
2218
  if (s.index > o) {
2122
2219
  let a = e.slice(o, s.index);
2123
- i.push(On(a, n, t, r));
2220
+ i.push(Pn(a, n, t, r));
2124
2221
  }
2125
2222
  i.push(s[0]), o = s.index + s[0].length;
2126
2223
  }
2127
2224
  if (o < e.length) {
2128
2225
  let a = e.slice(o);
2129
- i.push(On(a, n, t, r));
2226
+ i.push(Pn(a, n, t, r));
2130
2227
  }
2131
2228
  return i;
2132
2229
  }
2133
- function On(e, t, n, r) {
2134
- let i = t.word++, a = An(e, n, t), o = `motion-word-${i}`, s = kn(i, r);
2230
+ function Pn(e, t, n, r) {
2231
+ let i = t.word++, a = In(e, n, t), o = `motion-word-${i}`, s = Fn(i, r);
2135
2232
  return r ? /* @__PURE__ */ F("span", {
2136
2233
  "data-motion-word": !0,
2137
2234
  style: s,
@@ -2141,25 +2238,25 @@ function On(e, t, n, r) {
2141
2238
  children: a
2142
2239
  }, o);
2143
2240
  }
2144
- function kn(e, t) {
2241
+ function Fn(e, t) {
2145
2242
  return t ? {
2146
- ...Yn(e),
2243
+ ...tr(e),
2147
2244
  whiteSpace: "nowrap"
2148
2245
  } : { whiteSpace: "nowrap" };
2149
2246
  }
2150
- function An(e, t, n) {
2247
+ function In(e, t, n) {
2151
2248
  if (!e) return [];
2152
- let r = G(t, W.Letter), i = G(t, W.Emoji);
2249
+ let r = K(t, G.Letter), i = K(t, G.Emoji);
2153
2250
  if (!r) {
2154
2251
  if (!i) return [e];
2155
- let t = jn(e);
2252
+ let t = Ln(e);
2156
2253
  if (t.length === 0) return [e];
2157
- let { nodes: r } = Zn(t, n);
2254
+ let { nodes: r } = rr(t, n);
2158
2255
  return r;
2159
2256
  }
2160
- let a = [], o = jn(e);
2257
+ let a = [], o = Ln(e);
2161
2258
  for (let e of o) {
2162
- let t = n.letter++, r = `motion-letter-${t}`, o = Yn(t);
2259
+ let t = n.letter++, r = `motion-letter-${t}`, o = tr(t);
2163
2260
  if (e === "\n") {
2164
2261
  a.push(/* @__PURE__ */ F("span", {
2165
2262
  "data-motion-letter": !0,
@@ -2168,7 +2265,7 @@ function An(e, t, n) {
2168
2265
  }, r));
2169
2266
  continue;
2170
2267
  }
2171
- let s = i && Wn(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
2268
+ let s = i && Xn(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
2172
2269
  a.push(/* @__PURE__ */ F("span", {
2173
2270
  "data-motion-letter": !0,
2174
2271
  style: o,
@@ -2178,46 +2275,46 @@ function An(e, t, n) {
2178
2275
  }
2179
2276
  return a;
2180
2277
  }
2181
- function jn(e) {
2278
+ function Ln(e) {
2182
2279
  if (!e) return [];
2183
- let t = Nn();
2184
- return t ? Array.from(t.segment(e), (e) => e.segment) : Pn(e);
2280
+ let t = zn();
2281
+ return t ? Array.from(t.segment(e), (e) => e.segment) : Bn(e);
2185
2282
  }
2186
- var Mn;
2187
- function Nn() {
2188
- return Mn === void 0 && (Mn = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null), Mn;
2283
+ var Rn;
2284
+ function zn() {
2285
+ return Rn === void 0 && (Rn = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null), Rn;
2189
2286
  }
2190
- function Pn(e) {
2287
+ function Bn(e) {
2191
2288
  let t = [], n = Array.from(e), r = "";
2192
2289
  for (let e = 0; e < n.length; e++) {
2193
2290
  let i = n[e], a = n[e + 1];
2194
- r += i, !(a && Fn(i, a)) && (t.push(r), r = "");
2291
+ r += i, !(a && Vn(i, a)) && (t.push(r), r = "");
2195
2292
  }
2196
2293
  return r && t.push(r), t;
2197
2294
  }
2198
- function Fn(e, t) {
2199
- return t ? !!(In(e) || In(t) || Vn(t) || Ln(t) || Rn(t) || zn(e) && zn(t)) : !1;
2295
+ function Vn(e, t) {
2296
+ return t ? !!(Hn(e) || Hn(t) || qn(t) || Un(t) || Wn(t) || Gn(e) && Gn(t)) : !1;
2200
2297
  }
2201
- function In(e) {
2298
+ function Hn(e) {
2202
2299
  return e.codePointAt(0) === 8205;
2203
2300
  }
2204
- function Ln(e) {
2301
+ function Un(e) {
2205
2302
  let t = e.codePointAt(0);
2206
2303
  return t === void 0 ? !1 : t >= 65024 && t <= 65039 || t >= 917760 && t <= 917999;
2207
2304
  }
2208
- function Rn(e) {
2305
+ function Wn(e) {
2209
2306
  let t = e.codePointAt(0);
2210
2307
  return t !== void 0 && t >= 127995 && t <= 127999;
2211
2308
  }
2212
- function zn(e) {
2309
+ function Gn(e) {
2213
2310
  let t = e.codePointAt(0);
2214
2311
  return t !== void 0 && t >= 127462 && t <= 127487;
2215
2312
  }
2216
- var Bn;
2217
- function Vn(e) {
2218
- return e ? (Bn ||= Hn(), Bn(e)) : !1;
2313
+ var Kn;
2314
+ function qn(e) {
2315
+ return e ? (Kn ||= Jn(), Kn(e)) : !1;
2219
2316
  }
2220
- function Hn() {
2317
+ function Jn() {
2221
2318
  try {
2222
2319
  let e = /\p{Mark}/u;
2223
2320
  return (t) => e.test(t);
@@ -2228,19 +2325,19 @@ function Hn() {
2228
2325
  };
2229
2326
  }
2230
2327
  }
2231
- var Un;
2232
- function Wn(e) {
2233
- return e ? (Un ||= Gn(), Un(e)) : !1;
2328
+ var Yn;
2329
+ function Xn(e) {
2330
+ return e ? (Yn ||= Zn(), Yn(e)) : !1;
2234
2331
  }
2235
- function Gn() {
2332
+ function Zn() {
2236
2333
  try {
2237
2334
  let e = /\p{Extended_Pictographic}/u;
2238
2335
  return (t) => e.test(t);
2239
2336
  } catch {
2240
- return Kn;
2337
+ return Qn;
2241
2338
  }
2242
2339
  }
2243
- function Kn(e) {
2340
+ function Qn(e) {
2244
2341
  if (!e) return !1;
2245
2342
  for (let t of Array.from(e)) {
2246
2343
  let e = t.codePointAt(0);
@@ -2248,7 +2345,7 @@ function Kn(e) {
2248
2345
  }
2249
2346
  return !1;
2250
2347
  }
2251
- function qn(e) {
2348
+ function $n(e) {
2252
2349
  let t = [], n = "", r = 0;
2253
2350
  for (let i = 0; i < e.length; i++) {
2254
2351
  let a = e[i];
@@ -2266,16 +2363,16 @@ function qn(e) {
2266
2363
  breaks: r
2267
2364
  }), t;
2268
2365
  }
2269
- function Jn(e) {
2366
+ function er(e) {
2270
2367
  if (e.length === 0) return [];
2271
2368
  let t = [], n = [];
2272
2369
  for (let r of e) n.push(r), r.breaks >= 2 && (t.push(n), n = []);
2273
2370
  return n.length > 0 && t.push(n), t;
2274
2371
  }
2275
- function G(e, t) {
2372
+ function K(e, t) {
2276
2373
  return (e & t) === t;
2277
2374
  }
2278
- function Yn(e) {
2375
+ function tr(e) {
2279
2376
  return {
2280
2377
  "--tw-motion-seq-index": e.toString(),
2281
2378
  backgroundColor: "inherit",
@@ -2292,19 +2389,19 @@ function Yn(e) {
2292
2389
  WebkitTextFillColor: "inherit"
2293
2390
  };
2294
2391
  }
2295
- function Xn(e) {
2392
+ function nr(e) {
2296
2393
  if (!e) return e;
2297
- let t = jn(e);
2394
+ let t = Ln(e);
2298
2395
  if (t.length === 0) return e;
2299
- let { nodes: n, sawEmoji: r } = Zn(t);
2396
+ let { nodes: n, sawEmoji: r } = rr(t);
2300
2397
  return r ? n.length === 1 ? n[0] ?? e : n : e;
2301
2398
  }
2302
- function Zn(e, t) {
2399
+ function rr(e, t) {
2303
2400
  let n = [], r = "", i = !1, a = t?.emoji ?? 0, o = () => {
2304
2401
  r &&= (n.push(r), "");
2305
2402
  };
2306
2403
  for (let s of e) {
2307
- if (Wn(s)) {
2404
+ if (Xn(s)) {
2308
2405
  i = !0, o();
2309
2406
  let e = `motion-emoji-${t ? t.emoji++ : a++}`;
2310
2407
  n.push(/* @__PURE__ */ F("span", {
@@ -2323,16 +2420,16 @@ function Zn(e, t) {
2323
2420
  sawEmoji: !1
2324
2421
  };
2325
2422
  }
2326
- function Qn(e) {
2327
- if (!e) return W.None;
2423
+ function ir(e) {
2424
+ if (!e) return G.None;
2328
2425
  let t = e.trim();
2329
- if (!t) return W.None;
2330
- let n = Sn.get(t);
2426
+ if (!t) return G.None;
2427
+ let n = On.get(t);
2331
2428
  if (typeof n == "number") return n;
2332
- if (typeof document > "u") return W.None;
2429
+ if (typeof document > "u") return G.None;
2333
2430
  let r = t.split(/\s+/).filter(Boolean);
2334
- if (r.length === 0) return W.None;
2335
- let i = r.map((e) => `.${er(e)}`).map((e) => RegExp(`(^|[^a-zA-Z0-9_-])${tr(e)}(?![a-zA-Z0-9_-])`)), a = W.None, o = !1;
2431
+ if (r.length === 0) return G.None;
2432
+ let i = r.map((e) => `.${or(e)}`).map((e) => RegExp(`(^|[^a-zA-Z0-9_-])${sr(e)}(?![a-zA-Z0-9_-])`)), a = G.None, o = !1;
2336
2433
  for (let e of Array.from(document.styleSheets)) {
2337
2434
  let t;
2338
2435
  try {
@@ -2340,18 +2437,18 @@ function Qn(e) {
2340
2437
  } catch {
2341
2438
  continue;
2342
2439
  }
2343
- let n = $n(t, i);
2344
- if (n.mask && (a |= n.mask, a === bn)) break;
2440
+ let n = ar(t, i);
2441
+ if (n.mask && (a |= n.mask, a === En)) break;
2345
2442
  o ||= n.sawStyleRule;
2346
2443
  }
2347
- return (a !== W.None || o) && Sn.set(t, a), a;
2444
+ return (a !== G.None || o) && On.set(t, a), a;
2348
2445
  }
2349
- function $n(e, t) {
2446
+ function ar(e, t) {
2350
2447
  if (!e) return {
2351
- mask: W.None,
2448
+ mask: G.None,
2352
2449
  sawStyleRule: !1
2353
2450
  };
2354
- let n = W.None, r = !1;
2451
+ let n = G.None, r = !1;
2355
2452
  for (let i = 0; i < e.length; i++) {
2356
2453
  let a = e[i];
2357
2454
  if (a) {
@@ -2359,14 +2456,14 @@ function $n(e, t) {
2359
2456
  let e = a.selectorText ?? "";
2360
2457
  if (!e || !t.some((t) => t.test(e))) continue;
2361
2458
  r = !0;
2362
- for (let t of yn) t.hints.some((t) => e.includes(t)) && (n |= t.flag);
2363
- if (n === bn) return {
2459
+ for (let t of Tn) t.hints.some((t) => e.includes(t)) && (n |= t.flag);
2460
+ if (n === En) return {
2364
2461
  mask: n,
2365
2462
  sawStyleRule: !0
2366
2463
  };
2367
2464
  } else if ("cssRules" in a) {
2368
- let e = $n(a.cssRules, t);
2369
- if (e.mask && (n |= e.mask, n === bn)) return {
2465
+ let e = ar(a.cssRules, t);
2466
+ if (e.mask && (n |= e.mask, n === En)) return {
2370
2467
  mask: n,
2371
2468
  sawStyleRule: !0
2372
2469
  };
@@ -2379,106 +2476,124 @@ function $n(e, t) {
2379
2476
  sawStyleRule: r
2380
2477
  };
2381
2478
  }
2382
- function er(e) {
2479
+ function or(e) {
2383
2480
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2384
2481
  }
2385
- function tr(e) {
2482
+ function sr(e) {
2386
2483
  return e.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2387
2484
  }
2388
2485
  //#endregion
2389
2486
  //#region src/auth/storage.ts
2390
- var nr = "ikon-auth-session", rr = "ikon-auth-refreshable", ir = "ikon-auth-auto-login-attempted-run", ar = 6048e5, or = 6e4;
2391
- function sr(e) {
2487
+ var cr = "ikon-auth-session", lr = "ikon-auth-refreshable", ur = "ikon-auth-auto-login-attempted-run", dr = 6048e5, fr = 6e4;
2488
+ function pr(e) {
2392
2489
  try {
2393
2490
  let t = e.split(".");
2394
- if (t.length !== 3) return !0;
2395
- let n = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), i = JSON.parse(atob(r));
2396
- return typeof i.exp == "number" && Date.now() >= i.exp * 1e3 - or;
2491
+ if (t.length !== 3) return;
2492
+ let n = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4);
2493
+ return JSON.parse(atob(r));
2397
2494
  } catch {
2398
- return !0;
2495
+ return;
2399
2496
  }
2400
2497
  }
2401
- function K(e) {
2498
+ function mr(e) {
2499
+ let t = pr(e);
2500
+ return !t || typeof t.exp == "number" && Date.now() >= t.exp * 1e3 - fr;
2501
+ }
2502
+ function hr(e) {
2503
+ let t = pr(e)?.exp;
2504
+ return typeof t == "number" ? (/* @__PURE__ */ new Date(t * 1e3)).toISOString() : void 0;
2505
+ }
2506
+ function q(e) {
2402
2507
  try {
2403
- localStorage.setItem(nr, JSON.stringify(e));
2508
+ localStorage.setItem(cr, JSON.stringify(e));
2404
2509
  } catch {
2405
2510
  console.warn("Failed to save auth session to localStorage");
2406
2511
  }
2407
2512
  }
2408
- function cr() {
2513
+ function gr() {
2409
2514
  try {
2410
- let e = localStorage.getItem(nr);
2515
+ let e = localStorage.getItem(cr);
2411
2516
  if (!e) return null;
2412
2517
  let t = JSON.parse(e);
2413
- return Date.now() - t.authenticatedAt > ar || sr(t.token) ? (hr(), null) : t;
2518
+ return Date.now() - t.authenticatedAt > dr || mr(t.token) ? (wr(), null) : t;
2414
2519
  } catch {
2415
2520
  return console.warn("Failed to load auth session from localStorage"), null;
2416
2521
  }
2417
2522
  }
2418
- function lr(e) {
2523
+ function _r() {
2419
2524
  try {
2420
- localStorage.removeItem(nr), localStorage.setItem(rr, JSON.stringify(e));
2525
+ let e = localStorage.getItem(cr);
2526
+ if (!e) return !1;
2527
+ let t = JSON.parse(e);
2528
+ return t.provider === "dev" && mr(t.token);
2529
+ } catch {
2530
+ return !1;
2531
+ }
2532
+ }
2533
+ function vr(e) {
2534
+ try {
2535
+ localStorage.removeItem(cr), localStorage.setItem(lr, JSON.stringify(e));
2421
2536
  } catch {
2422
2537
  console.warn("Failed to save the auth session marker to localStorage");
2423
2538
  }
2424
2539
  }
2425
- function ur() {
2540
+ function yr() {
2426
2541
  try {
2427
- let e = localStorage.getItem(rr);
2542
+ let e = localStorage.getItem(lr);
2428
2543
  if (!e) return null;
2429
2544
  let t = JSON.parse(e);
2430
- return Date.now() - t.renewedAt > ar ? (fr(), null) : t;
2545
+ return Date.now() - t.renewedAt > dr ? (xr(), null) : t;
2431
2546
  } catch {
2432
2547
  return console.warn("Failed to load the auth session marker from localStorage"), null;
2433
2548
  }
2434
2549
  }
2435
- function dr() {
2436
- let e = ur();
2437
- e && lr({
2550
+ function br() {
2551
+ let e = yr();
2552
+ e && vr({
2438
2553
  ...e,
2439
2554
  renewedAt: Date.now()
2440
2555
  });
2441
2556
  }
2442
- function fr() {
2557
+ function xr() {
2443
2558
  try {
2444
- localStorage.removeItem(rr);
2559
+ localStorage.removeItem(lr);
2445
2560
  } catch {
2446
2561
  console.warn("Failed to clear the auth session marker from localStorage");
2447
2562
  }
2448
2563
  }
2449
- function pr() {
2450
- cr()?.provider === "anonymous" && hr(), ur()?.provider === "anonymous" && fr();
2564
+ function Sr() {
2565
+ gr()?.provider === "anonymous" && wr(), yr()?.provider === "anonymous" && xr();
2451
2566
  }
2452
- function mr() {
2567
+ function Cr() {
2453
2568
  try {
2454
2569
  let e = typeof window < "u" ? new URLSearchParams(window.location.search) : void 0;
2455
2570
  if (e?.get("ikon_token") || e?.get("ikon_code")) return !0;
2456
2571
  } catch {}
2457
- let e = cr()?.provider ?? ur()?.provider;
2572
+ let e = gr()?.provider ?? yr()?.provider;
2458
2573
  return e !== void 0 && e !== "anonymous";
2459
2574
  }
2460
- function hr() {
2575
+ function wr() {
2461
2576
  try {
2462
- localStorage.removeItem(nr);
2577
+ localStorage.removeItem(cr);
2463
2578
  } catch {
2464
2579
  console.warn("Failed to clear auth session from localStorage");
2465
2580
  }
2466
2581
  }
2467
- function gr(e) {
2582
+ function Tr(e) {
2468
2583
  if (e) try {
2469
- sessionStorage.setItem(ir, e);
2584
+ sessionStorage.setItem(ur, e);
2470
2585
  } catch {
2471
2586
  console.warn("Failed to record auto-login attempt in sessionStorage");
2472
2587
  }
2473
2588
  }
2474
- function _r() {
2589
+ function Er() {
2475
2590
  try {
2476
- return sessionStorage.getItem(ir);
2591
+ return sessionStorage.getItem(ur);
2477
2592
  } catch {
2478
2593
  return null;
2479
2594
  }
2480
2595
  }
2481
- function q(e) {
2596
+ function J(e) {
2482
2597
  return {
2483
2598
  id: "",
2484
2599
  provider: e.provider,
@@ -2489,8 +2604,8 @@ function q(e) {
2489
2604
  }
2490
2605
  //#endregion
2491
2606
  //#region src/auth/auth-service.ts
2492
- var vr = 15e3, yr = 15e3, J = b("AuthService");
2493
- async function br(e) {
2607
+ var Dr = 15e3, Or = 15e3, Y = b("AuthService");
2608
+ async function kr(e) {
2494
2609
  try {
2495
2610
  return await fetch(e, {
2496
2611
  method: "GET",
@@ -2500,34 +2615,34 @@ async function br(e) {
2500
2615
  return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
2501
2616
  }
2502
2617
  }
2503
- var xr = "x-ikon-auth-service";
2504
- function Sr(e) {
2505
- if (e.headers.get(xr) !== null) return !1;
2618
+ var Ar = "x-ikon-auth-service";
2619
+ function jr(e) {
2620
+ if (e.headers.get(Ar) !== null) return !1;
2506
2621
  if (e.status === 404 || e.status === 405) return !0;
2507
2622
  let t = e.headers.get("content-type") ?? "";
2508
2623
  return e.status === 200 && t.includes("text/html");
2509
2624
  }
2510
- async function Y(e, t, n) {
2625
+ async function X(e, t, n) {
2511
2626
  let r = `${e}${t}`, i = w(), a = i !== null && e === i, o = a ? await te() : i, s = o !== null && o !== e ? `${o}${t}` : null, c;
2512
2627
  try {
2513
2628
  c = await fetch(r, n);
2514
2629
  } catch (i) {
2515
2630
  let a = i instanceof Error ? `${i.name}: ${i.message}` : String(i);
2516
2631
  if (!s) {
2517
- let n = await br(e);
2518
- throw J.error(`Auth request ${t} could not reach ${r} — ${a}. ${n}`), Error(`Auth request could not reach ${r} (${a}). ${n}`, { cause: i });
2632
+ let n = await kr(e);
2633
+ throw Y.error(`Auth request ${t} could not reach ${r} — ${a}. ${n}`), Error(`Auth request could not reach ${r} (${a}). ${n}`, { cause: i });
2519
2634
  }
2520
- J.warn(`Auth request ${t} could not reach ${r} (${a}); falling back to ${s}`);
2635
+ Y.warn(`Auth request ${t} could not reach ${r} (${a}); falling back to ${s}`);
2521
2636
  try {
2522
2637
  return await fetch(s, n);
2523
2638
  } catch (n) {
2524
- let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await br(e);
2525
- throw J.error(`Auth request ${t} failed on both ${r} (${a}) and ${s} (${i}). ${o}`), Error(`Auth request unreachable: ${r} (${a}) and ${s} (${i})`, { cause: n });
2639
+ let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await kr(e);
2640
+ throw Y.error(`Auth request ${t} failed on both ${r} (${a}) and ${s} (${i}). ${o}`), Error(`Auth request unreachable: ${r} (${a}) and ${s} (${i})`, { cause: n });
2526
2641
  }
2527
2642
  }
2528
- return a && s !== null && Sr(c) ? (J.warn(`Auth request ${t} got a non-auth-service answer from ${r} (${c.status}); this LB has no /ikon/auth route, falling back to ${s}`), fetch(s, n)) : c;
2643
+ return a && s !== null && jr(c) ? (Y.warn(`Auth request ${t} got a non-auth-service answer from ${r} (${c.status}); this LB has no /ikon/auth route, falling back to ${s}`), fetch(s, n)) : c;
2529
2644
  }
2530
- async function Cr(e, t, n) {
2645
+ async function Mr(e, t, n) {
2531
2646
  let r = ae(), i = n === "guest" ? "anonymous" : n, a = {
2532
2647
  method: "POST",
2533
2648
  headers: { "Content-Type": "application/json" },
@@ -2537,43 +2652,43 @@ async function Cr(e, t, n) {
2537
2652
  ...i ? { method: i } : {}
2538
2653
  })
2539
2654
  }, o = typeof window < "u" ? window.location.origin : "?";
2540
- J.debug(`Anonymous auth: POST ${t}/anonymous (space=${e}, origin=${o})`);
2541
- let s = await Y(t, "/anonymous", a);
2655
+ Y.debug(`Anonymous auth: POST ${t}/anonymous (space=${e}, origin=${o})`);
2656
+ let s = await X(t, "/anonymous", a);
2542
2657
  if (!s.ok) {
2543
2658
  let e = await s.text().catch(() => "Unknown error");
2544
- throw J.error(`Anonymous auth HTTP ${s.status} from ${s.url}: ${e}`), Error(`Anonymous auth failed: ${s.status} ${e}`);
2659
+ throw Y.error(`Anonymous auth HTTP ${s.status} from ${s.url}: ${e}`), Error(`Anonymous auth failed: ${s.status} ${e}`);
2545
2660
  }
2546
2661
  let { token: c } = await s.json(), l = {
2547
2662
  token: c,
2548
2663
  provider: "anonymous",
2549
2664
  authenticatedAt: Date.now()
2550
2665
  };
2551
- return K(l), l;
2666
+ return q(l), l;
2552
2667
  }
2553
- async function wr({ email: e, spaceId: t, authUrl: n }) {
2554
- let r = await Y(n, "/email/send", {
2668
+ async function Nr({ email: e, spaceId: t, authUrl: n }) {
2669
+ let r = await X(n, "/email/send", {
2555
2670
  method: "POST",
2556
2671
  headers: { "Content-Type": "application/json" },
2557
2672
  body: JSON.stringify({
2558
2673
  email: e.trim(),
2559
2674
  space: t
2560
2675
  }),
2561
- signal: _(vr)
2676
+ signal: _(Dr)
2562
2677
  });
2563
2678
  if (!r.ok) {
2564
2679
  let e = await r.text().catch(() => "Failed to send login code");
2565
2680
  throw Error(e);
2566
2681
  }
2567
2682
  }
2568
- async function Tr({ email: e, code: t, authUrl: n }) {
2569
- let r = await Y(n, "/email/code", {
2683
+ async function Pr({ email: e, code: t, authUrl: n }) {
2684
+ let r = await X(n, "/email/code", {
2570
2685
  method: "POST",
2571
2686
  headers: { "Content-Type": "application/json" },
2572
2687
  body: JSON.stringify({
2573
2688
  email: e.trim(),
2574
2689
  code: t.trim()
2575
2690
  }),
2576
- signal: _(vr)
2691
+ signal: _(Dr)
2577
2692
  });
2578
2693
  if (!r.ok) {
2579
2694
  let e = await r.text().catch(() => "Invalid code");
@@ -2584,26 +2699,26 @@ async function Tr({ email: e, code: t, authUrl: n }) {
2584
2699
  provider: "email",
2585
2700
  authenticatedAt: Date.now()
2586
2701
  };
2587
- return K(a), a;
2702
+ return q(a), a;
2588
2703
  }
2589
- function Er() {
2704
+ function Fr() {
2590
2705
  let e = new URLSearchParams(window.location.search), t = e.get("ikon_token"), n = e.get("ikon_provider");
2591
2706
  return t && n ? {
2592
2707
  token: t,
2593
2708
  provider: n
2594
2709
  } : null;
2595
2710
  }
2596
- function Dr() {
2711
+ function Ir() {
2597
2712
  let e = new URLSearchParams(window.location.search), t = e.get("ikon_code"), n = e.get("ikon_provider");
2598
2713
  return t && n ? {
2599
2714
  code: t,
2600
2715
  provider: n
2601
2716
  } : null;
2602
2717
  }
2603
- async function Or(e, t, n) {
2718
+ async function Lr(e, t, n) {
2604
2719
  let r = _e();
2605
2720
  if (!r) throw Error("This sign-in was started in a different browser or tab");
2606
- let i = await Y(await S(n), "/oauth/exchange", {
2721
+ let i = await X(await S(n), "/oauth/exchange", {
2607
2722
  method: "POST",
2608
2723
  headers: { "Content-Type": "application/json" },
2609
2724
  body: JSON.stringify({
@@ -2611,7 +2726,7 @@ async function Or(e, t, n) {
2611
2726
  codeVerifier: r,
2612
2727
  supportsRefresh: !0
2613
2728
  }),
2614
- signal: _(vr)
2729
+ signal: _(Dr)
2615
2730
  });
2616
2731
  if (!i.ok) throw Error("Could not complete the sign-in");
2617
2732
  let { token: a, expiresAt: o } = await i.json(), s = {
@@ -2620,24 +2735,24 @@ async function Or(e, t, n) {
2620
2735
  authenticatedAt: Date.now(),
2621
2736
  expiresAt: o
2622
2737
  };
2623
- return o ? lr({
2738
+ return o ? vr({
2624
2739
  provider: t,
2625
2740
  authenticatedAt: s.authenticatedAt,
2626
2741
  renewedAt: s.authenticatedAt
2627
- }) : K(s), s;
2742
+ }) : q(s), s;
2628
2743
  }
2629
- async function kr(e) {
2744
+ async function Rr(e) {
2630
2745
  let t = w();
2631
2746
  if (t === null) return null;
2632
2747
  let n;
2633
2748
  try {
2634
2749
  n = await fetch(`${t}/session/refresh`, {
2635
2750
  method: "POST",
2636
- signal: _(yr)
2751
+ signal: _(Or)
2637
2752
  });
2638
2753
  } catch (e) {
2639
2754
  let n = e instanceof Error ? `${e.name}: ${e.message}` : String(e);
2640
- throw J.warn(`Session renewal could not reach ${t}/session/refresh (${n})`), Error(`Session renewal could not reach the auth service (${n})`, { cause: e });
2755
+ throw Y.warn(`Session renewal could not reach ${t}/session/refresh (${n})`), Error(`Session renewal could not reach the auth service (${n})`, { cause: e });
2641
2756
  }
2642
2757
  if (n.status === 401) return null;
2643
2758
  if (!n.ok) throw Error(`Session renewal failed: ${n.status}`);
@@ -2649,25 +2764,25 @@ async function kr(e) {
2649
2764
  expiresAt: i
2650
2765
  };
2651
2766
  }
2652
- function Ar() {
2767
+ function zr() {
2653
2768
  let e = new URLSearchParams(window.location.search), t = e.get("error");
2654
2769
  return t ? {
2655
2770
  code: t,
2656
2771
  provider: e.get("ikon_provider")
2657
2772
  } : null;
2658
2773
  }
2659
- function jr() {
2774
+ function Br() {
2660
2775
  return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("ikon-signed-out");
2661
2776
  }
2662
- var Mr = {
2777
+ var Vr = {
2663
2778
  google: "Google",
2664
2779
  facebook: "Facebook",
2665
2780
  apple: "Apple",
2666
2781
  microsoft: "Microsoft",
2667
2782
  signicat: "eID"
2668
2783
  };
2669
- function Nr(e, t, n) {
2670
- let r = t ? Mr[t] ?? t : "this provider";
2784
+ function Hr(e, t, n) {
2785
+ let r = t ? Vr[t] ?? t : "this provider";
2671
2786
  switch (e) {
2672
2787
  case "account_exists_unverified_email": {
2673
2788
  let e = `This email address already has an account on this app that uses a different sign-in method. For security, ${r} sign-in can't be connected to it automatically.`;
@@ -2678,7 +2793,7 @@ function Nr(e, t, n) {
2678
2793
  default: return e;
2679
2794
  }
2680
2795
  }
2681
- function Pr() {
2796
+ function Ur() {
2682
2797
  let e = new URLSearchParams(window.location.search);
2683
2798
  for (let t of [
2684
2799
  "ikon_token",
@@ -2690,12 +2805,12 @@ function Pr() {
2690
2805
  let t = e.toString();
2691
2806
  window.history.replaceState({}, "", t.length > 0 ? `${window.location.pathname}?${t}` : window.location.pathname);
2692
2807
  }
2693
- async function Fr(e, t, n, r) {
2808
+ async function Wr(e, t, n, r) {
2694
2809
  let i = r ?? window.location.origin + window.location.pathname + window.location.search, a = await x(), o = a ? `&code_challenge=${encodeURIComponent(a)}` : "";
2695
2810
  return `${n}/oauth/${e}?space=${encodeURIComponent(t)}&return=${encodeURIComponent(i)}${o}`;
2696
2811
  }
2697
- async function Ir(e) {
2698
- let t = await Y(e, "/passkey/registration/options", {
2812
+ async function Gr(e) {
2813
+ let t = await X(e, "/passkey/registration/options", {
2699
2814
  method: "POST",
2700
2815
  headers: { "Content-Type": "application/json" }
2701
2816
  });
@@ -2705,8 +2820,8 @@ async function Ir(e) {
2705
2820
  }
2706
2821
  return t.json();
2707
2822
  }
2708
- async function Lr(e, t, n) {
2709
- let r = await Y(e, "/passkey/registration/verify", {
2823
+ async function Kr(e, t, n) {
2824
+ let r = await X(e, "/passkey/registration/verify", {
2710
2825
  method: "POST",
2711
2826
  headers: { "Content-Type": "application/json" },
2712
2827
  body: JSON.stringify({
@@ -2723,10 +2838,10 @@ async function Lr(e, t, n) {
2723
2838
  provider: "passkey",
2724
2839
  authenticatedAt: Date.now()
2725
2840
  };
2726
- return K(a), a;
2841
+ return q(a), a;
2727
2842
  }
2728
- async function Rr(e, t) {
2729
- let n = await Y(e, "/passkey/authentication/options", {
2843
+ async function qr(e, t) {
2844
+ let n = await X(e, "/passkey/authentication/options", {
2730
2845
  method: "POST",
2731
2846
  headers: { "Content-Type": "application/json" },
2732
2847
  body: JSON.stringify({ email: t })
@@ -2737,8 +2852,8 @@ async function Rr(e, t) {
2737
2852
  }
2738
2853
  return n.json();
2739
2854
  }
2740
- async function zr(e, t) {
2741
- let n = await Y(e, "/passkey/authentication/verify", {
2855
+ async function Jr(e, t) {
2856
+ let n = await X(e, "/passkey/authentication/verify", {
2742
2857
  method: "POST",
2743
2858
  headers: { "Content-Type": "application/json" },
2744
2859
  body: JSON.stringify({ response: t })
@@ -2752,55 +2867,55 @@ async function zr(e, t) {
2752
2867
  provider: "passkey",
2753
2868
  authenticatedAt: Date.now()
2754
2869
  };
2755
- return K(i), i;
2870
+ return q(i), i;
2756
2871
  }
2757
- async function Br(e, t) {
2872
+ async function Yr(e, t) {
2758
2873
  try {
2759
- await Y(await S(t), "/logout", {
2874
+ await X(await S(t), "/logout", {
2760
2875
  method: "POST",
2761
2876
  headers: { Authorization: `Bearer ${e}` },
2762
- signal: _(vr)
2877
+ signal: _(Dr)
2763
2878
  });
2764
2879
  } catch {}
2765
2880
  }
2766
2881
  //#endregion
2767
2882
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/bufferToBase64URLString.js
2768
- function X(e) {
2883
+ function Z(e) {
2769
2884
  let t = new Uint8Array(e), n = "";
2770
2885
  for (let e of t) n += String.fromCharCode(e);
2771
2886
  return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2772
2887
  }
2773
2888
  //#endregion
2774
2889
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/base64URLStringToBuffer.js
2775
- function Vr(e) {
2890
+ function Xr(e) {
2776
2891
  let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - t.length % 4) % 4, r = t.padEnd(t.length + n, "="), i = atob(r), a = new ArrayBuffer(i.length), o = new Uint8Array(a);
2777
2892
  for (let e = 0; e < i.length; e++) o[e] = i.charCodeAt(e);
2778
2893
  return a;
2779
2894
  }
2780
2895
  //#endregion
2781
2896
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthn.js
2782
- function Hr() {
2783
- return Ur.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2897
+ function Zr() {
2898
+ return Qr.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2784
2899
  }
2785
- var Ur = { stubThis: (e) => e };
2900
+ var Qr = { stubThis: (e) => e };
2786
2901
  //#endregion
2787
2902
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js
2788
- function Wr(e) {
2903
+ function $r(e) {
2789
2904
  let { id: t } = e;
2790
2905
  return {
2791
2906
  ...e,
2792
- id: Vr(t),
2907
+ id: Xr(t),
2793
2908
  transports: e.transports
2794
2909
  };
2795
2910
  }
2796
2911
  //#endregion
2797
2912
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/isValidDomain.js
2798
- function Gr(e) {
2913
+ function ei(e) {
2799
2914
  return e === "localhost" || /^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e);
2800
2915
  }
2801
2916
  //#endregion
2802
2917
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/webAuthnError.js
2803
- var Z = class extends Error {
2918
+ var Q = class extends Error {
2804
2919
  constructor({ message: e, code: t, cause: n, name: r }) {
2805
2920
  super(e, { cause: n }), Object.defineProperty(this, "code", {
2806
2921
  enumerable: !0,
@@ -2812,76 +2927,76 @@ var Z = class extends Error {
2812
2927
  };
2813
2928
  //#endregion
2814
2929
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyRegistrationError.js
2815
- function Kr({ error: e, options: t }) {
2930
+ function ti({ error: e, options: t }) {
2816
2931
  let { publicKey: n } = t;
2817
2932
  if (!n) throw Error("options was missing required publicKey property");
2818
2933
  if (e.name === "AbortError") {
2819
- if (t.signal instanceof AbortSignal) return new Z({
2934
+ if (t.signal instanceof AbortSignal) return new Q({
2820
2935
  message: "Registration ceremony was sent an abort signal",
2821
2936
  code: "ERROR_CEREMONY_ABORTED",
2822
2937
  cause: e
2823
2938
  });
2824
2939
  } else if (e.name === "ConstraintError") {
2825
- if (n.authenticatorSelection?.requireResidentKey === !0) return new Z({
2940
+ if (n.authenticatorSelection?.requireResidentKey === !0) return new Q({
2826
2941
  message: "Discoverable credentials were required but no available authenticator supported it",
2827
2942
  code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
2828
2943
  cause: e
2829
2944
  });
2830
- if (t.mediation === "conditional" && n.authenticatorSelection?.userVerification === "required") return new Z({
2945
+ if (t.mediation === "conditional" && n.authenticatorSelection?.userVerification === "required") return new Q({
2831
2946
  message: "User verification was required during automatic registration but it could not be performed",
2832
2947
  code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
2833
2948
  cause: e
2834
2949
  });
2835
- if (n.authenticatorSelection?.userVerification === "required") return new Z({
2950
+ if (n.authenticatorSelection?.userVerification === "required") return new Q({
2836
2951
  message: "User verification was required but no available authenticator supported it",
2837
2952
  code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
2838
2953
  cause: e
2839
2954
  });
2840
- } else if (e.name === "InvalidStateError") return new Z({
2955
+ } else if (e.name === "InvalidStateError") return new Q({
2841
2956
  message: "The authenticator was previously registered",
2842
2957
  code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
2843
2958
  cause: e
2844
2959
  });
2845
- else if (e.name === "NotAllowedError") return new Z({
2960
+ else if (e.name === "NotAllowedError") return new Q({
2846
2961
  message: e.message,
2847
2962
  code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
2848
2963
  cause: e
2849
2964
  });
2850
- else if (e.name === "NotSupportedError") return n.pubKeyCredParams.filter((e) => e.type === "public-key").length === 0 ? new Z({
2965
+ else if (e.name === "NotSupportedError") return n.pubKeyCredParams.filter((e) => e.type === "public-key").length === 0 ? new Q({
2851
2966
  message: "No entry in pubKeyCredParams was of type \"public-key\"",
2852
2967
  code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
2853
2968
  cause: e
2854
- }) : new Z({
2969
+ }) : new Q({
2855
2970
  message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
2856
2971
  code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
2857
2972
  cause: e
2858
2973
  });
2859
2974
  else if (e.name === "SecurityError") {
2860
2975
  let t = globalThis.location.hostname;
2861
- if (!Gr(t)) return new Z({
2976
+ if (!ei(t)) return new Q({
2862
2977
  message: `${globalThis.location.hostname} is an invalid domain`,
2863
2978
  code: "ERROR_INVALID_DOMAIN",
2864
2979
  cause: e
2865
2980
  });
2866
- if (n.rp.id !== t) return new Z({
2981
+ if (n.rp.id !== t) return new Q({
2867
2982
  message: `The RP ID "${n.rp.id}" is invalid for this domain`,
2868
2983
  code: "ERROR_INVALID_RP_ID",
2869
2984
  cause: e
2870
2985
  });
2871
2986
  } else if (e.name === "TypeError") {
2872
- if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64) return new Z({
2987
+ if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64) return new Q({
2873
2988
  message: "User ID was not between 1 and 64 characters",
2874
2989
  code: "ERROR_INVALID_USER_ID_LENGTH",
2875
2990
  cause: e
2876
2991
  });
2877
- } else if (e.name === "UnknownError") return new Z({
2992
+ } else if (e.name === "UnknownError") return new Q({
2878
2993
  message: "The authenticator was unable to process the specified options, or could not create a new credential",
2879
2994
  code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
2880
2995
  cause: e
2881
2996
  });
2882
2997
  return e;
2883
2998
  }
2884
- var qr = new class {
2999
+ var ni = new class {
2885
3000
  constructor() {
2886
3001
  Object.defineProperty(this, "controller", {
2887
3002
  enumerable: !0,
@@ -2904,31 +3019,31 @@ var qr = new class {
2904
3019
  e.name = "AbortError", this.controller.abort(e), this.controller = void 0;
2905
3020
  }
2906
3021
  }
2907
- }(), Jr = ["cross-platform", "platform"];
2908
- function Yr(e) {
2909
- if (e && !(Jr.indexOf(e) < 0)) return e;
3022
+ }(), ri = ["cross-platform", "platform"];
3023
+ function ii(e) {
3024
+ if (e && !(ri.indexOf(e) < 0)) return e;
2910
3025
  }
2911
3026
  //#endregion
2912
3027
  //#region ../../node_modules/@simplewebauthn/browser/esm/methods/startRegistration.js
2913
- async function Xr(e) {
3028
+ async function ai(e) {
2914
3029
  !e.optionsJSON && e.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
2915
3030
  let { optionsJSON: t, useAutoRegister: n = !1 } = e;
2916
- if (!Hr()) throw Error("WebAuthn is not supported in this browser");
3031
+ if (!Zr()) throw Error("WebAuthn is not supported in this browser");
2917
3032
  let r = {
2918
3033
  ...t,
2919
- challenge: Vr(t.challenge),
3034
+ challenge: Xr(t.challenge),
2920
3035
  user: {
2921
3036
  ...t.user,
2922
- id: Vr(t.user.id)
3037
+ id: Xr(t.user.id)
2923
3038
  },
2924
- excludeCredentials: t.excludeCredentials?.map(Wr)
3039
+ excludeCredentials: t.excludeCredentials?.map($r)
2925
3040
  }, i = {};
2926
- n && (i.mediation = "conditional"), i.publicKey = r, i.signal = qr.createNewAbortSignal();
3041
+ n && (i.mediation = "conditional"), i.publicKey = r, i.signal = ni.createNewAbortSignal();
2927
3042
  let a;
2928
3043
  try {
2929
3044
  a = await navigator.credentials.create(i);
2930
3045
  } catch (e) {
2931
- throw Kr({
3046
+ throw ti({
2932
3047
  error: e,
2933
3048
  options: i
2934
3049
  });
@@ -2940,27 +3055,27 @@ async function Xr(e) {
2940
3055
  if (typeof c.getPublicKeyAlgorithm == "function") try {
2941
3056
  d = c.getPublicKeyAlgorithm();
2942
3057
  } catch (e) {
2943
- Zr("getPublicKeyAlgorithm()", e);
3058
+ oi("getPublicKeyAlgorithm()", e);
2944
3059
  }
2945
3060
  let f;
2946
3061
  if (typeof c.getPublicKey == "function") try {
2947
3062
  let e = c.getPublicKey();
2948
- e !== null && (f = X(e));
3063
+ e !== null && (f = Z(e));
2949
3064
  } catch (e) {
2950
- Zr("getPublicKey()", e);
3065
+ oi("getPublicKey()", e);
2951
3066
  }
2952
3067
  let p;
2953
3068
  if (typeof c.getAuthenticatorData == "function") try {
2954
- p = X(c.getAuthenticatorData());
3069
+ p = Z(c.getAuthenticatorData());
2955
3070
  } catch (e) {
2956
- Zr("getAuthenticatorData()", e);
3071
+ oi("getAuthenticatorData()", e);
2957
3072
  }
2958
3073
  return {
2959
3074
  id: o,
2960
- rawId: X(s),
3075
+ rawId: Z(s),
2961
3076
  response: {
2962
- attestationObject: X(c.attestationObject),
2963
- clientDataJSON: X(c.clientDataJSON),
3077
+ attestationObject: Z(c.attestationObject),
3078
+ clientDataJSON: Z(c.clientDataJSON),
2964
3079
  transports: u,
2965
3080
  publicKeyAlgorithm: d,
2966
3081
  publicKey: f,
@@ -2968,49 +3083,49 @@ async function Xr(e) {
2968
3083
  },
2969
3084
  type: l,
2970
3085
  clientExtensionResults: a.getClientExtensionResults(),
2971
- authenticatorAttachment: Yr(a.authenticatorAttachment)
3086
+ authenticatorAttachment: ii(a.authenticatorAttachment)
2972
3087
  };
2973
3088
  }
2974
- function Zr(e, t) {
3089
+ function oi(e, t) {
2975
3090
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`, t);
2976
3091
  }
2977
3092
  //#endregion
2978
3093
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthnAutofill.js
2979
- function Qr() {
2980
- if (!Hr()) return $r.stubThis(new Promise((e) => e(!1)));
3094
+ function si() {
3095
+ if (!Zr()) return ci.stubThis(new Promise((e) => e(!1)));
2981
3096
  let e = globalThis.PublicKeyCredential;
2982
- return e?.isConditionalMediationAvailable === void 0 ? $r.stubThis(new Promise((e) => e(!1))) : $r.stubThis(e.isConditionalMediationAvailable());
3097
+ return e?.isConditionalMediationAvailable === void 0 ? ci.stubThis(new Promise((e) => e(!1))) : ci.stubThis(e.isConditionalMediationAvailable());
2983
3098
  }
2984
- var $r = { stubThis: (e) => e };
3099
+ var ci = { stubThis: (e) => e };
2985
3100
  //#endregion
2986
3101
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js
2987
- function ei({ error: e, options: t }) {
3102
+ function li({ error: e, options: t }) {
2988
3103
  let { publicKey: n } = t;
2989
3104
  if (!n) throw Error("options was missing required publicKey property");
2990
3105
  if (e.name === "AbortError") {
2991
- if (t.signal instanceof AbortSignal) return new Z({
3106
+ if (t.signal instanceof AbortSignal) return new Q({
2992
3107
  message: "Authentication ceremony was sent an abort signal",
2993
3108
  code: "ERROR_CEREMONY_ABORTED",
2994
3109
  cause: e
2995
3110
  });
2996
- } else if (e.name === "NotAllowedError") return new Z({
3111
+ } else if (e.name === "NotAllowedError") return new Q({
2997
3112
  message: e.message,
2998
3113
  code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
2999
3114
  cause: e
3000
3115
  });
3001
3116
  else if (e.name === "SecurityError") {
3002
3117
  let t = globalThis.location.hostname;
3003
- if (!Gr(t)) return new Z({
3118
+ if (!ei(t)) return new Q({
3004
3119
  message: `${globalThis.location.hostname} is an invalid domain`,
3005
3120
  code: "ERROR_INVALID_DOMAIN",
3006
3121
  cause: e
3007
3122
  });
3008
- if (n.rpId !== t) return new Z({
3123
+ if (n.rpId !== t) return new Q({
3009
3124
  message: `The RP ID "${n.rpId}" is invalid for this domain`,
3010
3125
  code: "ERROR_INVALID_RP_ID",
3011
3126
  cause: e
3012
3127
  });
3013
- } else if (e.name === "UnknownError") return new Z({
3128
+ } else if (e.name === "UnknownError") return new Q({
3014
3129
  message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
3015
3130
  code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
3016
3131
  cause: e
@@ -3019,52 +3134,60 @@ function ei({ error: e, options: t }) {
3019
3134
  }
3020
3135
  //#endregion
3021
3136
  //#region ../../node_modules/@simplewebauthn/browser/esm/methods/startAuthentication.js
3022
- async function ti(e) {
3137
+ async function ui(e) {
3023
3138
  !e.optionsJSON && e.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
3024
3139
  let { optionsJSON: t, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = e;
3025
- if (!Hr()) throw Error("WebAuthn is not supported in this browser");
3140
+ if (!Zr()) throw Error("WebAuthn is not supported in this browser");
3026
3141
  let i;
3027
- t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(Wr));
3142
+ t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map($r));
3028
3143
  let a = {
3029
3144
  ...t,
3030
- challenge: Vr(t.challenge),
3145
+ challenge: Xr(t.challenge),
3031
3146
  allowCredentials: i
3032
3147
  }, o = {};
3033
3148
  if (n) {
3034
- if (!await Qr()) throw Error("Browser does not support WebAuthn autofill");
3149
+ if (!await si()) throw Error("Browser does not support WebAuthn autofill");
3035
3150
  if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r) throw Error("No <input> with \"webauthn\" as the only or last value in its `autocomplete` attribute was detected");
3036
3151
  o.mediation = "conditional", a.allowCredentials = [];
3037
3152
  }
3038
- o.publicKey = a, o.signal = qr.createNewAbortSignal();
3153
+ o.publicKey = a, o.signal = ni.createNewAbortSignal();
3039
3154
  let s;
3040
3155
  try {
3041
3156
  s = await navigator.credentials.get(o);
3042
3157
  } catch (e) {
3043
- throw ei({
3158
+ throw li({
3044
3159
  error: e,
3045
3160
  options: o
3046
3161
  });
3047
3162
  }
3048
3163
  if (!s) throw Error("Authentication was not completed");
3049
3164
  let { id: c, rawId: l, response: u, type: d } = s, f;
3050
- return u.userHandle && (f = X(u.userHandle)), {
3165
+ return u.userHandle && (f = Z(u.userHandle)), {
3051
3166
  id: c,
3052
- rawId: X(l),
3167
+ rawId: Z(l),
3053
3168
  response: {
3054
- authenticatorData: X(u.authenticatorData),
3055
- clientDataJSON: X(u.clientDataJSON),
3056
- signature: X(u.signature),
3169
+ authenticatorData: Z(u.authenticatorData),
3170
+ clientDataJSON: Z(u.clientDataJSON),
3171
+ signature: Z(u.signature),
3057
3172
  userHandle: f
3058
3173
  },
3059
3174
  type: d,
3060
3175
  clientExtensionResults: s.getClientExtensionResults(),
3061
- authenticatorAttachment: Yr(s.authenticatorAttachment)
3176
+ authenticatorAttachment: ii(s.authenticatorAttachment)
3062
3177
  };
3063
3178
  }
3064
3179
  //#endregion
3065
3180
  //#region src/auth/auth-context.tsx
3066
- var ni = ye(null), ri = 12e4;
3067
- function ii({ children: e, config: n }) {
3181
+ async function di() {
3182
+ try {
3183
+ let e = await fetch("/__ikon/dev-login-token", { cache: "no-store" });
3184
+ return e.ok && (await e.json()).token || void 0;
3185
+ } catch {
3186
+ return;
3187
+ }
3188
+ }
3189
+ var fi = ye(null), pi = 12e4, mi = 6e4;
3190
+ function hi({ children: e, config: n }) {
3068
3191
  let [r, i] = M({
3069
3192
  isAuthenticated: !1,
3070
3193
  isLoading: !0,
@@ -3074,9 +3197,9 @@ function ii({ children: e, config: n }) {
3074
3197
  if (!c.current) {
3075
3198
  c.current = !0;
3076
3199
  try {
3077
- let t = await kr(e);
3200
+ let t = await Rr(e);
3078
3201
  if (t === null) {
3079
- fr(), i({
3202
+ xr(), i({
3080
3203
  isAuthenticated: !1,
3081
3204
  isLoading: !1,
3082
3205
  user: null,
@@ -3084,10 +3207,10 @@ function ii({ children: e, config: n }) {
3084
3207
  });
3085
3208
  return;
3086
3209
  }
3087
- dr(), i({
3210
+ br(), i({
3088
3211
  isAuthenticated: !0,
3089
3212
  isLoading: !1,
3090
- user: q(t),
3213
+ user: J(t),
3091
3214
  error: null
3092
3215
  });
3093
3216
  } catch {} finally {
@@ -3098,28 +3221,28 @@ function ii({ children: e, config: n }) {
3098
3221
  k(() => {
3099
3222
  (() => {
3100
3223
  if (s.current) return;
3101
- let e = n.devLoginRunId, t = !!e && _r() === e;
3102
- e && !jr() && gr(e);
3103
- let r = !!n.devLoginToken && !!e && !t && !sr(n.devLoginToken) && !jr();
3104
- o || pr();
3105
- let c = Ar();
3224
+ let e = n.devLoginRunId, t = !!e && Er() === e && !_r();
3225
+ e && !Br() && Tr(e);
3226
+ let r = !!n.devLoginToken && !!e && !t && !Br();
3227
+ o || Sr();
3228
+ let c = zr();
3106
3229
  if (c) {
3107
- Pr(), i({
3230
+ Ur(), i({
3108
3231
  isAuthenticated: !1,
3109
3232
  isLoading: !1,
3110
3233
  user: null,
3111
- error: Nr(c.code, c.provider, { emailSignInAvailable: a })
3234
+ error: Hr(c.code, c.provider, { emailSignInAvailable: a })
3112
3235
  });
3113
3236
  return;
3114
3237
  }
3115
3238
  v();
3116
- let l = Dr();
3239
+ let l = Ir();
3117
3240
  if (l) {
3118
- s.current = !0, Pr(), Or(l.code, l.provider, n.authUrl).then((e) => {
3241
+ s.current = !0, Ur(), Lr(l.code, l.provider, n.authUrl).then((e) => {
3119
3242
  i({
3120
3243
  isAuthenticated: !0,
3121
3244
  isLoading: !1,
3122
- user: q(e),
3245
+ user: J(e),
3123
3246
  error: null
3124
3247
  });
3125
3248
  }).catch((e) => {
@@ -3132,26 +3255,26 @@ function ii({ children: e, config: n }) {
3132
3255
  });
3133
3256
  return;
3134
3257
  }
3135
- let u = Er();
3258
+ let u = Fr();
3136
3259
  if (u) {
3137
3260
  let e = {
3138
3261
  token: u.token,
3139
3262
  provider: u.provider,
3140
3263
  authenticatedAt: Date.now()
3141
3264
  };
3142
- K(e), Pr(), i({
3265
+ q(e), Ur(), i({
3143
3266
  isAuthenticated: !0,
3144
3267
  isLoading: !1,
3145
- user: q(e),
3268
+ user: J(e),
3146
3269
  error: null
3147
3270
  });
3148
3271
  return;
3149
3272
  }
3150
- let d = ur();
3273
+ let d = yr();
3151
3274
  if (d) {
3152
- s.current = !0, kr(d).then((e) => {
3275
+ s.current = !0, Rr(d).then((e) => {
3153
3276
  if (e === null) {
3154
- fr(), i({
3277
+ xr(), i({
3155
3278
  isAuthenticated: !1,
3156
3279
  isLoading: !1,
3157
3280
  user: null,
@@ -3159,10 +3282,10 @@ function ii({ children: e, config: n }) {
3159
3282
  });
3160
3283
  return;
3161
3284
  }
3162
- dr(), i({
3285
+ br(), i({
3163
3286
  isAuthenticated: !0,
3164
3287
  isLoading: !1,
3165
- user: q(e),
3288
+ user: J(e),
3166
3289
  error: null
3167
3290
  });
3168
3291
  }).catch(() => {
@@ -3175,27 +3298,46 @@ function ii({ children: e, config: n }) {
3175
3298
  });
3176
3299
  return;
3177
3300
  }
3178
- let f = cr();
3301
+ let f = gr();
3179
3302
  if (f && !(r && f.provider === "anonymous")) {
3180
3303
  i({
3181
3304
  isAuthenticated: !0,
3182
3305
  isLoading: !1,
3183
- user: q(f),
3306
+ user: J(f),
3184
3307
  error: null
3185
3308
  });
3186
3309
  return;
3187
3310
  }
3188
3311
  if (r && n.devLoginToken) {
3189
- let e = {
3190
- token: n.devLoginToken,
3191
- provider: "dev",
3192
- authenticatedAt: Date.now()
3312
+ let e = (e) => {
3313
+ let t = {
3314
+ token: e,
3315
+ provider: "dev",
3316
+ authenticatedAt: Date.now(),
3317
+ expiresAt: hr(e)
3318
+ };
3319
+ q(t), i({
3320
+ isAuthenticated: !0,
3321
+ isLoading: !1,
3322
+ user: J(t),
3323
+ error: null
3324
+ });
3193
3325
  };
3194
- K(e), i({
3195
- isAuthenticated: !0,
3196
- isLoading: !1,
3197
- user: q(e),
3198
- error: null
3326
+ if (!mr(n.devLoginToken)) {
3327
+ e(n.devLoginToken);
3328
+ return;
3329
+ }
3330
+ di().then((t) => {
3331
+ if (t && !mr(t)) {
3332
+ e(t);
3333
+ return;
3334
+ }
3335
+ console.warn("[Ikon] Dev auto-login skipped: the saved developer token has expired. Run `ikon login dev`."), i({
3336
+ isAuthenticated: !1,
3337
+ isLoading: !1,
3338
+ user: null,
3339
+ error: null
3340
+ });
3199
3341
  });
3200
3342
  return;
3201
3343
  }
@@ -3214,11 +3356,11 @@ function ii({ children: e, config: n }) {
3214
3356
  o
3215
3357
  ]), k(() => {
3216
3358
  if (n.spaceId) return E(n.spaceId, (e) => {
3217
- s.current = !0, e.codeVerifier && fe(e.codeVerifier), Or(e.code, e.provider, n.authUrl).then((e) => {
3359
+ s.current = !0, e.codeVerifier && fe(e.codeVerifier), Lr(e.code, e.provider, n.authUrl).then((e) => {
3218
3360
  i({
3219
3361
  isAuthenticated: !0,
3220
3362
  isLoading: !1,
3221
- user: q(e),
3363
+ user: J(e),
3222
3364
  error: null
3223
3365
  });
3224
3366
  }).catch((e) => {
@@ -3232,16 +3374,57 @@ function ii({ children: e, config: n }) {
3232
3374
  });
3233
3375
  }, [n.spaceId, n.authUrl]), k(() => {
3234
3376
  let e = r.user?.expiresAt;
3235
- if (!e) return;
3236
- let t = ur();
3377
+ if (!e || r.user?.provider === "dev") return;
3378
+ let t = yr();
3237
3379
  if (!t) return;
3238
- let n = Date.parse(e) - ri, i = setTimeout(() => void l(t), Math.max(0, n - Date.now())), a = () => {
3380
+ let n = Date.parse(e) - pi, i = setTimeout(() => void l(t), Math.max(0, n - Date.now())), a = () => {
3239
3381
  document.visibilityState === "visible" && Date.now() >= n && l(t);
3240
3382
  };
3241
3383
  return document.addEventListener("visibilitychange", a), () => {
3242
3384
  clearTimeout(i), document.removeEventListener("visibilitychange", a);
3243
3385
  };
3244
- }, [r.user?.expiresAt, l]);
3386
+ }, [
3387
+ r.user?.expiresAt,
3388
+ r.user?.provider,
3389
+ l
3390
+ ]), k(() => {
3391
+ if (r.user?.provider !== "dev") return;
3392
+ let e = r.user.expiresAt;
3393
+ if (!e) return;
3394
+ let t = r.user.token, n = Date.parse(e) - pi, a, o = !1, s = !1, c = async () => {
3395
+ if (o || s) return;
3396
+ s = !0;
3397
+ let e = await di();
3398
+ if (s = !1, o) return;
3399
+ if (!e || e === t || mr(e)) {
3400
+ a = setTimeout(() => void c(), mi);
3401
+ return;
3402
+ }
3403
+ let n = {
3404
+ token: e,
3405
+ provider: "dev",
3406
+ authenticatedAt: Date.now(),
3407
+ expiresAt: hr(e)
3408
+ };
3409
+ q(n), i({
3410
+ isAuthenticated: !0,
3411
+ isLoading: !1,
3412
+ user: J(n),
3413
+ error: null
3414
+ });
3415
+ };
3416
+ a = setTimeout(() => void c(), Math.max(0, n - Date.now()));
3417
+ let l = () => {
3418
+ document.visibilityState === "visible" && Date.now() >= n && c();
3419
+ };
3420
+ return document.addEventListener("visibilitychange", l), () => {
3421
+ o = !0, clearTimeout(a), document.removeEventListener("visibilitychange", l);
3422
+ };
3423
+ }, [
3424
+ r.user?.provider,
3425
+ r.user?.expiresAt,
3426
+ r.user?.token
3427
+ ]);
3245
3428
  let u = O(async (e) => {
3246
3429
  if (!n.spaceId) {
3247
3430
  i((e) => ({
@@ -3267,11 +3450,11 @@ function ii({ children: e, config: n }) {
3267
3450
  isLoading: !0
3268
3451
  }));
3269
3452
  try {
3270
- let r = await Cr(n.spaceId, t, e);
3453
+ let r = await Mr(n.spaceId, t, e);
3271
3454
  i({
3272
3455
  isAuthenticated: !0,
3273
3456
  isLoading: !1,
3274
- user: q(r),
3457
+ user: J(r),
3275
3458
  error: null
3276
3459
  });
3277
3460
  } catch (e) {
@@ -3290,11 +3473,11 @@ function ii({ children: e, config: n }) {
3290
3473
  error: null
3291
3474
  }));
3292
3475
  try {
3293
- let e = await ti({ optionsJSON: await Rr(t) }), n = await zr(t, e);
3476
+ let e = await ui({ optionsJSON: await qr(t) }), n = await Jr(t, e);
3294
3477
  i({
3295
3478
  isAuthenticated: !0,
3296
3479
  isLoading: !1,
3297
- user: q(n),
3480
+ user: J(n),
3298
3481
  error: null
3299
3482
  });
3300
3483
  } catch (e) {
@@ -3315,14 +3498,14 @@ function ii({ children: e, config: n }) {
3315
3498
  }));
3316
3499
  return;
3317
3500
  }
3318
- window.location.href = await Fr(e, n.spaceId, t);
3501
+ window.location.href = await Wr(e, n.spaceId, t);
3319
3502
  }, [n.authUrl, n.spaceId]), d = O(async (e) => {
3320
3503
  if (!n.spaceId) throw i((e) => ({
3321
3504
  ...e,
3322
3505
  error: "Space ID is not configured"
3323
3506
  })), Error("Space ID is not configured");
3324
3507
  let t = await S(n.authUrl);
3325
- await wr({
3508
+ await Nr({
3326
3509
  email: e,
3327
3510
  spaceId: n.spaceId,
3328
3511
  authUrl: t
@@ -3334,7 +3517,7 @@ function ii({ children: e, config: n }) {
3334
3517
  error: null
3335
3518
  }));
3336
3519
  try {
3337
- let r = await Tr({
3520
+ let r = await Pr({
3338
3521
  email: e,
3339
3522
  code: t,
3340
3523
  authUrl: await S(n.authUrl)
@@ -3342,7 +3525,7 @@ function ii({ children: e, config: n }) {
3342
3525
  i({
3343
3526
  isAuthenticated: !0,
3344
3527
  isLoading: !1,
3345
- user: q(r),
3528
+ user: J(r),
3346
3529
  error: null
3347
3530
  });
3348
3531
  } catch (e) {
@@ -3355,7 +3538,7 @@ function ii({ children: e, config: n }) {
3355
3538
  }
3356
3539
  }, [n.authUrl]), p = O(() => {
3357
3540
  let e = r.user?.token;
3358
- e && Br(e, n.authUrl), hr(), fr(), t.clearAll(), i({
3541
+ e && Yr(e, n.authUrl), wr(), xr(), t.clearAll(), i({
3359
3542
  isAuthenticated: !1,
3360
3543
  isLoading: !1,
3361
3544
  user: null,
@@ -3369,11 +3552,11 @@ function ii({ children: e, config: n }) {
3369
3552
  error: null
3370
3553
  }));
3371
3554
  try {
3372
- let n = await Lr(t, await Xr({ optionsJSON: await Ir(t) }), e);
3555
+ let n = await Kr(t, await ai({ optionsJSON: await Gr(t) }), e);
3373
3556
  i({
3374
3557
  isAuthenticated: !0,
3375
3558
  isLoading: !1,
3376
- user: q(n),
3559
+ user: J(n),
3377
3560
  error: null
3378
3561
  });
3379
3562
  } catch (e) {
@@ -3400,37 +3583,37 @@ function ii({ children: e, config: n }) {
3400
3583
  d,
3401
3584
  f
3402
3585
  ]);
3403
- return /* @__PURE__ */ F(ni, {
3586
+ return /* @__PURE__ */ F(fi, {
3404
3587
  value: g,
3405
3588
  children: e
3406
3589
  });
3407
3590
  }
3408
- function ai() {
3409
- let e = be(ni);
3591
+ function gi() {
3592
+ let e = be(fi);
3410
3593
  if (!e) throw Error("useAuth must be used within an AuthProvider");
3411
3594
  return e;
3412
3595
  }
3413
- function oi() {
3414
- return be(ni);
3596
+ function _i() {
3597
+ return be(fi);
3415
3598
  }
3416
3599
  //#endregion
3417
3600
  //#region src/auth/oauth-continuation.ts
3418
- var si = "ikon-oauth", ci = "ikon-oauth-continue", li = "ikon-oauth-continue-attempts", ui = 5, di = 6e5;
3419
- function fi() {
3601
+ var vi = "ikon-oauth", yi = "ikon-oauth-continue", bi = "ikon-oauth-continue-attempts", xi = 5, Si = 6e5;
3602
+ function Ci() {
3420
3603
  if (typeof window > "u") return !1;
3421
- let e = new URL(window.location.href).searchParams.get(si);
3422
- return e ? (vi(e), !0) : _i() !== null;
3604
+ let e = new URL(window.location.href).searchParams.get(vi);
3605
+ return e ? (ki(e), !0) : Oi() !== null;
3423
3606
  }
3424
- function pi() {
3425
- return mi() !== null;
3607
+ function wi() {
3608
+ return Ti() !== null;
3426
3609
  }
3427
- function mi() {
3428
- return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? _i();
3610
+ function Ti() {
3611
+ return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? Oi();
3429
3612
  }
3430
- async function hi(e) {
3431
- let t = mi();
3613
+ async function Ei(e) {
3614
+ let t = Ti();
3432
3615
  if (!t) return !1;
3433
- if (!e) return gi() < ui ? (console.warn("[ikon] Waiting for the signed-in session before continuing the authorization that sent you here."), !1) : (Q(), console.warn("[ikon] Gave up continuing the authorization that sent you here: no signed-in session became readable. Start the connection again from the application."), !1);
3616
+ if (!e) return Di() < xi ? (console.warn("[ikon] Waiting for the signed-in session before continuing the authorization that sent you here."), !1) : (Ai(), console.warn("[ikon] Gave up continuing the authorization that sent you here: no signed-in session became readable. Start the connection again from the application."), !1);
3434
3617
  try {
3435
3618
  let n = await fetch("/ikon/oauth/continue", {
3436
3619
  method: "POST",
@@ -3440,62 +3623,62 @@ async function hi(e) {
3440
3623
  },
3441
3624
  body: JSON.stringify({ continueId: t })
3442
3625
  });
3443
- if (!n.ok) return Q(), console.warn(`[ikon] Could not continue the authorization that sent you here (${n.status}). Start the connection again from the application.`), !1;
3626
+ if (!n.ok) return Ai(), console.warn(`[ikon] Could not continue the authorization that sent you here (${n.status}). Start the connection again from the application.`), !1;
3444
3627
  let { consentUrl: r } = await n.json();
3445
- return r ? (Q(), window.location.href = r, !0) : (Q(), console.warn("[ikon] The authorization that sent you here returned no consent step. Start the connection again from the application."), !1);
3628
+ return r ? (Ai(), window.location.href = r, !0) : (Ai(), console.warn("[ikon] The authorization that sent you here returned no consent step. Start the connection again from the application."), !1);
3446
3629
  } catch {
3447
3630
  return !1;
3448
3631
  }
3449
3632
  }
3450
- function gi() {
3633
+ function Di() {
3451
3634
  try {
3452
- let e = Number(sessionStorage.getItem(li) ?? "0") + 1;
3453
- return sessionStorage.setItem(li, String(e)), e;
3635
+ let e = Number(sessionStorage.getItem(bi) ?? "0") + 1;
3636
+ return sessionStorage.setItem(bi, String(e)), e;
3454
3637
  } catch {
3455
- return ui;
3638
+ return xi;
3456
3639
  }
3457
3640
  }
3458
- function _i() {
3641
+ function Oi() {
3459
3642
  try {
3460
- let e = sessionStorage.getItem(ci);
3643
+ let e = sessionStorage.getItem(yi);
3461
3644
  if (!e) return null;
3462
3645
  let { id: t, at: n } = JSON.parse(e);
3463
- return !t || typeof n != "number" || Date.now() - n > di ? (Q(), null) : t;
3646
+ return !t || typeof n != "number" || Date.now() - n > Si ? (Ai(), null) : t;
3464
3647
  } catch {
3465
- return Q(), null;
3648
+ return Ai(), null;
3466
3649
  }
3467
3650
  }
3468
- function vi(e) {
3651
+ function ki(e) {
3469
3652
  try {
3470
- sessionStorage.setItem(ci, JSON.stringify({
3653
+ sessionStorage.setItem(yi, JSON.stringify({
3471
3654
  id: e,
3472
3655
  at: Date.now()
3473
3656
  }));
3474
3657
  } catch {}
3475
3658
  }
3476
- function Q() {
3659
+ function Ai() {
3477
3660
  try {
3478
- sessionStorage.removeItem(ci), sessionStorage.removeItem(li);
3661
+ sessionStorage.removeItem(yi), sessionStorage.removeItem(bi);
3479
3662
  } catch {}
3480
3663
  try {
3481
3664
  let e = new URL(window.location.href);
3482
- e.searchParams.has("ikon-oauth") && (e.searchParams.delete(si), window.history.replaceState(null, "", e.toString()));
3665
+ e.searchParams.has("ikon-oauth") && (e.searchParams.delete(vi), window.history.replaceState(null, "", e.toString()));
3483
3666
  } catch {}
3484
3667
  }
3485
3668
  //#endregion
3486
3669
  //#region src/auth/use-auth-guard.ts
3487
- function yi(e) {
3488
- let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } = ai(), o = j(!1), s = j(!1), c = N(he, C, C), l = c.required;
3670
+ function ji(e) {
3671
+ let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } = gi(), o = j(!1), s = j(!1), c = N(he, C, C), l = c.required;
3489
3672
  k(() => {
3490
- fi() && pe("An application is asking to act as you. Sign in to review what it wants.");
3673
+ Ci() && pe("An application is asking to act as you. Sign in to review what it wants.");
3491
3674
  }, []), k(() => {
3492
3675
  if (!(!l || !r.isAuthenticated || !r.user || r.user.provider === "anonymous")) {
3493
- if (!pi()) {
3676
+ if (!wi()) {
3494
3677
  y();
3495
3678
  return;
3496
3679
  }
3497
- s.current || (s.current = !0, hi(a()).then((e) => {
3498
- (e || !pi()) && y();
3680
+ s.current || (s.current = !0, Ei(a()).then((e) => {
3681
+ (e || !wi()) && y();
3499
3682
  }).finally(() => {
3500
3683
  s.current = !1;
3501
3684
  }));
@@ -3510,7 +3693,7 @@ function yi(e) {
3510
3693
  let e = t.methods.includes("global") ? "global" : t.methods.includes("guest") ? "guest" : null;
3511
3694
  if (!e) return;
3512
3695
  let a = new URLSearchParams(window.location.search), s = a.get(n);
3513
- if (s === "true" || s === "1" || s === "" || jr()) {
3696
+ if (s === "true" || s === "1" || s === "" || Br()) {
3514
3697
  a.delete(n);
3515
3698
  let t = a.toString(), r = window.location.pathname + (t ? `?${t}` : "");
3516
3699
  window.history.replaceState({}, "", r), o.current = !0, i(e);
@@ -3535,17 +3718,17 @@ function yi(e) {
3535
3718
  }
3536
3719
  //#endregion
3537
3720
  //#region src/debug/debug-overlay.tsx
3538
- var bi = (() => {
3721
+ var Mi = (() => {
3539
3722
  try {
3540
3723
  return re();
3541
3724
  } catch {
3542
3725
  return !1;
3543
3726
  }
3544
- })(), xi = Date.now(), $ = [], Si = 300;
3545
- function Ci(e) {
3546
- $.push(`[+${((Date.now() - xi) / 1e3).toFixed(1)}s] ${e}`), $.length > Si && $.shift();
3727
+ })(), Ni = Date.now(), $ = [], Pi = 300;
3728
+ function Fi(e) {
3729
+ $.push(`[+${((Date.now() - Ni) / 1e3).toFixed(1)}s] ${e}`), $.length > Pi && $.shift();
3547
3730
  }
3548
- function wi(e) {
3731
+ function Ii(e) {
3549
3732
  if (typeof e == "string") return e;
3550
3733
  if (e instanceof Error) return `${e.name}: ${e.message}`;
3551
3734
  try {
@@ -3554,10 +3737,10 @@ function wi(e) {
3554
3737
  return String(e);
3555
3738
  }
3556
3739
  }
3557
- var Ti = !1;
3558
- function Ei() {
3559
- if (Ti || typeof window > "u") return;
3560
- Ti = !0, window.addEventListener("error", (e) => Ci(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Ci(`unhandledRejection: ${wi(e.reason)}`));
3740
+ var Li = !1;
3741
+ function Ri() {
3742
+ if (Li || typeof window > "u") return;
3743
+ Li = !0, window.addEventListener("error", (e) => Fi(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Fi(`unhandledRejection: ${Ii(e.reason)}`));
3561
3744
  let e = console;
3562
3745
  for (let t of [
3563
3746
  "error",
@@ -3568,17 +3751,17 @@ function Ei() {
3568
3751
  let n = e[t]?.bind(console) ?? (() => void 0);
3569
3752
  e[t] = (...e) => {
3570
3753
  try {
3571
- Ci(`console.${t}: ${e.map(wi).join(" ")}`);
3754
+ Fi(`console.${t}: ${e.map(Ii).join(" ")}`);
3572
3755
  } catch {}
3573
3756
  n(...e);
3574
3757
  };
3575
3758
  }
3576
3759
  try {
3577
- ge((e) => Ci(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: d.DEBUG });
3760
+ ge((e) => Fi(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: d.DEBUG });
3578
3761
  } catch {}
3579
3762
  }
3580
- bi && Ei();
3581
- function Di() {
3763
+ Mi && Ri();
3764
+ function zi() {
3582
3765
  let e = !1;
3583
3766
  try {
3584
3767
  let t = URL.createObjectURL(new Blob([""]));
@@ -3588,11 +3771,11 @@ function Di() {
3588
3771
  } catch {}
3589
3772
  return e;
3590
3773
  }
3591
- function Oi() {
3774
+ function Bi() {
3592
3775
  let e = globalThis;
3593
3776
  return [
3594
3777
  `Worker=${typeof Worker < "u"}`,
3595
- `moduleWorker=${Di()}`,
3778
+ `moduleWorker=${zi()}`,
3596
3779
  `WebSocket=${typeof WebSocket < "u"}`,
3597
3780
  `WebTransport=${e.WebTransport !== void 0}`,
3598
3781
  `RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
@@ -3605,14 +3788,14 @@ function Oi() {
3605
3788
  `online=${typeof navigator < "u" ? navigator.onLine : "?"}`
3606
3789
  ].join(" ");
3607
3790
  }
3608
- function ki(e) {
3791
+ function Vi(e) {
3609
3792
  return /ERROR|error:|Rejection/.test(e) ? "#f88" : /WARN|warn:/.test(e) ? "#fc6" : "#9d9";
3610
3793
  }
3611
- function Ai({ state: e = "", forceVisible: t = !1 }) {
3612
- let n = bi || t, r = e === "connected" || e === "reconnecting", [, i] = Se((e) => e + 1, 0), [a, o] = M(!0);
3794
+ function Hi({ state: e = "", forceVisible: t = !1 }) {
3795
+ let n = Mi || t, r = e === "connected" || e === "reconnecting", [, i] = Se((e) => e + 1, 0), [a, o] = M(!0);
3613
3796
  return k(() => {
3614
3797
  if (!n) return;
3615
- Ei();
3798
+ Ri();
3616
3799
  let e = setInterval(i, 1e3);
3617
3800
  return () => clearInterval(e);
3618
3801
  }, [n]), n ? r && a ? /* @__PURE__ */ I("button", {
@@ -3666,7 +3849,7 @@ function Ai({ state: e = "", forceVisible: t = !1 }) {
3666
3849
  "Ikon debug overlay — state: ",
3667
3850
  e || "?",
3668
3851
  ", +",
3669
- Math.round((Date.now() - xi) / 1e3),
3852
+ Math.round((Date.now() - Ni) / 1e3),
3670
3853
  "s, ",
3671
3854
  $.length,
3672
3855
  " entries",
@@ -3707,7 +3890,7 @@ function Ai({ state: e = "", forceVisible: t = !1 }) {
3707
3890
  color: "#8cf",
3708
3891
  marginBottom: "4px"
3709
3892
  },
3710
- children: Oi()
3893
+ children: Bi()
3711
3894
  }),
3712
3895
  /* @__PURE__ */ F("div", {
3713
3896
  style: {
@@ -3718,7 +3901,7 @@ function Ai({ state: e = "", forceVisible: t = !1 }) {
3718
3901
  }),
3719
3902
  /* @__PURE__ */ F("div", { children: $.length === 0 ? "(nothing captured yet)" : $.map((e, t) => /* @__PURE__ */ F("div", {
3720
3903
  style: {
3721
- color: ki(e),
3904
+ color: Vi(e),
3722
3905
  wordBreak: "break-all"
3723
3906
  },
3724
3907
  children: e
@@ -3728,7 +3911,7 @@ function Ai({ state: e = "", forceVisible: t = !1 }) {
3728
3911
  }
3729
3912
  //#endregion
3730
3913
  //#region src/app/connection-state-renderer.tsx
3731
- function ji({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, stores: i, registry: a, client: o, onAction: s, renderIdle: c, renderConnecting: l, renderConnectingSlow: u, renderConnected: d, renderOffline: f, renderError: p }) {
3914
+ function Ui({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, stores: i, registry: a, client: o, onAction: s, renderIdle: c, renderConnecting: l, renderConnectingSlow: u, renderConnected: d, renderOffline: f, renderError: p }) {
3732
3915
  let m = j(!1), h = (() => {
3733
3916
  switch (e) {
3734
3917
  case "waitingForExternalConnectUrl":
@@ -3754,30 +3937,30 @@ function ji({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, sto
3754
3937
  default: return null;
3755
3938
  }
3756
3939
  })();
3757
- return /* @__PURE__ */ I(P, { children: [h, /* @__PURE__ */ F(Ai, { state: e })] });
3940
+ return /* @__PURE__ */ I(P, { children: [h, /* @__PURE__ */ F(Hi, { state: e })] });
3758
3941
  }
3759
3942
  //#endregion
3760
3943
  //#region src/app/boot-snapshot-variant.ts
3761
- function Mi(e, t) {
3944
+ function Wi(e, t) {
3762
3945
  return e === !1 ? !1 : t ? "signed-in" : "guest";
3763
3946
  }
3764
3947
  //#endregion
3765
3948
  //#region src/app/use-ikon-app.ts
3766
- var Ni = b("useIkonApp");
3767
- function Pi() {
3949
+ var Gi = b("useIkonApp");
3950
+ function Ki() {
3768
3951
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__) return window.__IKON_AUTH_CONFIG__;
3769
3952
  }
3770
- function Fi() {
3953
+ function qi() {
3771
3954
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__) return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
3772
3955
  }
3773
- function Ii(e, t) {
3956
+ function Ji(e, t) {
3774
3957
  return {
3775
3958
  ...e,
3776
3959
  ...t ?? {}
3777
3960
  };
3778
3961
  }
3779
- function Li(e) {
3780
- let { authConfig: n, modules: r, parameters: l, timeouts: d, backgroundAudio: f, webRtc: _, audio: v, video: y, websocket: b, webtransport: x, proxy: te, liveSnapshot: re, bootSnapshot: ie } = e, C = n === void 0 ? Pi() ?? null : n, ae = Fi(), w = oi(), se = !!w && w.state.isLoading, T = j(null), ce = j(null), E = j(null), ue = j(!1), fe = j(!1), pe = j(f), me = j(d), he = j(_), ge = j(v), _e = j(y), ve = j(b), ye = j(x), D = j(te), be = j(re), xe = j(ie), Se = j("local"), N = j(void 0);
3962
+ function Yi(e) {
3963
+ let { authConfig: n, modules: r, parameters: l, timeouts: d, backgroundAudio: f, webRtc: _, audio: v, video: y, websocket: b, webtransport: x, proxy: te, liveSnapshot: re, bootSnapshot: ie } = e, C = n === void 0 ? Ki() ?? null : n, ae = qi(), w = _i(), se = !!w && w.state.isLoading, T = j(null), ce = j(null), E = j(null), ue = j(!1), fe = j(!1), pe = j(f), me = j(d), he = j(_), ge = j(v), _e = j(y), ve = j(b), ye = j(x), D = j(te), be = j(re), xe = j(ie), Se = j("local"), N = j(void 0);
3781
3964
  pe.current = f, me.current = d, he.current = _, ge.current = v, _e.current = y, ve.current = b, ye.current = x, D.current = te, be.current = re, xe.current = ie;
3782
3965
  let [P, F] = M("connecting"), [I, Ce] = M(!1), [L, we] = M(!1), [Te, Ee] = M(null), [De, Oe] = M(null), [ke, Ae] = M(!1), [je, Me] = M(!1), [Ne, Pe] = M(!1), [Fe, Ie] = M(null), [R, Le] = M(null), [Re, ze] = M(!1), Be = j(!1), [Ve, He] = M(0), z = A(() => {
3783
3966
  try {
@@ -3785,7 +3968,7 @@ function Li(e) {
3785
3968
  } catch {
3786
3969
  return { parameters: {} };
3787
3970
  }
3788
- }, []), We = JSON.stringify(l ?? {}), B = A(() => Ii(z.parameters, l), [z.parameters, We]), Ge = (C?.methods?.length ?? 0) > 0, Ke = Mi(ie, Ge && mr());
3971
+ }, []), We = JSON.stringify(l ?? {}), B = A(() => Ji(z.parameters, l), [z.parameters, We]), Ge = (C?.methods?.length ?? 0) > 0, Ke = Wi(ie, Ge && Cr());
3789
3972
  Ke !== !1 && !i() && a(Ke);
3790
3973
  let V = A(() => {
3791
3974
  if (!C?.spaceId) return null;
@@ -3794,27 +3977,27 @@ function Li(e) {
3794
3977
  token: e.token,
3795
3978
  provider: e.provider,
3796
3979
  authenticatedAt: e.authenticatedAt
3797
- } : cr();
3980
+ } : gr();
3798
3981
  }, [
3799
3982
  C?.spaceId,
3800
3983
  Ve,
3801
3984
  w?.state.isLoading,
3802
3985
  w?.state.isAuthenticated,
3803
3986
  w?.state.user?.token
3804
- ]), qe = ae?.enabled ?? !1, Je = ae?.host ?? "localhost", Ye = ae?.port ?? 8443, Xe = !se && !!C && !V && !C.requireSignIn && !!C.spaceId && (oe() || qe);
3805
- Xe && !R && !Re && !Be.current && (Be.current = !0, S(C.authUrl).then((e) => Cr(C.spaceId, e)).then((e) => {
3987
+ ]), qe = ae?.enabled ?? !1, Je = ae?.host ?? "localhost", H = ae?.port ?? 8443, Ye = !se && !!C && !V && !C.requireSignIn && !!C.spaceId && (oe() || qe);
3988
+ Ye && !R && !Re && !Be.current && (Be.current = !0, S(C.authUrl).then((e) => Mr(C.spaceId, e)).then((e) => {
3806
3989
  Le(e.token), ze(!0);
3807
3990
  }).catch((e) => {
3808
- Ni.error("Anonymous auth failed:", e), Be.current = !1, qe ? ze(!0) : Ee(e instanceof Error ? e.message : "Anonymous auth failed");
3991
+ Gi.error("Anonymous auth failed:", e), Be.current = !1, qe ? ze(!0) : Ee(e instanceof Error ? e.message : "Anonymous auth failed");
3809
3992
  }));
3810
- let Ze = A(() => {
3993
+ let Xe = A(() => {
3811
3994
  if (se) return null;
3812
3995
  if (qe) {
3813
- if (Xe && !Re) return null;
3996
+ if (Ye && !Re) return null;
3814
3997
  let e = V?.token ?? R ?? void 0, t = e ? ne(e) ?? void 0 : void 0;
3815
3998
  return { local: {
3816
3999
  host: Je,
3817
- httpsPort: Ye,
4000
+ httpsPort: H,
3818
4001
  userId: t,
3819
4002
  token: V?.token ?? void 0,
3820
4003
  identityToken: e,
@@ -3838,7 +4021,7 @@ function Li(e) {
3838
4021
  parameters: B
3839
4022
  } } : oe() ? null : { local: {
3840
4023
  host: Je,
3841
- httpsPort: Ye,
4024
+ httpsPort: H,
3842
4025
  spaceId: C?.spaceId,
3843
4026
  backendUrl: C?.backendUrl,
3844
4027
  authUrl: C?.authUrl,
@@ -3848,30 +4031,30 @@ function Li(e) {
3848
4031
  se,
3849
4032
  qe,
3850
4033
  Je,
3851
- Ye,
4034
+ H,
3852
4035
  V?.token,
3853
4036
  C?.spaceId,
3854
4037
  C?.backendUrl,
3855
4038
  C?.authUrl,
3856
4039
  R,
3857
- Xe,
4040
+ Ye,
3858
4041
  Re,
3859
4042
  z.sessionIdentityHash,
3860
4043
  B
3861
4044
  ]);
3862
4045
  Se.current = C?.spaceId ?? "local", N.current = V?.token ?? R ?? void 0, gn(Fe);
3863
- let Qe = vn(Fe);
4046
+ let Ze = vn(Fe);
3864
4047
  k(() => {
3865
4048
  if (!ue.current) {
3866
4049
  if (ue.current = !0, E.current = tn(), r) for (let e of r) e(E.current);
3867
4050
  E.current.loadRegisteredModules().catch((e) => {
3868
- Ni.error("Failed to load UI modules", e);
4051
+ Gi.error("Failed to load UI modules", e);
3869
4052
  });
3870
4053
  }
3871
4054
  }, []), k(() => {
3872
- if (!Ze) return;
4055
+ if (!Xe) return;
3873
4056
  let e = new u({
3874
- ...Ze,
4057
+ ...Xe,
3875
4058
  timeouts: me.current,
3876
4059
  audio: ge.current !== void 0 || pe.current ? {
3877
4060
  enabled: ge.current,
@@ -3901,17 +4084,17 @@ function Li(e) {
3901
4084
  enabled: !0,
3902
4085
  appId: Se.current,
3903
4086
  userId: i
3904
- } : void 0, l = V != null && V.provider !== "anonymous", d = Ge && (l || mr()), f = new Ue({
4087
+ } : void 0, l = V != null && V.provider !== "anonymous", d = Ge && (l || Cr()), f = new Ue({
3905
4088
  client: e,
3906
4089
  liveSnapshot: a,
3907
- bootSnapshot: Mi(xe.current, d)
4090
+ bootSnapshot: Wi(xe.current, d)
3908
4091
  });
3909
4092
  ce.current = f, Ie(f), we(!1);
3910
4093
  let _ = f.subscribeToUiUpdates(() => {
3911
4094
  we(!0), de();
3912
4095
  });
3913
4096
  return e.connect().catch((e) => {
3914
- if (Ni.error("Connection failed:", e), e instanceof o) {
4097
+ if (Gi.error("Connection failed:", e), e instanceof o) {
3915
4098
  Oe(e.reason);
3916
4099
  return;
3917
4100
  }
@@ -3928,13 +4111,13 @@ function Li(e) {
3928
4111
  Pe(!0);
3929
4112
  return;
3930
4113
  }
3931
- e instanceof p || e instanceof c && !fe.current && (fe.current = !0, Ni.warn("Auth session appears stale, clearing and retrying"), t.clearAll(), w ? w.logout() : (hr(), He((e) => e + 1)));
4114
+ e instanceof p || e instanceof c && !fe.current && (fe.current = !0, Gi.warn("Auth session appears stale, clearing and retrying"), t.clearAll(), w ? w.logout() : (wr(), He((e) => e + 1)));
3932
4115
  }
3933
4116
  }), () => {
3934
4117
  _(), e.disconnect(), T.current = null, f.dispose(), ce.current = null;
3935
4118
  };
3936
- }, [Ze]);
3937
- let $e = O((e, t) => {
4119
+ }, [Xe]);
4120
+ let Qe = O((e, t) => {
3938
4121
  let n = typeof t == "string" ? t : JSON.stringify(t ?? {});
3939
4122
  T.current?.sendActionCall(e, n);
3940
4123
  }, []);
@@ -3946,25 +4129,25 @@ function Li(e) {
3946
4129
  let e = T.current?.slowConnectionThresholdMs ?? 5e3, t = setTimeout(() => Ce(!0), e);
3947
4130
  return () => clearTimeout(t);
3948
4131
  }, [P]);
3949
- let et = P === "connected" || P === "reconnecting", H = L && P !== "offline";
4132
+ let $e = P === "connected" || P === "reconnecting", U = L && P !== "offline";
3950
4133
  return k(() => {
3951
- typeof document > "u" || (document.documentElement.dataset.ikonLive = String(H));
3952
- }, [H]), {
4134
+ typeof document > "u" || (document.documentElement.dataset.ikonLive = String(U));
4135
+ }, [U]), {
3953
4136
  connectionState: P,
3954
4137
  error: Te,
3955
4138
  accessDeniedReason: De,
3956
4139
  isServerFull: ke,
3957
4140
  isSessionExpired: je,
3958
4141
  isStartupFailed: Ne,
3959
- stores: Qe,
4142
+ stores: Ze,
3960
4143
  client: T.current,
3961
4144
  registry: E.current,
3962
4145
  clientRef: T,
3963
4146
  uiRef: ce,
3964
4147
  registryRef: E,
3965
- onAction: $e,
3966
- isReady: et,
3967
- isLive: H,
4148
+ onAction: Qe,
4149
+ isReady: $e,
4150
+ isLive: U,
3968
4151
  brandingRequired: T.current?.brandingRequired ?? !1,
3969
4152
  isConnectingSlow: I,
3970
4153
  webRtcVideoStreams: T.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
@@ -3973,8 +4156,8 @@ function Li(e) {
3973
4156
  }
3974
4157
  //#endregion
3975
4158
  //#region src/hooks/use-toasts.ts
3976
- var Ri = 0;
3977
- function zi(e = 5, t = 5e3) {
4159
+ var Xi = 0;
4160
+ function Zi(e = 5, t = 5e3) {
3978
4161
  let [n, r] = M([]), i = j(/* @__PURE__ */ new Map()), a = O((e) => {
3979
4162
  let t = i.current.get(e);
3980
4163
  t && (clearTimeout(t), i.current.delete(e)), r((t) => t.filter((t) => t.id !== e));
@@ -3982,7 +4165,7 @@ function zi(e = 5, t = 5e3) {
3982
4165
  return k(() => {
3983
4166
  let n = i.current, o = ge((i) => {
3984
4167
  if (!se()) return;
3985
- let o = `toast-${++Ri}`, s = {
4168
+ let o = `toast-${++Xi}`, s = {
3986
4169
  id: o,
3987
4170
  level: i.level === d.ERROR ? "error" : "warn",
3988
4171
  message: i.message,
@@ -4010,7 +4193,7 @@ function zi(e = 5, t = 5e3) {
4010
4193
  }
4011
4194
  //#endregion
4012
4195
  //#region src/hooks/use-ikon-reactive.ts
4013
- function Bi(e, t, n) {
4196
+ function Qi(e, t, n) {
4014
4197
  let [r, i] = M(n);
4015
4198
  return k(() => {
4016
4199
  if (!e) return;
@@ -4028,7 +4211,7 @@ function Bi(e, t, n) {
4028
4211
  }
4029
4212
  //#endregion
4030
4213
  //#region src/hooks/use-reactive.ts
4031
- function Vi(e, t, n) {
4214
+ function $i(e, t, n) {
4032
4215
  let [r, i] = M(null);
4033
4216
  return k(() => {
4034
4217
  if (!e) return;
@@ -4040,48 +4223,48 @@ function Vi(e, t, n) {
4040
4223
  }), () => {
4041
4224
  n = !1;
4042
4225
  };
4043
- }, [e, t]), Bi(r ? e : null, r ?? "", n);
4226
+ }, [e, t]), Qi(r ? e : null, r ?? "", n);
4044
4227
  }
4045
4228
  //#endregion
4046
4229
  //#region src/app/use-ikon-debug.ts
4047
- var Hi = b("IkonDebug"), Ui = {
4230
+ var ea = b("IkonDebug"), ta = {
4048
4231
  Digit1: "connecting",
4049
4232
  Digit2: "connected",
4050
4233
  Digit3: "reconnecting",
4051
4234
  Digit4: "offline",
4052
4235
  Digit5: "offline",
4053
4236
  Digit0: "clear"
4054
- }, Wi = "Digit5", Gi = "Digit6", Ki = "Synthetic debug error (Ctrl+Shift+5)", qi = "Synthetic debug access-denied (Ctrl+Shift+6)", Ji = 5e3;
4055
- function Yi(e) {
4237
+ }, na = "Digit5", ra = "Digit6", ia = "Synthetic debug error (Ctrl+Shift+5)", aa = "Synthetic debug access-denied (Ctrl+Shift+6)", oa = 5e3;
4238
+ function sa(e) {
4056
4239
  let t = se(), [n, r] = M(null), [i, a] = M(!1), [o, s] = M(null), [c, l] = M(null), [u, d] = M(!1), [f, p] = M(!1), [m, h] = M(!1);
4057
4240
  return k(() => {
4058
4241
  if (!t) return;
4059
4242
  let e = (e) => {
4060
4243
  if (!e.ctrlKey || !e.shiftKey) return;
4061
4244
  if (e.code === "KeyE") {
4062
- e.preventDefault(), d((e) => (Hi.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
4245
+ e.preventDefault(), d((e) => (ea.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
4063
4246
  return;
4064
4247
  }
4065
4248
  if (e.code === "Digit7") {
4066
- e.preventDefault(), p((e) => (Hi.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
4249
+ e.preventDefault(), p((e) => (ea.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
4067
4250
  return;
4068
4251
  }
4069
4252
  if (e.code === "Digit8") {
4070
- e.preventDefault(), h((e) => (Hi.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
4253
+ e.preventDefault(), h((e) => (ea.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
4071
4254
  return;
4072
4255
  }
4073
- if (e.code === Gi) {
4074
- e.preventDefault(), l(qi), r(null), s(null), Hi.warn("Forced access denied");
4256
+ if (e.code === ra) {
4257
+ e.preventDefault(), l(aa), r(null), s(null), ea.warn("Forced access denied");
4075
4258
  return;
4076
4259
  }
4077
- let t = Ui[e.code];
4260
+ let t = ta[e.code];
4078
4261
  if (t === void 0) return;
4079
4262
  if (e.preventDefault(), t === "clear") {
4080
- r(null), s(null), l(null), Hi.warn("Cleared forced state");
4263
+ r(null), s(null), l(null), ea.warn("Cleared forced state");
4081
4264
  return;
4082
4265
  }
4083
- let n = e.code === Wi;
4084
- r(t), s(n ? Ki : null), l(null), Hi.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
4266
+ let n = e.code === na;
4267
+ r(t), s(n ? ia : null), l(null), ea.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
4085
4268
  };
4086
4269
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
4087
4270
  }, [t]), k(() => {
@@ -4089,7 +4272,7 @@ function Yi(e) {
4089
4272
  a(!1);
4090
4273
  return;
4091
4274
  }
4092
- let e = setTimeout(() => a(!0), Ji);
4275
+ let e = setTimeout(() => a(!0), oa);
4093
4276
  return () => clearTimeout(e);
4094
4277
  }, [n]), !t || n === null && !u && c === null && !f && !m ? {
4095
4278
  app: e,
@@ -4120,20 +4303,20 @@ function Yi(e) {
4120
4303
  }
4121
4304
  //#endregion
4122
4305
  //#region src/app/ikon-app.tsx
4123
- function Xi(e, t) {
4306
+ function ca(e, t) {
4124
4307
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4125
4308
  }
4126
- function Zi(e) {
4309
+ function la(e) {
4127
4310
  return e === void 0 ? null : typeof e == "function" ? e() : e;
4128
4311
  }
4129
- function Qi(e, t) {
4312
+ function ua(e, t) {
4130
4313
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4131
4314
  }
4132
- function $i(e, t) {
4315
+ function da(e, t) {
4133
4316
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4134
4317
  }
4135
- function ea(e) {
4136
- let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o = Yi(a), { app: s } = o, { connectionState: c, isConnectingSlow: l, stores: u, registry: d, client: f, onAction: p, isReady: m, error: h, accessDeniedReason: g, brandingRequired: _ } = s, v = _ || o.forcedBranding, y = j(null);
4318
+ function fa(e) {
4319
+ let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o = sa(a), { app: s } = o, { connectionState: c, isConnectingSlow: l, stores: u, registry: d, client: f, onAction: p, isReady: m, error: h, accessDeniedReason: g, brandingRequired: _ } = s, v = _ || o.forcedBranding, y = j(null);
4137
4320
  u && d && (m || u.size > 0) && (y.current = {
4138
4321
  stores: u,
4139
4322
  registry: d,
@@ -4142,18 +4325,18 @@ function ea(e) {
4142
4325
  let b = y.current != null || !!g;
4143
4326
  if (xe(() => {
4144
4327
  !b || typeof document > "u" || document.querySelectorAll("[data-ikon-prerender]").forEach((e) => e.remove());
4145
- }, [b]), g) return $i(i, g);
4328
+ }, [b]), g) return da(i, g);
4146
4329
  let x = y.current, S;
4147
4330
  switch (c) {
4148
4331
  case "waitingForExternalConnectUrl":
4149
4332
  case "connecting":
4150
- S = Xi(t, l);
4333
+ S = ca(t, l);
4151
4334
  break;
4152
4335
  case "reconnecting":
4153
- S = Zi(n);
4336
+ S = la(n);
4154
4337
  break;
4155
4338
  case "offline":
4156
- S = Qi(r, h);
4339
+ S = ua(r, h);
4157
4340
  break;
4158
4341
  default: S = null;
4159
4342
  }
@@ -4165,19 +4348,19 @@ function ea(e) {
4165
4348
  onAction: p
4166
4349
  }),
4167
4350
  S,
4168
- v && /* @__PURE__ */ F(na, {}),
4169
- /* @__PURE__ */ F(ra, {}),
4170
- /* @__PURE__ */ F(Ai, {
4351
+ v && /* @__PURE__ */ F(ma, {}),
4352
+ /* @__PURE__ */ F(ha, {}),
4353
+ /* @__PURE__ */ F(Hi, {
4171
4354
  state: c,
4172
4355
  forceVisible: o.forcedDebugOverlay
4173
4356
  })
4174
4357
  ] });
4175
4358
  }
4176
- var ta = "https://ikonai.com";
4177
- function na() {
4359
+ var pa = "https://ikonai.com";
4360
+ function ma() {
4178
4361
  return /* @__PURE__ */ I("a", {
4179
4362
  className: "ikon-branding-banner",
4180
- href: ta,
4363
+ href: pa,
4181
4364
  target: "_blank",
4182
4365
  rel: "noopener noreferrer",
4183
4366
  style: {
@@ -4207,17 +4390,17 @@ function na() {
4207
4390
  })]
4208
4391
  });
4209
4392
  }
4210
- function ra() {
4211
- let { toasts: e, dismissToast: t } = zi();
4393
+ function ha() {
4394
+ let { toasts: e, dismissToast: t } = Zi();
4212
4395
  return e.length === 0 ? null : /* @__PURE__ */ F("div", {
4213
4396
  className: "ikon-toast-overlay",
4214
- children: e.map((e) => /* @__PURE__ */ F(ia, {
4397
+ children: e.map((e) => /* @__PURE__ */ F(ga, {
4215
4398
  toast: e,
4216
4399
  onDismiss: t
4217
4400
  }, e.id))
4218
4401
  });
4219
4402
  }
4220
- function ia({ toast: e, onDismiss: t }) {
4403
+ function ga({ toast: e, onDismiss: t }) {
4221
4404
  return /* @__PURE__ */ I("div", {
4222
4405
  className: `ikon-toast-overlay-chip ikon-toast-overlay-chip--${e.level}`,
4223
4406
  onClick: () => t(e.id),
@@ -4243,37 +4426,37 @@ function ia({ toast: e, onDismiss: t }) {
4243
4426
  }
4244
4427
  //#endregion
4245
4428
  //#region src/i18n/i18n.tsx
4246
- var aa = ye(null);
4247
- function oa(e, t) {
4429
+ var _a = ye(null);
4430
+ function va(e, t) {
4248
4431
  return t ? e.replace(/\{(\w+)\}/g, (e, n) => t[n] ?? `{${n}}`) : e;
4249
4432
  }
4250
- function sa(e, t) {
4433
+ function ya(e, t) {
4251
4434
  let n = ie();
4252
4435
  if (n && e.includes(n)) return n;
4253
4436
  let r = navigator.language.split("-")[0];
4254
4437
  return e.includes(r) ? r : t && e.includes(t) ? t : "en";
4255
4438
  }
4256
- function ca(e, t, n) {
4257
- return t ? sa(e, n) : n && e.includes(n) ? n : "en";
4439
+ function ba(e, t, n) {
4440
+ return t ? ya(e, n) : n && e.includes(n) ? n : "en";
4258
4441
  }
4259
- function la({ children: e, translations: t, defaultLanguage: n, detectLanguage: r = !1 }) {
4260
- let i = ca(Object.keys(t), r, n), a = t[i] ?? t.en, o = A(() => ({
4442
+ function xa({ children: e, translations: t, defaultLanguage: n, detectLanguage: r = !1 }) {
4443
+ let i = ba(Object.keys(t), r, n), a = t[i] ?? t.en, o = A(() => ({
4261
4444
  t: (e, t) => {
4262
4445
  let n = a[e];
4263
- return oa(n, t);
4446
+ return va(n, t);
4264
4447
  },
4265
4448
  locale: i,
4266
4449
  translations: a
4267
4450
  }), [a, i]);
4268
- return /* @__PURE__ */ F(aa, {
4451
+ return /* @__PURE__ */ F(_a, {
4269
4452
  value: o,
4270
4453
  children: e
4271
4454
  });
4272
4455
  }
4273
- function ua() {
4274
- let e = be(aa);
4456
+ function Sa() {
4457
+ let e = be(_a);
4275
4458
  if (!e) throw Error("useI18n must be used within an I18nProvider");
4276
4459
  return e;
4277
4460
  }
4278
4461
  //#endregion
4279
- export { ii as AuthProvider, ji as ConnectionStateRenderer, bi as DEBUG_OVERLAY_ENABLED, Ai as DebugOverlay, la as I18nProvider, dt as IKON_UI_BASE_MODULE, Mt as IKON_UI_MEDIA_MODULE, Xt as IKON_UI_SHADERTOY_MODULE, Jt as IKON_UI_SHADERTOY_TYPE, Ve as IKON_UI_STREAM_CATEGORY, Et as IKON_UI_VIDEO_CANVAS_TYPE, Dt as IKON_UI_VIDEO_URL_PLAYER_TYPE, ea as IkonApp, Ue as IkonUi, en as IkonUiRegistry, z as IkonUiSurface, ze as InspectOverlay, on as ParallaxView, R as UiComponentRegistry, Ie as UiRenderer, n as UiStreamStore, Cr as authenticateAnonymous, Fr as buildOAuthRedirectUrl, hr as clearAuthSession, Pr as clearOAuthParams, ut as createBaseResolvers, Le as createComponentLibrary, tn as createIkonUiRegistry, kt as createMediaResolvers, Yt as createShadertoyRendererResolver, He as isIkonUiCategoryMatch, cr as loadAuthSession, ft as loadBaseModule, Nt as loadMediaModule, Zt as loadShadertoyModule, Er as parseOAuthCallback, Ar as parseOAuthError, ue as randomUuid, pt as registerBaseModule, Pt as registerMediaModule, Qt as registerShadertoyModule, Pe as renderChildren, wn as renderMotionLetters, K as saveAuthSession, wr as sendLoginCode, q as sessionToUser, ai as useAuth, yi as useAuthGuard, oi as useAuthOptional, ua as useI18n, Li as useIkonApp, Yi as useIkonDebug, Bi as useIkonReactive, gn as useIkonStyles, vn as useIkonUiStores, Vi as useReactive, zi as useToasts, L as useUiNode, Re as useUiStore, Tr as verifyLoginCode };
4462
+ export { hi as AuthProvider, Ui as ConnectionStateRenderer, Mi as DEBUG_OVERLAY_ENABLED, Hi as DebugOverlay, xa as I18nProvider, ft as IKON_UI_BASE_MODULE, Mt as IKON_UI_MEDIA_MODULE, Xt as IKON_UI_SHADERTOY_MODULE, Jt as IKON_UI_SHADERTOY_TYPE, Ve as IKON_UI_STREAM_CATEGORY, Et as IKON_UI_VIDEO_CANVAS_TYPE, Dt as IKON_UI_VIDEO_URL_PLAYER_TYPE, fa as IkonApp, Ue as IkonUi, en as IkonUiRegistry, z as IkonUiSurface, ze as InspectOverlay, on as ParallaxView, R as UiComponentRegistry, Ie as UiRenderer, n as UiStreamStore, xt as VideoStreamView, Mr as authenticateAnonymous, Wr as buildOAuthRedirectUrl, wr as clearAuthSession, Ur as clearOAuthParams, dt as createBaseResolvers, Le as createComponentLibrary, tn as createIkonUiRegistry, kt as createMediaResolvers, Yt as createShadertoyRendererResolver, He as isIkonUiCategoryMatch, gr as loadAuthSession, pt as loadBaseModule, Nt as loadMediaModule, Zt as loadShadertoyModule, Fr as parseOAuthCallback, zr as parseOAuthError, ue as randomUuid, mt as registerBaseModule, Pt as registerMediaModule, Qt as registerShadertoyModule, Pe as renderChildren, An as renderMotionLetters, q as saveAuthSession, Nr as sendLoginCode, J as sessionToUser, gi as useAuth, ji as useAuthGuard, _i as useAuthOptional, Cn as useCameraCapture, Sa as useI18n, Yi as useIkonApp, sa as useIkonDebug, Qi as useIkonReactive, gn as useIkonStyles, vn as useIkonUiStores, Sn as useMicrophoneCapture, $i as useReactive, wn as useScreenCapture, yn as useSiblingClient, Zi as useToasts, L as useUiNode, Re as useUiStore, Pr as verifyLoginCode };