etudes 27.3.0 → 27.4.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/build/etudes.js +732 -728
- package/build/etudes.umd.cjs +6 -6
- package/build/index.d.ts +2 -0
- package/build/utils/measureIntrinsicSize.d.ts +2 -0
- package/build/utils/setStyles.d.ts +21 -0
- package/package.json +1 -1
package/build/etudes.js
CHANGED
|
@@ -5810,220 +5810,224 @@ var $e = /* @__PURE__ */ a(({ children: e, ...n }, r) => (Array.isArray(e) && co
|
|
|
5810
5810
|
})));
|
|
5811
5811
|
process.env.NODE_ENV === "development" && ($e.displayName = "ExtractChild");
|
|
5812
5812
|
//#endregion
|
|
5813
|
+
//#region src/utils/measureIntrinsicSize.ts
|
|
5814
|
+
function et(e, t) {
|
|
5815
|
+
if (typeof window > "u") return G.zero;
|
|
5816
|
+
let n = e.cloneNode(!0);
|
|
5817
|
+
n.style.position = "fixed", n.style.visibility = "hidden", n.style.width = t === void 0 ? "auto" : `${t}px`, n.style.whiteSpace = t === void 0 ? "pre" : "normal";
|
|
5818
|
+
let r = e.parentNode ?? document.body;
|
|
5819
|
+
try {
|
|
5820
|
+
r.insertBefore(n, e.nextSibling);
|
|
5821
|
+
let t = n.getBoundingClientRect();
|
|
5822
|
+
return G.make(t.width, t.height);
|
|
5823
|
+
} finally {
|
|
5824
|
+
n.remove();
|
|
5825
|
+
}
|
|
5826
|
+
}
|
|
5827
|
+
//#endregion
|
|
5828
|
+
//#region src/utils/setStyles.ts
|
|
5829
|
+
function tt(e, { target: t } = {}) {
|
|
5830
|
+
if (typeof window > "u") return;
|
|
5831
|
+
let n = t ?? window.document.documentElement;
|
|
5832
|
+
Object.keys(e).forEach((t) => {
|
|
5833
|
+
n.style[t] = e[t];
|
|
5834
|
+
});
|
|
5835
|
+
}
|
|
5836
|
+
//#endregion
|
|
5813
5837
|
//#region src/hocs/WithTooltip.tsx
|
|
5814
|
-
function
|
|
5815
|
-
let p = d(null), m = d(null), h =
|
|
5816
|
-
let a =
|
|
5817
|
-
|
|
5818
|
-
let s =
|
|
5819
|
-
|
|
5820
|
-
arrowSize: G.make(i, r),
|
|
5821
|
-
fullDialogWidth: c.width,
|
|
5822
|
-
gap: o,
|
|
5823
|
-
maxDialogWidth: u,
|
|
5824
|
-
targetWidth: h.width
|
|
5825
|
-
}), m = P(t, d.dialog);
|
|
5826
|
-
Object.keys(m).forEach((e) => a.style[e] = m[e]);
|
|
5827
|
-
let g = window.document.createElement("span");
|
|
5828
|
-
return Object.keys(d.arrow).forEach((e) => g.style[e] = d.arrow[e]), a.appendChild(g), a;
|
|
5838
|
+
function nt({ className: e = "", style: t, alignment: n, arrowHeight: r = 6, arrowWidth: i = 12, children: a, gap: o = 4, hint: l, maxWidth: u = 200, threshold: f = 100 }) {
|
|
5839
|
+
let p = d(null), m = d(null), h = d(null), g = d(void 0), _ = s(() => {
|
|
5840
|
+
let e = p.current, a = m.current, s = h.current;
|
|
5841
|
+
if (!e || !a || !s) return;
|
|
5842
|
+
let c = K.from(s), l = G.make(i, r), d = et(e, u), g = n ?? it(c, f), _ = at(g, d, l, o, c), v = ot(g, d, l, c);
|
|
5843
|
+
tt(P(t, _), { target: e }), tt(v, { target: a });
|
|
5829
5844
|
}, [
|
|
5830
|
-
e,
|
|
5831
5845
|
n,
|
|
5832
|
-
l,
|
|
5833
5846
|
u,
|
|
5834
|
-
|
|
5835
|
-
h.width,
|
|
5847
|
+
t,
|
|
5836
5848
|
f,
|
|
5837
5849
|
r,
|
|
5838
5850
|
i,
|
|
5839
5851
|
o
|
|
5840
|
-
]),
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5852
|
+
]), v = s(() => {
|
|
5853
|
+
let e = p.current, t = h.current;
|
|
5854
|
+
if (!e || !t) return;
|
|
5855
|
+
let n = new IntersectionObserver((e) => {
|
|
5856
|
+
for (let n of e) if (n.target === t) {
|
|
5857
|
+
_();
|
|
5858
|
+
break;
|
|
5859
|
+
}
|
|
5860
|
+
});
|
|
5861
|
+
n.observe(t), g.current = n, window.addEventListener("resize", _), e.style.opacity = "1", e.ariaHidden = "false", _();
|
|
5862
|
+
}, [_]), y = s(() => {
|
|
5863
|
+
let e = p.current;
|
|
5864
|
+
e && (e.style.opacity = "0", e.ariaHidden = "true", g.current?.disconnect(), g.current = void 0, window.removeEventListener("resize", _));
|
|
5865
|
+
}, [_]);
|
|
5845
5866
|
return c(() => {
|
|
5846
|
-
let
|
|
5847
|
-
return
|
|
5848
|
-
p.current?.
|
|
5867
|
+
let { arrow: t, dialog: n } = rt(e, l);
|
|
5868
|
+
return m.current = t, p.current = n, window.document.body.appendChild(n), y(), () => {
|
|
5869
|
+
window.document.body.removeChild(n), m.current = null, p.current = null, g.current?.disconnect(), g.current = void 0, window.removeEventListener("resize", _);
|
|
5849
5870
|
};
|
|
5850
|
-
}, [
|
|
5851
|
-
ref:
|
|
5852
|
-
onMouseEnter:
|
|
5853
|
-
onMouseLeave:
|
|
5871
|
+
}, [e, l]), /* @__PURE__ */ (0, D.jsx)($e, {
|
|
5872
|
+
ref: h,
|
|
5873
|
+
onMouseEnter: v,
|
|
5874
|
+
onMouseLeave: y,
|
|
5854
5875
|
children: a
|
|
5855
5876
|
});
|
|
5856
5877
|
}
|
|
5857
|
-
function
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5878
|
+
function rt(e, t) {
|
|
5879
|
+
let n = window.document.createElement("span");
|
|
5880
|
+
n.className = e, n.innerHTML = t, n.role = "tooltip", tt({
|
|
5881
|
+
boxSizing: "border-box",
|
|
5882
|
+
height: "auto",
|
|
5883
|
+
margin: "0",
|
|
5884
|
+
pointerEvents: "none",
|
|
5885
|
+
position: "fixed",
|
|
5886
|
+
userSelect: "none",
|
|
5887
|
+
zIndex: 100
|
|
5888
|
+
}, { target: n });
|
|
5889
|
+
let r = window.document.createElement("span");
|
|
5890
|
+
return tt({
|
|
5891
|
+
background: "inherit",
|
|
5892
|
+
position: "absolute"
|
|
5893
|
+
}, { target: r }), n.appendChild(r), {
|
|
5894
|
+
arrow: r,
|
|
5895
|
+
dialog: n
|
|
5896
|
+
};
|
|
5863
5897
|
}
|
|
5864
|
-
function
|
|
5865
|
-
let n = K.fromViewport(), r =
|
|
5866
|
-
return
|
|
5898
|
+
function it(e, t) {
|
|
5899
|
+
let n = K.fromViewport(), r = e.left - n.left < t, i = n.right - e.right < t, a = e.top - n.top < t, o = n.bottom - e.bottom < t;
|
|
5900
|
+
return r && a ? "br" : r && o ? "tr" : i && a ? "bl" : i && o ? "tl" : r ? "cr" : i ? "cl" : "tc";
|
|
5867
5901
|
}
|
|
5868
|
-
function
|
|
5869
|
-
let
|
|
5902
|
+
function at(e, t, n, r, i) {
|
|
5903
|
+
let a = t.width, o = i.width > a, s = i.left + i.width / 2, c = i.top + i.height / 2, l = { width: `${a}px` };
|
|
5870
5904
|
switch (e) {
|
|
5871
5905
|
case "bc": return {
|
|
5872
|
-
|
|
5873
|
-
|
|
5906
|
+
...l,
|
|
5907
|
+
left: `${s}px`,
|
|
5908
|
+
top: `${i.bottom + n.height + r}px`,
|
|
5874
5909
|
transform: "translateX(-50%)"
|
|
5875
5910
|
};
|
|
5876
5911
|
case "bl": return {
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
top:
|
|
5880
|
-
transform:
|
|
5912
|
+
...l,
|
|
5913
|
+
left: o ? `${s}px` : `${i.right}px`,
|
|
5914
|
+
top: `${i.bottom + n.height + r}px`,
|
|
5915
|
+
transform: o ? "translateX(-50%)" : "translateX(-100%)"
|
|
5881
5916
|
};
|
|
5882
5917
|
case "br": return {
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5918
|
+
...l,
|
|
5919
|
+
left: o ? `${s}px` : `${i.left}px`,
|
|
5920
|
+
top: `${i.bottom + n.height + r}px`,
|
|
5921
|
+
transform: o ? "translateX(-50%)" : ""
|
|
5886
5922
|
};
|
|
5887
5923
|
case "cl": return {
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5924
|
+
...l,
|
|
5925
|
+
left: `${i.left - n.height - r}px`,
|
|
5926
|
+
top: `${c}px`,
|
|
5927
|
+
transform: "translate(-100%, -50%)"
|
|
5891
5928
|
};
|
|
5892
5929
|
case "cr": return {
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5930
|
+
...l,
|
|
5931
|
+
left: `${i.right + n.height + r}px`,
|
|
5932
|
+
top: `${c}px`,
|
|
5933
|
+
transform: "translateY(-50%)"
|
|
5896
5934
|
};
|
|
5897
5935
|
case "tc": return {
|
|
5898
|
-
|
|
5899
|
-
left:
|
|
5900
|
-
|
|
5936
|
+
...l,
|
|
5937
|
+
left: `${s}px`,
|
|
5938
|
+
top: `${i.top - n.height - r}px`,
|
|
5939
|
+
transform: "translate(-50%, -100%)"
|
|
5901
5940
|
};
|
|
5902
5941
|
case "tl": return {
|
|
5903
|
-
|
|
5904
|
-
left:
|
|
5905
|
-
|
|
5906
|
-
transform:
|
|
5942
|
+
...l,
|
|
5943
|
+
left: o ? `${s}px` : `${i.right}px`,
|
|
5944
|
+
top: `${i.top - n.height - r}px`,
|
|
5945
|
+
transform: o ? "translate(-50%, -100%)" : "translate(-100%, -100%)"
|
|
5907
5946
|
};
|
|
5908
5947
|
case "tr": return {
|
|
5909
|
-
|
|
5910
|
-
left:
|
|
5911
|
-
|
|
5948
|
+
...l,
|
|
5949
|
+
left: o ? `${s}px` : `${i.left}px`,
|
|
5950
|
+
top: `${i.top - n.height - r}px`,
|
|
5951
|
+
transform: o ? "translate(-50%, -100%)" : "translateY(-100%)"
|
|
5912
5952
|
};
|
|
5913
5953
|
default: return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`), {};
|
|
5914
5954
|
}
|
|
5915
5955
|
}
|
|
5916
|
-
function
|
|
5917
|
-
let a = i >
|
|
5956
|
+
function ot(e, t, n, r) {
|
|
5957
|
+
let i = r.width, a = i > t.width, o = {
|
|
5958
|
+
bottom: "auto",
|
|
5959
|
+
height: `${n.height}px`,
|
|
5960
|
+
left: "auto",
|
|
5961
|
+
right: "auto",
|
|
5962
|
+
top: "auto",
|
|
5963
|
+
width: `${n.width}px`
|
|
5964
|
+
};
|
|
5918
5965
|
switch (e) {
|
|
5919
5966
|
case "bc": return {
|
|
5967
|
+
...o,
|
|
5920
5968
|
clipPath: "polygon(50% 0,100% 100%,0 100%)",
|
|
5921
|
-
height: `${t.height}px`,
|
|
5922
5969
|
left: "50%",
|
|
5923
5970
|
top: "0",
|
|
5924
|
-
transform: "translate(-50%, -100%)"
|
|
5925
|
-
width: `${t.width}px`
|
|
5971
|
+
transform: "translate(-50%, -100%)"
|
|
5926
5972
|
};
|
|
5927
5973
|
case "bl": return {
|
|
5974
|
+
...o,
|
|
5928
5975
|
clipPath: "polygon(50% 0,100% 100%,0 100%)",
|
|
5929
|
-
height: `${t.height}px`,
|
|
5930
5976
|
left: a ? "50%" : "",
|
|
5931
|
-
right: a ? "" : `${i -
|
|
5977
|
+
right: a ? "" : `${i - n.width / 2 - i / 2}px`,
|
|
5932
5978
|
top: "0",
|
|
5933
|
-
transform: `translate(${a ? "-50%" : "0"}, -100%)
|
|
5934
|
-
width: `${t.width}px`
|
|
5979
|
+
transform: `translate(${a ? "-50%" : "0"}, -100%)`
|
|
5935
5980
|
};
|
|
5936
5981
|
case "br": return {
|
|
5982
|
+
...o,
|
|
5937
5983
|
clipPath: "polygon(50% 0,100% 100%,0 100%)",
|
|
5938
|
-
|
|
5939
|
-
left: a ? "50%" : `${i - t.width / 2 - i / 2}px`,
|
|
5984
|
+
left: a ? "50%" : `${i - n.width / 2 - i / 2}px`,
|
|
5940
5985
|
top: "0",
|
|
5941
|
-
transform: `translate(${a ? "-50%" : "0"}, -100%)
|
|
5942
|
-
width: `${t.width}px`
|
|
5986
|
+
transform: `translate(${a ? "-50%" : "0"}, -100%)`
|
|
5943
5987
|
};
|
|
5944
5988
|
case "cl": return {
|
|
5989
|
+
...o,
|
|
5945
5990
|
clipPath: "polygon(0 0,100% 50%,0 100%)",
|
|
5946
|
-
height: `${t.width}px`,
|
|
5947
5991
|
right: "0",
|
|
5948
5992
|
top: "50%",
|
|
5949
|
-
transform: "translate(100%, -50%)"
|
|
5950
|
-
width: `${t.height}px`
|
|
5993
|
+
transform: "translate(100%, -50%)"
|
|
5951
5994
|
};
|
|
5952
5995
|
case "cr": return {
|
|
5996
|
+
...o,
|
|
5953
5997
|
clipPath: "polygon(100% 0,0 50%,100% 100%)",
|
|
5954
|
-
height: `${t.width}px`,
|
|
5955
5998
|
left: "0",
|
|
5956
5999
|
top: "50%",
|
|
5957
|
-
transform: "translate(-100%, -50%)"
|
|
5958
|
-
width: `${t.height}px`
|
|
6000
|
+
transform: "translate(-100%, -50%)"
|
|
5959
6001
|
};
|
|
5960
6002
|
case "tc": return {
|
|
6003
|
+
...o,
|
|
5961
6004
|
bottom: 0,
|
|
5962
|
-
clipPath: "polygon(50% 100%,100% 0,0 0)",
|
|
5963
|
-
height: `${t.height}px`,
|
|
6005
|
+
clipPath: "polygon(50% 100%, 100% 0, 0 0)",
|
|
5964
6006
|
left: "50%",
|
|
5965
|
-
transform: "translate(-50%, 100%)"
|
|
5966
|
-
width: `${t.width}px`
|
|
6007
|
+
transform: "translate(-50%, 100%)"
|
|
5967
6008
|
};
|
|
5968
6009
|
case "tl": return {
|
|
6010
|
+
...o,
|
|
5969
6011
|
bottom: 0,
|
|
5970
|
-
clipPath: "polygon(50% 100%,100% 0,0 0)",
|
|
5971
|
-
height: `${t.height}px`,
|
|
6012
|
+
clipPath: "polygon(50% 100%, 100% 0, 0 0)",
|
|
5972
6013
|
left: a ? "50%" : "",
|
|
5973
|
-
right: a ? "" : `${i -
|
|
5974
|
-
transform: `translate(${a ? "-50%" : "0"}, 100%)
|
|
5975
|
-
width: `${t.width}px`
|
|
6014
|
+
right: a ? "" : `${i - n.width / 2 - i / 2}px`,
|
|
6015
|
+
transform: `translate(${a ? "-50%" : "0"}, 100%)`
|
|
5976
6016
|
};
|
|
5977
6017
|
case "tr": return {
|
|
6018
|
+
...o,
|
|
5978
6019
|
bottom: 0,
|
|
5979
|
-
clipPath: "polygon(50% 100%,100% 0,0 0)",
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
transform: `translate(${a ? "-50%" : "0"}, 100%)`,
|
|
5983
|
-
width: `${t.width}px`
|
|
6020
|
+
clipPath: "polygon(50% 100%, 100% 0, 0 0)",
|
|
6021
|
+
left: a ? "50%" : `${i - n.width / 2 - i / 2}px`,
|
|
6022
|
+
transform: `translate(${a ? "-50%" : "0"}, 100%)`
|
|
5984
6023
|
};
|
|
5985
6024
|
default: return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`), {};
|
|
5986
6025
|
}
|
|
5987
6026
|
}
|
|
5988
|
-
|
|
5989
|
-
return j({
|
|
5990
|
-
arrow: {
|
|
5991
|
-
background: "inherit",
|
|
5992
|
-
position: "absolute",
|
|
5993
|
-
...it({
|
|
5994
|
-
alignment: e,
|
|
5995
|
-
arrowSize: t,
|
|
5996
|
-
fullDialogWidth: n,
|
|
5997
|
-
gap: r,
|
|
5998
|
-
maxDialogWidth: i,
|
|
5999
|
-
targetWidth: a
|
|
6000
|
-
})
|
|
6001
|
-
},
|
|
6002
|
-
dialog: {
|
|
6003
|
-
boxSizing: "border-box",
|
|
6004
|
-
height: "auto",
|
|
6005
|
-
margin: "0",
|
|
6006
|
-
opacity: "0",
|
|
6007
|
-
pointerEvents: "none",
|
|
6008
|
-
position: "absolute",
|
|
6009
|
-
userSelect: "none",
|
|
6010
|
-
whiteSpace: n > i ? "normal" : "pre",
|
|
6011
|
-
width: n > i ? `${i}px` : "",
|
|
6012
|
-
...rt({
|
|
6013
|
-
alignment: e,
|
|
6014
|
-
arrowSize: t,
|
|
6015
|
-
fullDialogWidth: n,
|
|
6016
|
-
gap: r,
|
|
6017
|
-
maxDialogWidth: i,
|
|
6018
|
-
targetWidth: a
|
|
6019
|
-
})
|
|
6020
|
-
}
|
|
6021
|
-
});
|
|
6022
|
-
}
|
|
6023
|
-
process.env.NODE_ENV === "development" && (et.displayName = "WithTooltip");
|
|
6027
|
+
process.env.NODE_ENV === "development" && (nt.displayName = "WithTooltip");
|
|
6024
6028
|
//#endregion
|
|
6025
6029
|
//#region src/hooks/useClassName.ts
|
|
6026
|
-
function
|
|
6030
|
+
function st(e, { target: t, isEnabled: n = !0 } = {}) {
|
|
6027
6031
|
l(() => {
|
|
6028
6032
|
if (!n) return;
|
|
6029
6033
|
let r = t ?? window.document.documentElement, i = r.classList.contains(e);
|
|
@@ -6038,7 +6042,7 @@ function ot(e, { target: t, isEnabled: n = !0 } = {}) {
|
|
|
6038
6042
|
}
|
|
6039
6043
|
//#endregion
|
|
6040
6044
|
//#region src/hooks/useClickOutside.ts
|
|
6041
|
-
function
|
|
6045
|
+
function ct(e, t, { isEnabled: n = !0 } = {}) {
|
|
6042
6046
|
let r = J(t), i = J([].concat(e));
|
|
6043
6047
|
c(() => {
|
|
6044
6048
|
if (!n) return;
|
|
@@ -6054,7 +6058,7 @@ function st(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6054
6058
|
}
|
|
6055
6059
|
//#endregion
|
|
6056
6060
|
//#region src/hooks/useCopyBlobToClipboard.ts
|
|
6057
|
-
function
|
|
6061
|
+
function lt() {
|
|
6058
6062
|
return s(async (e) => {
|
|
6059
6063
|
let t = e.type, n = new ClipboardItem({ [t]: e });
|
|
6060
6064
|
try {
|
|
@@ -6066,7 +6070,7 @@ function ct() {
|
|
|
6066
6070
|
}
|
|
6067
6071
|
//#endregion
|
|
6068
6072
|
//#region src/hooks/useDownloadBlob.ts
|
|
6069
|
-
function
|
|
6073
|
+
function ut() {
|
|
6070
6074
|
return s((e, t) => {
|
|
6071
6075
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
6072
6076
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
@@ -6074,17 +6078,17 @@ function lt() {
|
|
|
6074
6078
|
}
|
|
6075
6079
|
//#endregion
|
|
6076
6080
|
//#region src/utils/getDPR.ts
|
|
6077
|
-
function
|
|
6081
|
+
function dt() {
|
|
6078
6082
|
return typeof window > "u" ? 1 : window.devicePixelRatio || 1;
|
|
6079
6083
|
}
|
|
6080
6084
|
//#endregion
|
|
6081
6085
|
//#region src/hooks/useDPR.ts
|
|
6082
|
-
function
|
|
6083
|
-
return u(() =>
|
|
6086
|
+
function ft() {
|
|
6087
|
+
return u(() => dt(), []);
|
|
6084
6088
|
}
|
|
6085
6089
|
//#endregion
|
|
6086
6090
|
//#region src/hooks/useDrag.ts
|
|
6087
|
-
function
|
|
6091
|
+
function pt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, onDragMove: i, onDragStart: a }) {
|
|
6088
6092
|
let o = d(void 0), c = d(void 0), u = J(a), f = J(i), p = J(r), m = s((e) => {
|
|
6089
6093
|
if (!o.current) return;
|
|
6090
6094
|
let t = U.make(e.clientX, e.clientY), n = U.subtract(t, c.current ?? o.current);
|
|
@@ -6136,7 +6140,7 @@ function ft(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, on
|
|
|
6136
6140
|
}
|
|
6137
6141
|
//#endregion
|
|
6138
6142
|
//#region src/hooks/useDropzone.ts
|
|
6139
|
-
function
|
|
6143
|
+
function mt(e) {
|
|
6140
6144
|
let t = J(e), [n, r] = f(!1), i = s((e) => {
|
|
6141
6145
|
e.preventDefault(), e.stopPropagation(), r(!0);
|
|
6142
6146
|
}, []);
|
|
@@ -6155,7 +6159,7 @@ function pt(e) {
|
|
|
6155
6159
|
}
|
|
6156
6160
|
//#endregion
|
|
6157
6161
|
//#region src/hooks/useInterval.ts
|
|
6158
|
-
function
|
|
6162
|
+
function ht(e, { shouldAutoStart: t = !0, shouldInvokeInitially: n = !1, onInterval: r }, i = []) {
|
|
6159
6163
|
let a = d(void 0), o = J(r), l = s(() => {
|
|
6160
6164
|
clearInterval(a.current), a.current = void 0;
|
|
6161
6165
|
}, []), u = s(() => {
|
|
@@ -6180,7 +6184,7 @@ function mt(e, { shouldAutoStart: t = !0, shouldInvokeInitially: n = !1, onInter
|
|
|
6180
6184
|
}
|
|
6181
6185
|
//#endregion
|
|
6182
6186
|
//#region src/hooks/useIsMounted.ts
|
|
6183
|
-
function
|
|
6187
|
+
function gt() {
|
|
6184
6188
|
let [e, t] = f(!1);
|
|
6185
6189
|
return c(() => (t(!0), () => {
|
|
6186
6190
|
t(!1);
|
|
@@ -6188,17 +6192,17 @@ function ht() {
|
|
|
6188
6192
|
}
|
|
6189
6193
|
//#endregion
|
|
6190
6194
|
//#region src/utils/isTouchDevice.ts
|
|
6191
|
-
function
|
|
6195
|
+
function _t() {
|
|
6192
6196
|
return typeof window > "u" ? !1 : !!(window.navigator !== void 0 && (window.navigator.maxTouchPoints > 0 || "msMaxTouchPoints" in window.navigator && window.navigator.msMaxTouchPoints > 0) || window.matchMedia("(pointer: coarse)").matches || window.matchMedia("(hover: none)").matches || "ontouchstart" in window || "ontouchstart" in window.document.documentElement);
|
|
6193
6197
|
}
|
|
6194
6198
|
//#endregion
|
|
6195
6199
|
//#region src/hooks/useIsTouchDevice.ts
|
|
6196
|
-
function
|
|
6197
|
-
return u(() =>
|
|
6200
|
+
function vt() {
|
|
6201
|
+
return u(() => _t(), []);
|
|
6198
6202
|
}
|
|
6199
6203
|
//#endregion
|
|
6200
6204
|
//#region src/hooks/useKeyboardShortcut.ts
|
|
6201
|
-
function
|
|
6205
|
+
function yt(e, t, { capture: n = !1, preventsDefault: r = !0, stopsPropagation: i = !0, target: a, isEnabled: o = !0 } = {}) {
|
|
6202
6206
|
let s = J(t), l = Array.isArray(e) ? e : [e], d = u(() => l.map((e) => e.toLowerCase()).sort(), [l.join(",")]);
|
|
6203
6207
|
c(() => {
|
|
6204
6208
|
if (!o || d.length === 0) return;
|
|
@@ -6227,46 +6231,46 @@ function vt(e, t, { capture: n = !1, preventsDefault: r = !0, stopsPropagation:
|
|
|
6227
6231
|
}
|
|
6228
6232
|
//#endregion
|
|
6229
6233
|
//#region src/utils/createLocalCache.ts
|
|
6230
|
-
var
|
|
6231
|
-
function
|
|
6234
|
+
var bt = typeof window < "u" ? window.localStorage : void 0;
|
|
6235
|
+
function xt({ defaultTTL: e = 300 } = {}) {
|
|
6232
6236
|
return {
|
|
6233
|
-
get:
|
|
6234
|
-
invalidate:
|
|
6235
|
-
set: (t, n, r = e) =>
|
|
6237
|
+
get: wt,
|
|
6238
|
+
invalidate: St,
|
|
6239
|
+
set: (t, n, r = e) => Tt(t, n, r)
|
|
6236
6240
|
};
|
|
6237
6241
|
}
|
|
6238
|
-
function xt(e) {
|
|
6239
|
-
yt?.removeItem(e);
|
|
6240
|
-
}
|
|
6241
6242
|
function St(e) {
|
|
6243
|
+
bt?.removeItem(e);
|
|
6244
|
+
}
|
|
6245
|
+
function Ct(e) {
|
|
6242
6246
|
let { timestamp: t, ttl: n } = e;
|
|
6243
6247
|
return (Date.now() - t) / 1e3 >= n;
|
|
6244
6248
|
}
|
|
6245
|
-
function
|
|
6246
|
-
let t =
|
|
6249
|
+
function wt(e) {
|
|
6250
|
+
let t = bt?.getItem(e);
|
|
6247
6251
|
if (!t) return;
|
|
6248
6252
|
let n = JSON.parse(t);
|
|
6249
|
-
if (n) if (
|
|
6250
|
-
|
|
6253
|
+
if (n) if (Ct(n)) {
|
|
6254
|
+
St(e);
|
|
6251
6255
|
return;
|
|
6252
6256
|
} else return n.value;
|
|
6253
6257
|
}
|
|
6254
|
-
function
|
|
6258
|
+
function Tt(e, t, n) {
|
|
6255
6259
|
let r = {
|
|
6256
6260
|
timestamp: Date.now(),
|
|
6257
6261
|
ttl: n,
|
|
6258
6262
|
value: e
|
|
6259
6263
|
};
|
|
6260
|
-
return
|
|
6264
|
+
return bt?.setItem(t, JSON.stringify(r)), e;
|
|
6261
6265
|
}
|
|
6262
6266
|
//#endregion
|
|
6263
6267
|
//#region src/hooks/useLocalCache.ts
|
|
6264
|
-
function
|
|
6265
|
-
return u(() =>
|
|
6268
|
+
function Et(e) {
|
|
6269
|
+
return u(() => xt({ defaultTTL: e }), [e]);
|
|
6266
6270
|
}
|
|
6267
6271
|
//#endregion
|
|
6268
6272
|
//#region src/hooks/useMouseEnter.ts
|
|
6269
|
-
function
|
|
6273
|
+
function Dt(e, t, { isEnabled: n = !0 } = {}) {
|
|
6270
6274
|
let r = J(t);
|
|
6271
6275
|
l(() => {
|
|
6272
6276
|
if (!n) return;
|
|
@@ -6281,7 +6285,7 @@ function Et(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6281
6285
|
}
|
|
6282
6286
|
//#endregion
|
|
6283
6287
|
//#region src/hooks/useMouseLeave.ts
|
|
6284
|
-
function
|
|
6288
|
+
function Ot(e, t, { isEnabled: n = !0 } = {}) {
|
|
6285
6289
|
let r = J(t);
|
|
6286
6290
|
l(() => {
|
|
6287
6291
|
if (!n) return;
|
|
@@ -6296,7 +6300,7 @@ function Dt(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6296
6300
|
}
|
|
6297
6301
|
//#endregion
|
|
6298
6302
|
//#region src/hooks/useOS.ts
|
|
6299
|
-
function
|
|
6303
|
+
function kt() {
|
|
6300
6304
|
let e = navigator.userAgent || navigator.vendor || window.opera;
|
|
6301
6305
|
return u(() => {
|
|
6302
6306
|
switch (!0) {
|
|
@@ -6311,7 +6315,7 @@ function Ot() {
|
|
|
6311
6315
|
}
|
|
6312
6316
|
//#endregion
|
|
6313
6317
|
//#region src/hooks/usePrevious.ts
|
|
6314
|
-
function
|
|
6318
|
+
function At(e) {
|
|
6315
6319
|
let t = d(void 0);
|
|
6316
6320
|
return c(() => {
|
|
6317
6321
|
t.current = e;
|
|
@@ -6319,11 +6323,11 @@ function kt(e) {
|
|
|
6319
6323
|
}
|
|
6320
6324
|
//#endregion
|
|
6321
6325
|
//#region src/hooks/useScrollPosition.ts
|
|
6322
|
-
function
|
|
6326
|
+
function jt(...e) {
|
|
6323
6327
|
let t = typeof e[0] == "function" ? void 0 : e[0], n = typeof e[0] == "function" ? e[0] : e[1], r = typeof e[0] == "function" ? e[1] ?? [] : e[2] ?? [], i = J(n), a = d(void 0), o = d(!1);
|
|
6324
6328
|
l(() => {
|
|
6325
|
-
let e =
|
|
6326
|
-
let t = e ?
|
|
6329
|
+
let e = Mt(t), n = () => {
|
|
6330
|
+
let t = e ? Pt(e) : Nt();
|
|
6327
6331
|
t && (i.current(t, a.current), a.current = t);
|
|
6328
6332
|
}, r = () => {
|
|
6329
6333
|
o.current || typeof requestAnimationFrame == "function" && (o.current = !0, requestAnimationFrame(() => {
|
|
@@ -6335,10 +6339,10 @@ function At(...e) {
|
|
|
6335
6339
|
};
|
|
6336
6340
|
}, [...r]);
|
|
6337
6341
|
}
|
|
6338
|
-
function
|
|
6342
|
+
function Mt(e) {
|
|
6339
6343
|
if (e != null) return e instanceof HTMLElement ? e : e.current ?? void 0;
|
|
6340
6344
|
}
|
|
6341
|
-
function
|
|
6345
|
+
function Nt() {
|
|
6342
6346
|
let e = window.scrollX, t = window.scrollY, n = document.documentElement.scrollWidth - window.innerWidth, r = document.documentElement.scrollHeight - window.innerHeight;
|
|
6343
6347
|
return {
|
|
6344
6348
|
current: U.make(e, t),
|
|
@@ -6347,7 +6351,7 @@ function Mt() {
|
|
|
6347
6351
|
start: U.make(0, 0)
|
|
6348
6352
|
};
|
|
6349
6353
|
}
|
|
6350
|
-
function
|
|
6354
|
+
function Pt(e) {
|
|
6351
6355
|
let t = e.scrollLeft, n = e.scrollTop, r = e.scrollWidth - e.clientWidth, i = e.scrollHeight - e.clientHeight;
|
|
6352
6356
|
return {
|
|
6353
6357
|
current: U.make(t, n),
|
|
@@ -6358,46 +6362,46 @@ function Nt(e) {
|
|
|
6358
6362
|
}
|
|
6359
6363
|
//#endregion
|
|
6360
6364
|
//#region src/utils/createSessionCache.ts
|
|
6361
|
-
var
|
|
6362
|
-
function
|
|
6365
|
+
var Ft = typeof window < "u" ? window.sessionStorage : void 0;
|
|
6366
|
+
function It({ defaultTTL: e = 300 } = {}) {
|
|
6363
6367
|
return {
|
|
6364
|
-
get:
|
|
6365
|
-
invalidate:
|
|
6366
|
-
set: (t, n, r = e) =>
|
|
6368
|
+
get: zt,
|
|
6369
|
+
invalidate: Lt,
|
|
6370
|
+
set: (t, n, r = e) => Bt(t, n, r)
|
|
6367
6371
|
};
|
|
6368
6372
|
}
|
|
6369
|
-
function It(e) {
|
|
6370
|
-
Pt?.removeItem(e);
|
|
6371
|
-
}
|
|
6372
6373
|
function Lt(e) {
|
|
6374
|
+
Ft?.removeItem(e);
|
|
6375
|
+
}
|
|
6376
|
+
function Rt(e) {
|
|
6373
6377
|
let { timestamp: t, ttl: n } = e;
|
|
6374
6378
|
return (Date.now() - t) / 1e3 >= n;
|
|
6375
6379
|
}
|
|
6376
|
-
function
|
|
6377
|
-
let t =
|
|
6380
|
+
function zt(e) {
|
|
6381
|
+
let t = Ft?.getItem(e);
|
|
6378
6382
|
if (!t) return;
|
|
6379
6383
|
let n = JSON.parse(t);
|
|
6380
|
-
if (n) if (
|
|
6381
|
-
|
|
6384
|
+
if (n) if (Rt(n)) {
|
|
6385
|
+
Lt(e);
|
|
6382
6386
|
return;
|
|
6383
6387
|
} else return n.value;
|
|
6384
6388
|
}
|
|
6385
|
-
function
|
|
6389
|
+
function Bt(e, t, n) {
|
|
6386
6390
|
let r = {
|
|
6387
6391
|
timestamp: Date.now(),
|
|
6388
6392
|
ttl: n,
|
|
6389
6393
|
value: e
|
|
6390
6394
|
};
|
|
6391
|
-
return
|
|
6395
|
+
return Ft?.setItem(t, JSON.stringify(r)), e;
|
|
6392
6396
|
}
|
|
6393
6397
|
//#endregion
|
|
6394
6398
|
//#region src/hooks/useSessionCache.ts
|
|
6395
|
-
function
|
|
6396
|
-
return u(() =>
|
|
6399
|
+
function Vt(e) {
|
|
6400
|
+
return u(() => It({ defaultTTL: e }), [e]);
|
|
6397
6401
|
}
|
|
6398
6402
|
//#endregion
|
|
6399
6403
|
//#region src/hooks/useSize.ts
|
|
6400
|
-
function
|
|
6404
|
+
function Ht(e) {
|
|
6401
6405
|
let [t, n] = f(G.zero);
|
|
6402
6406
|
return te(e, (e) => {
|
|
6403
6407
|
let t = K.from(e), r = K.size(t);
|
|
@@ -6406,29 +6410,29 @@ function Vt(e) {
|
|
|
6406
6410
|
}
|
|
6407
6411
|
//#endregion
|
|
6408
6412
|
//#region src/utils/getStyle.ts
|
|
6409
|
-
function
|
|
6413
|
+
function Ut(e, { computed: t, target: n }) {
|
|
6410
6414
|
if (typeof window > "u") return;
|
|
6411
6415
|
let r = n ?? window.document.documentElement;
|
|
6412
6416
|
return t ? window.getComputedStyle(r).getPropertyValue(e) || void 0 : r.style.getPropertyValue(e) || void 0;
|
|
6413
6417
|
}
|
|
6414
6418
|
//#endregion
|
|
6415
6419
|
//#region src/utils/setStyle.ts
|
|
6416
|
-
function
|
|
6420
|
+
function Wt(e, t, { target: n } = {}) {
|
|
6417
6421
|
if (typeof window > "u") return;
|
|
6418
6422
|
let r = n ?? window.document.documentElement;
|
|
6419
6423
|
t === void 0 ? r.style.removeProperty(e) : r.style.setProperty(e, t);
|
|
6420
6424
|
}
|
|
6421
6425
|
//#endregion
|
|
6422
6426
|
//#region src/hooks/useStyle.ts
|
|
6423
|
-
function
|
|
6427
|
+
function Gt(e, t, { target: n, isEnabled: r = !0 } = {}) {
|
|
6424
6428
|
l(() => {
|
|
6425
6429
|
if (!r) return;
|
|
6426
|
-
let i = n ?? window.document.documentElement, a =
|
|
6430
|
+
let i = n ?? window.document.documentElement, a = Ut(e, {
|
|
6427
6431
|
computed: !1,
|
|
6428
6432
|
target: i
|
|
6429
6433
|
});
|
|
6430
|
-
return
|
|
6431
|
-
|
|
6434
|
+
return Wt(e, t, { target: i }), () => {
|
|
6435
|
+
Wt(e, a, { target: i });
|
|
6432
6436
|
};
|
|
6433
6437
|
}, [
|
|
6434
6438
|
e,
|
|
@@ -6439,7 +6443,7 @@ function Wt(e, t, { target: n, isEnabled: r = !0 } = {}) {
|
|
|
6439
6443
|
}
|
|
6440
6444
|
//#endregion
|
|
6441
6445
|
//#region src/hooks/useSystemColorScheme.ts
|
|
6442
|
-
function
|
|
6446
|
+
function Kt(e = "light") {
|
|
6443
6447
|
let [t, n] = f(e);
|
|
6444
6448
|
return l(() => {
|
|
6445
6449
|
let e = window.matchMedia("(prefers-color-scheme: dark)");
|
|
@@ -6453,7 +6457,7 @@ function Gt(e = "light") {
|
|
|
6453
6457
|
}
|
|
6454
6458
|
//#endregion
|
|
6455
6459
|
//#region src/hooks/useTimeout.ts
|
|
6456
|
-
function
|
|
6460
|
+
function qt(e, { shouldAutoStart: t = !0, onTimeout: n }, r = []) {
|
|
6457
6461
|
let i = d(void 0), a = J(n), o = s(() => {
|
|
6458
6462
|
i.current !== void 0 && (clearTimeout(i.current), i.current = void 0);
|
|
6459
6463
|
}, []), l = s(() => {
|
|
@@ -6474,8 +6478,8 @@ function Kt(e, { shouldAutoStart: t = !0, onTimeout: n }, r = []) {
|
|
|
6474
6478
|
}
|
|
6475
6479
|
//#endregion
|
|
6476
6480
|
//#region src/primitives/Collection.tsx
|
|
6477
|
-
var
|
|
6478
|
-
let x =
|
|
6481
|
+
var Jt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent: r, itemLength: i, itemPadding: a = 0, items: o = [], layout: s = "list", numSegments: l = 1, orientation: u = "vertical", selection: d, selectionMode: f = "none", isSelectionTogglable: p = !1, onActivateAt: m, onCustomEvent: h, onDeselectAt: g, onSelectAt: _, onSelectionChange: v, ...y }, b) => {
|
|
6482
|
+
let x = Qt(d ?? [], o), S = en({
|
|
6479
6483
|
itemLength: i,
|
|
6480
6484
|
itemPadding: a,
|
|
6481
6485
|
layout: s,
|
|
@@ -6488,7 +6492,7 @@ var qt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent
|
|
|
6488
6492
|
let t;
|
|
6489
6493
|
switch (f) {
|
|
6490
6494
|
case "multiple":
|
|
6491
|
-
t = (t) =>
|
|
6495
|
+
t = (t) => $t([...t.filter((t) => t !== e), e]);
|
|
6492
6496
|
break;
|
|
6493
6497
|
case "single":
|
|
6494
6498
|
t = (t) => [e];
|
|
@@ -6520,7 +6524,7 @@ var qt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent
|
|
|
6520
6524
|
}
|
|
6521
6525
|
j(e, t);
|
|
6522
6526
|
}, [f]);
|
|
6523
|
-
let M = A(n, { item:
|
|
6527
|
+
let M = A(n, { item: Yt });
|
|
6524
6528
|
return /* @__PURE__ */ (0, D.jsx)("div", {
|
|
6525
6529
|
...y,
|
|
6526
6530
|
className: C(e),
|
|
@@ -6550,7 +6554,7 @@ var qt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent
|
|
|
6550
6554
|
className: C({ active: i }),
|
|
6551
6555
|
style: c,
|
|
6552
6556
|
"aria-selected": i,
|
|
6553
|
-
element: M.item ?? /* @__PURE__ */ (0, D.jsx)(
|
|
6557
|
+
element: M.item ?? /* @__PURE__ */ (0, D.jsx)(Yt, {}),
|
|
6554
6558
|
role: n,
|
|
6555
6559
|
selectionMode: f,
|
|
6556
6560
|
onActivateAt: m,
|
|
@@ -6560,23 +6564,23 @@ var qt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent
|
|
|
6560
6564
|
}
|
|
6561
6565
|
})
|
|
6562
6566
|
});
|
|
6563
|
-
}),
|
|
6567
|
+
}), Yt = ({ children: e, selectionMode: t, onActivateAt: n, ...r }) => n || t === "single" || t === "multiple" ? /* @__PURE__ */ (0, D.jsx)("button", {
|
|
6564
6568
|
...r,
|
|
6565
6569
|
children: e
|
|
6566
6570
|
}) : /* @__PURE__ */ (0, D.jsx)("div", {
|
|
6567
6571
|
...r,
|
|
6568
6572
|
children: e
|
|
6569
|
-
}),
|
|
6570
|
-
function
|
|
6573
|
+
}), Xt = /* @__PURE__ */ Object.assign(Jt, { Item: Yt });
|
|
6574
|
+
function Zt(e, t) {
|
|
6571
6575
|
return !!(isNaN(e) || e >= t.length || e < 0);
|
|
6572
6576
|
}
|
|
6573
|
-
function
|
|
6574
|
-
return
|
|
6577
|
+
function Qt(e, t) {
|
|
6578
|
+
return $t(e).filter((e) => !Zt(e, t));
|
|
6575
6579
|
}
|
|
6576
|
-
function
|
|
6580
|
+
function $t(e) {
|
|
6577
6581
|
return e.sort((e, t) => e - t);
|
|
6578
6582
|
}
|
|
6579
|
-
function
|
|
6583
|
+
function en({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection", numSegments: r = 1, orientation: i = "vertical" }) {
|
|
6580
6584
|
return j({
|
|
6581
6585
|
item: {
|
|
6582
6586
|
counterIncrement: "item-counter",
|
|
@@ -6614,11 +6618,11 @@ function $t({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection",
|
|
|
6614
6618
|
}
|
|
6615
6619
|
});
|
|
6616
6620
|
}
|
|
6617
|
-
process.env.NODE_ENV === "development" && (
|
|
6621
|
+
process.env.NODE_ENV === "development" && (Jt.displayName = "Collection", Yt.displayName = "Collection.Item");
|
|
6618
6622
|
//#endregion
|
|
6619
6623
|
//#region src/primitives/Accordion.tsx
|
|
6620
|
-
var
|
|
6621
|
-
let w =
|
|
6624
|
+
var tn = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n, HeaderComponent: r, ItemComponent: i, orientation: a = "vertical", sectionPadding: o = 0, sections: s, selection: c, selectionMode: l = "single", shouldAutoCollapse: u = !1, onActivateAt: f, onCollapseSectionAt: p, onDeselectAt: m, onExpandedSectionsChange: h, onExpandSectionAt: g, onHeaderCustomEvent: _, onItemCustomEvent: v, onSelectAt: y, onSelectionChange: b, ...x }, S) => {
|
|
6625
|
+
let w = dn(c ?? {}, s), T = un(n ?? [], s), E = pn({ orientation: a }), O = s.map(() => d(null)), k = O.map(Ht), j = (e, t) => (w[t]?.indexOf(e) ?? -1) >= 0, M = (e) => T.indexOf(e) >= 0, F = (e) => {
|
|
6622
6626
|
let t;
|
|
6623
6627
|
t = M(e) ? (t) => t.filter((t) => t !== e) : u ? (t) => [e] : (t) => [...t.filter((t) => t !== e), e], R(T, t(T));
|
|
6624
6628
|
}, I = (e, t) => {
|
|
@@ -6628,7 +6632,7 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6628
6632
|
case "multiple":
|
|
6629
6633
|
n = (n) => ({
|
|
6630
6634
|
...n,
|
|
6631
|
-
[t]:
|
|
6635
|
+
[t]: fn([...(n[t] ?? []).filter((t) => t !== e), e])
|
|
6632
6636
|
});
|
|
6633
6637
|
break;
|
|
6634
6638
|
case "single":
|
|
@@ -6655,11 +6659,11 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6655
6659
|
}
|
|
6656
6660
|
r.forEach((e) => m?.(e[0], e[1])), i.forEach((e) => y?.(e[0], e[1])), b?.(t);
|
|
6657
6661
|
}, B = A(t, {
|
|
6658
|
-
collapseIcon:
|
|
6659
|
-
expandIcon:
|
|
6660
|
-
header:
|
|
6661
|
-
item:
|
|
6662
|
-
section:
|
|
6662
|
+
collapseIcon: an,
|
|
6663
|
+
expandIcon: rn,
|
|
6664
|
+
header: nn,
|
|
6665
|
+
item: sn,
|
|
6666
|
+
section: on
|
|
6663
6667
|
});
|
|
6664
6668
|
return /* @__PURE__ */ (0, D.jsx)("div", {
|
|
6665
6669
|
ref: S,
|
|
@@ -6677,7 +6681,7 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6677
6681
|
marginLeft: t === 0 ? "0px" : `${o}px`,
|
|
6678
6682
|
...S.width > 0 ? { width: `${T}px` } : { visibility: "hidden" }
|
|
6679
6683
|
}),
|
|
6680
|
-
element: B.section ?? /* @__PURE__ */ (0, D.jsx)(
|
|
6684
|
+
element: B.section ?? /* @__PURE__ */ (0, D.jsx)(on, {}),
|
|
6681
6685
|
children: [/* @__PURE__ */ (0, D.jsx)("div", {
|
|
6682
6686
|
ref: O[t],
|
|
6683
6687
|
style: P(E.headerContainer),
|
|
@@ -6701,7 +6705,7 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6701
6705
|
}),
|
|
6702
6706
|
style: P(E.header),
|
|
6703
6707
|
"aria-expanded": !x,
|
|
6704
|
-
element: B.header ?? /* @__PURE__ */ (0, D.jsx)(
|
|
6708
|
+
element: B.header ?? /* @__PURE__ */ (0, D.jsx)(nn, {}),
|
|
6705
6709
|
role: "button",
|
|
6706
6710
|
onClick: () => F(t),
|
|
6707
6711
|
children: [/* @__PURE__ */ (0, D.jsx)("span", { dangerouslySetInnerHTML: { __html: e.label } }), B.expandIcon && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
@@ -6726,7 +6730,7 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6726
6730
|
width: `${b}px`
|
|
6727
6731
|
}),
|
|
6728
6732
|
role: "region",
|
|
6729
|
-
children: /* @__PURE__ */ (0, D.jsx)(
|
|
6733
|
+
children: /* @__PURE__ */ (0, D.jsx)(Xt, {
|
|
6730
6734
|
className: C({
|
|
6731
6735
|
collapsed: x,
|
|
6732
6736
|
expanded: !x
|
|
@@ -6746,54 +6750,54 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6746
6750
|
onCustomEvent: (e, n, r) => v?.(e, t, n, r),
|
|
6747
6751
|
onDeselectAt: (e) => L(e, t),
|
|
6748
6752
|
onSelectAt: (e) => I(e, t),
|
|
6749
|
-
children: !i && (B.item ?? /* @__PURE__ */ (0, D.jsx)(
|
|
6753
|
+
children: !i && (B.item ?? /* @__PURE__ */ (0, D.jsx)(sn, {}))
|
|
6750
6754
|
})
|
|
6751
6755
|
})]
|
|
6752
6756
|
});
|
|
6753
6757
|
}
|
|
6754
6758
|
})
|
|
6755
6759
|
});
|
|
6756
|
-
}),
|
|
6760
|
+
}), nn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
6757
6761
|
...t,
|
|
6758
6762
|
children: e
|
|
6759
|
-
}),
|
|
6763
|
+
}), rn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
6760
6764
|
...t,
|
|
6761
6765
|
children: e
|
|
6762
|
-
}),
|
|
6766
|
+
}), an = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
6763
6767
|
...t,
|
|
6764
6768
|
children: e
|
|
6765
|
-
}),
|
|
6769
|
+
}), on = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("div", {
|
|
6766
6770
|
...t,
|
|
6767
6771
|
children: e
|
|
6768
|
-
}),
|
|
6769
|
-
Header:
|
|
6770
|
-
ExpandIcon:
|
|
6771
|
-
CollapseIcon:
|
|
6772
|
-
Section:
|
|
6773
|
-
Item:
|
|
6772
|
+
}), sn = Xt.Item, cn = /* @__PURE__ */ Object.assign(tn, {
|
|
6773
|
+
Header: nn,
|
|
6774
|
+
ExpandIcon: rn,
|
|
6775
|
+
CollapseIcon: an,
|
|
6776
|
+
Section: on,
|
|
6777
|
+
Item: sn
|
|
6774
6778
|
});
|
|
6775
|
-
function
|
|
6779
|
+
function X(e, t) {
|
|
6776
6780
|
return e >= t.length || e < 0;
|
|
6777
6781
|
}
|
|
6778
|
-
function
|
|
6779
|
-
return !!(
|
|
6780
|
-
}
|
|
6781
|
-
function ln(e, t) {
|
|
6782
|
-
return dn(e).filter((e) => !cn(e, t));
|
|
6782
|
+
function ln(e, t, n) {
|
|
6783
|
+
return !!(X(t, n) || e >= (n[t].items ?? []).length || e < 0);
|
|
6783
6784
|
}
|
|
6784
6785
|
function un(e, t) {
|
|
6786
|
+
return fn(e).filter((e) => !X(e, t));
|
|
6787
|
+
}
|
|
6788
|
+
function dn(e, t) {
|
|
6785
6789
|
let n = {};
|
|
6786
6790
|
for (let r in t) {
|
|
6787
6791
|
if (!Object.hasOwn(t, r)) continue;
|
|
6788
|
-
let i =
|
|
6789
|
-
n[Number(r)] =
|
|
6792
|
+
let i = fn([...e[r] ?? []]);
|
|
6793
|
+
n[Number(r)] = fn(i).filter((e) => !ln(e, Number(r), t));
|
|
6790
6794
|
}
|
|
6791
6795
|
return n;
|
|
6792
6796
|
}
|
|
6793
|
-
function
|
|
6797
|
+
function fn(e) {
|
|
6794
6798
|
return e.sort((e, t) => e - t);
|
|
6795
6799
|
}
|
|
6796
|
-
function
|
|
6800
|
+
function pn({ orientation: e = "vertical" }) {
|
|
6797
6801
|
return j({
|
|
6798
6802
|
collapseIcon: {
|
|
6799
6803
|
pointerEvents: "none",
|
|
@@ -6845,11 +6849,11 @@ function fn({ orientation: e = "vertical" }) {
|
|
|
6845
6849
|
}
|
|
6846
6850
|
});
|
|
6847
6851
|
}
|
|
6848
|
-
process.env.NODE_ENV === "development" && (
|
|
6852
|
+
process.env.NODE_ENV === "development" && (tn.displayName = "Accordion", nn.displayName = "Accordion.Header", rn.displayName = "Accordion.ExpandIcon", an.displayName = "Accordion.CollapseIcon", sn.displayName = "Accordion.Item");
|
|
6849
6853
|
//#endregion
|
|
6850
6854
|
//#region src/primitives/Carousel.tsx
|
|
6851
|
-
var
|
|
6852
|
-
let _ = d(void 0), v = d(null), y = d(void 0), b = d(void 0), x = d(void 0), S = 1e3, C = J(u), w = J(p), T = J(m), E = d(U.zero), O = d(!1), k = d(!1), A =
|
|
6855
|
+
var mn = /* @__PURE__ */ a(({ autoAdvanceInterval: e = 0, dragSpeed: t = 1, index: n = 0, ItemComponent: r, items: i = [], orientation: a = "horizontal", isDragEnabled: o = !0, shouldTrackExposure: c = !1, onAutoAdvancePause: u, onAutoAdvanceResume: p, onIndexChange: m, ...h }, g) => {
|
|
6856
|
+
let _ = d(void 0), v = d(null), y = d(void 0), b = d(void 0), x = d(void 0), S = 1e3, C = J(u), w = J(p), T = J(m), E = d(U.zero), O = d(!1), k = d(!1), A = vt(), [j, M] = f(gn(v, a)), [N, F] = f(!1), I = vn({
|
|
6853
6857
|
orientation: a,
|
|
6854
6858
|
scrollSnapEnabled: A || !N
|
|
6855
6859
|
}), L = e > 0, R = s(() => {
|
|
@@ -6859,9 +6863,9 @@ var pn = /* @__PURE__ */ a(({ autoAdvanceInterval: e = 0, dragSpeed: t = 1, inde
|
|
|
6859
6863
|
clearTimeout(x.current), x.current = void 0;
|
|
6860
6864
|
}, S);
|
|
6861
6865
|
}, [S, R]), B = s(() => {
|
|
6862
|
-
|
|
6866
|
+
hn(v, n, a), z();
|
|
6863
6867
|
}, [n, a]), V = s(() => {
|
|
6864
|
-
M(
|
|
6868
|
+
M(gn(v, a));
|
|
6865
6869
|
}, [a]), H = s((e) => {
|
|
6866
6870
|
A || (y.current = U.make(e.clientX, e.clientY), F(!0));
|
|
6867
6871
|
}, [A]), W = s((e) => {
|
|
@@ -6909,10 +6913,10 @@ var pn = /* @__PURE__ */ a(({ autoAdvanceInterval: e = 0, dragSpeed: t = 1, inde
|
|
|
6909
6913
|
c,
|
|
6910
6914
|
V
|
|
6911
6915
|
]);
|
|
6912
|
-
return
|
|
6916
|
+
return pt(v, {
|
|
6913
6917
|
isEnabled: !A && o && i.length > 1,
|
|
6914
6918
|
onDragMove: q
|
|
6915
|
-
}),
|
|
6919
|
+
}), ht(N || !L ? -1 : e, { onInterval: K }, [n]), l(() => {
|
|
6916
6920
|
!L || A || (N ? C.current?.() : w.current?.());
|
|
6917
6921
|
}, [
|
|
6918
6922
|
A,
|
|
@@ -6958,7 +6962,7 @@ var pn = /* @__PURE__ */ a(({ autoAdvanceInterval: e = 0, dragSpeed: t = 1, inde
|
|
|
6958
6962
|
})
|
|
6959
6963
|
});
|
|
6960
6964
|
});
|
|
6961
|
-
function
|
|
6965
|
+
function hn(e, t, n) {
|
|
6962
6966
|
let r = e?.current;
|
|
6963
6967
|
if (!r) return;
|
|
6964
6968
|
let i = n === "horizontal" ? 0 : r.clientHeight * t, a = n === "horizontal" ? r.clientWidth * t : 0;
|
|
@@ -6968,14 +6972,14 @@ function mn(e, t, n) {
|
|
|
6968
6972
|
top: i
|
|
6969
6973
|
});
|
|
6970
6974
|
}
|
|
6971
|
-
function
|
|
6975
|
+
function gn(e, t) {
|
|
6972
6976
|
let n = e?.current;
|
|
6973
6977
|
if (!n) return;
|
|
6974
6978
|
let r = [];
|
|
6975
|
-
for (let i = 0; i < n.children.length; i++) r.push(
|
|
6979
|
+
for (let i = 0; i < n.children.length; i++) r.push(_n(i, e, t));
|
|
6976
6980
|
return r;
|
|
6977
6981
|
}
|
|
6978
|
-
function
|
|
6982
|
+
function _n(e, t, n) {
|
|
6979
6983
|
let r = t?.current, i = r?.children[e];
|
|
6980
6984
|
if (!i) return 0;
|
|
6981
6985
|
let a = K.intersecting(i, r);
|
|
@@ -6985,7 +6989,7 @@ function gn(e, t, n) {
|
|
|
6985
6989
|
default: return console.error(`[etudes::Carousel] Unsupported orientation: ${n}`), NaN;
|
|
6986
6990
|
}
|
|
6987
6991
|
}
|
|
6988
|
-
function
|
|
6992
|
+
function vn({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
|
|
6989
6993
|
return j({
|
|
6990
6994
|
item: {
|
|
6991
6995
|
height: "100%",
|
|
@@ -7021,15 +7025,15 @@ function _n({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
|
|
|
7021
7025
|
}
|
|
7022
7026
|
});
|
|
7023
7027
|
}
|
|
7024
|
-
process.env.NODE_ENV === "development" && (
|
|
7028
|
+
process.env.NODE_ENV === "development" && (mn.displayName = "Carousel");
|
|
7025
7029
|
//#endregion
|
|
7026
7030
|
//#region src/primitives/CodeInput.tsx
|
|
7027
|
-
var
|
|
7028
|
-
let h =
|
|
7031
|
+
var yn = /* @__PURE__ */ a(({ style: e, autoComplete: t = "one-time-code", autoFocus: n = !1, children: r, inputMode: i = "numeric", placeholder: a, size: o, value: s, isDisabled: l = !1, isRequired: u = !0, onChange: f, ...p }, m) => {
|
|
7032
|
+
let h = Cn(s, o), g = d([]), _ = Sn(), v = A(r, { field: bn }), y = (e) => {
|
|
7029
7033
|
e < 0 ? g.current[0]?.focus() : e >= o ? g.current[o - 1]?.focus() : g.current[e]?.focus();
|
|
7030
7034
|
}, b = (e) => (t) => {
|
|
7031
|
-
let n = h[e], r =
|
|
7032
|
-
f(
|
|
7035
|
+
let n = h[e], r = Tn(t.target.value, n);
|
|
7036
|
+
f(wn(h.slice(), r.split("").slice(0, o), e)), y(Math.min(e + r.length, o - 1));
|
|
7033
7037
|
}, x = (e) => (t) => {
|
|
7034
7038
|
switch (t.key) {
|
|
7035
7039
|
case "ArrowLeft":
|
|
@@ -7049,7 +7053,7 @@ var vn = /* @__PURE__ */ a(({ style: e, autoComplete: t = "one-time-code", autoF
|
|
|
7049
7053
|
}, S = (e) => (t) => {
|
|
7050
7054
|
t.preventDefault();
|
|
7051
7055
|
let n = t.clipboardData.getData("text").trim();
|
|
7052
|
-
f(
|
|
7056
|
+
f(wn(h.slice(), n.split("").slice(0, o), e)), y(Math.min(e + n.length, o - 1));
|
|
7053
7057
|
};
|
|
7054
7058
|
return c(() => {
|
|
7055
7059
|
if (!n) return;
|
|
@@ -7068,7 +7072,7 @@ var vn = /* @__PURE__ */ a(({ style: e, autoComplete: t = "one-time-code", autoF
|
|
|
7068
7072
|
"aria-required": u,
|
|
7069
7073
|
autoComplete: t,
|
|
7070
7074
|
disabled: l,
|
|
7071
|
-
element: v.field ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7075
|
+
element: v.field ?? /* @__PURE__ */ (0, D.jsx)(bn, {}),
|
|
7072
7076
|
inputMode: i,
|
|
7073
7077
|
placeholder: a,
|
|
7074
7078
|
required: u,
|
|
@@ -7079,13 +7083,13 @@ var vn = /* @__PURE__ */ a(({ style: e, autoComplete: t = "one-time-code", autoF
|
|
|
7079
7083
|
})
|
|
7080
7084
|
})
|
|
7081
7085
|
});
|
|
7082
|
-
}),
|
|
7086
|
+
}), bn = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("input", {
|
|
7083
7087
|
...e,
|
|
7084
7088
|
autoCapitalize: "off",
|
|
7085
7089
|
autoCorrect: "off",
|
|
7086
7090
|
type: "text"
|
|
7087
|
-
}),
|
|
7088
|
-
function
|
|
7091
|
+
}), xn = /* @__PURE__ */ Object.assign(yn, { Field: bn });
|
|
7092
|
+
function Sn() {
|
|
7089
7093
|
return j({
|
|
7090
7094
|
field: {
|
|
7091
7095
|
caretColor: "transparent",
|
|
@@ -7099,24 +7103,24 @@ function xn() {
|
|
|
7099
7103
|
}
|
|
7100
7104
|
});
|
|
7101
7105
|
}
|
|
7102
|
-
function
|
|
7106
|
+
function Cn(e, t) {
|
|
7103
7107
|
let n = e.slice(0, t);
|
|
7104
7108
|
for (; n.length < t;) n.push("");
|
|
7105
7109
|
return n;
|
|
7106
7110
|
}
|
|
7107
|
-
function
|
|
7111
|
+
function wn(e, t, n = 0) {
|
|
7108
7112
|
let r = n, i = 0;
|
|
7109
7113
|
for (; i < t.length && r < e.length;) e[r] = t[i], r++, i++;
|
|
7110
7114
|
for (; i < t.length;) e.shift(), e.push(t[i]), i++;
|
|
7111
7115
|
return e;
|
|
7112
7116
|
}
|
|
7113
|
-
function
|
|
7117
|
+
function Tn(e, t) {
|
|
7114
7118
|
return t === "" ? e : e.startsWith(t) ? e.slice(t.length) : e.endsWith(t) ? e.slice(0, -t.length) : e;
|
|
7115
7119
|
}
|
|
7116
|
-
process.env.NODE_ENV === "development" && (
|
|
7120
|
+
process.env.NODE_ENV === "development" && (yn.displayName = "CodeInput", bn.displayName = "CodeInput.Field");
|
|
7117
7121
|
//#endregion
|
|
7118
7122
|
//#region src/primitives/TextField.tsx
|
|
7119
|
-
var
|
|
7123
|
+
var En = /* @__PURE__ */ a(({ className: e, emptyValue: t = "", formatter: n, placeholder: r, type: i = "text", value: a, isDisabled: o = !1, isRequired: c = !1, onChange: l, onFocus: u, onUnfocus: d, ...f }, p) => {
|
|
7120
7124
|
let m = s((e) => {
|
|
7121
7125
|
let r = (n?.(e) ?? e) || t;
|
|
7122
7126
|
l?.(r);
|
|
@@ -7138,10 +7142,10 @@ var Tn = /* @__PURE__ */ a(({ className: e, emptyValue: t = "", formatter: n, pl
|
|
|
7138
7142
|
onFocus: ({ target: e }) => u?.(e.value)
|
|
7139
7143
|
});
|
|
7140
7144
|
});
|
|
7141
|
-
process.env.NODE_ENV === "development" && (
|
|
7145
|
+
process.env.NODE_ENV === "development" && (En.displayName = "TextField");
|
|
7142
7146
|
//#endregion
|
|
7143
7147
|
//#region src/primitives/Counter.tsx
|
|
7144
|
-
var
|
|
7148
|
+
var Dn = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r = NaN, min: i = NaN, quantity: a = 0, onChange: o, ...s }, l) => {
|
|
7145
7149
|
let u = () => {
|
|
7146
7150
|
o?.(_(a - 1));
|
|
7147
7151
|
}, d = () => {
|
|
@@ -7157,7 +7161,7 @@ var En = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r
|
|
|
7157
7161
|
}, _ = (e) => {
|
|
7158
7162
|
let t = e;
|
|
7159
7163
|
return isNaN(i) || (t = Math.max(i, t)), isNaN(r) || (t = Math.min(r, t)), t;
|
|
7160
|
-
}, [v, y] = f(h(a)), b =
|
|
7164
|
+
}, [v, y] = f(h(a)), b = At(a), x = !isNaN(r) && a + 1 > r, S = !isNaN(i) && a - 1 < i;
|
|
7161
7165
|
c(() => {
|
|
7162
7166
|
b === void 0 || b === a || y(h(_(a)));
|
|
7163
7167
|
}, [
|
|
@@ -7166,24 +7170,24 @@ var En = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r
|
|
|
7166
7170
|
r
|
|
7167
7171
|
]);
|
|
7168
7172
|
let w = A(n, {
|
|
7169
|
-
addButton:
|
|
7170
|
-
subscribeButton:
|
|
7171
|
-
textField:
|
|
7173
|
+
addButton: kn,
|
|
7174
|
+
subscribeButton: An,
|
|
7175
|
+
textField: On
|
|
7172
7176
|
});
|
|
7173
7177
|
return /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
7174
7178
|
...s,
|
|
7175
7179
|
ref: l,
|
|
7176
|
-
style: P(e,
|
|
7180
|
+
style: P(e, Mn.root),
|
|
7177
7181
|
children: [
|
|
7178
7182
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
7179
7183
|
className: C({ disabled: S }),
|
|
7180
|
-
style: P(
|
|
7181
|
-
element: w.subscribeButton ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7184
|
+
style: P(Mn.subtract),
|
|
7185
|
+
element: w.subscribeButton ?? /* @__PURE__ */ (0, D.jsx)(An, {}),
|
|
7182
7186
|
onClick: () => u()
|
|
7183
7187
|
}),
|
|
7184
7188
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
7185
|
-
style: P(
|
|
7186
|
-
element: w.textField ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7189
|
+
style: P(Mn.textField),
|
|
7190
|
+
element: w.textField ?? /* @__PURE__ */ (0, D.jsx)(On, {}),
|
|
7187
7191
|
value: v,
|
|
7188
7192
|
isDisabled: !t,
|
|
7189
7193
|
onChange: p,
|
|
@@ -7191,23 +7195,23 @@ var En = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r
|
|
|
7191
7195
|
}),
|
|
7192
7196
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
7193
7197
|
className: C({ disabled: x }),
|
|
7194
|
-
style: P(
|
|
7195
|
-
element: w.addButton ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7198
|
+
style: P(Mn.add),
|
|
7199
|
+
element: w.addButton ?? /* @__PURE__ */ (0, D.jsx)(kn, {}),
|
|
7196
7200
|
onClick: () => d()
|
|
7197
7201
|
})
|
|
7198
7202
|
]
|
|
7199
7203
|
});
|
|
7200
|
-
}),
|
|
7204
|
+
}), On = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)(En, { ...e }), kn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
7201
7205
|
...t,
|
|
7202
7206
|
children: e
|
|
7203
|
-
}),
|
|
7207
|
+
}), An = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
7204
7208
|
...t,
|
|
7205
7209
|
children: e
|
|
7206
|
-
}),
|
|
7207
|
-
TextField:
|
|
7208
|
-
AddButton:
|
|
7209
|
-
SubtractButton:
|
|
7210
|
-
}),
|
|
7210
|
+
}), jn = /* @__PURE__ */ Object.assign(Dn, {
|
|
7211
|
+
TextField: On,
|
|
7212
|
+
AddButton: kn,
|
|
7213
|
+
SubtractButton: An
|
|
7214
|
+
}), Mn = j({
|
|
7211
7215
|
add: { flex: "0 0 auto" },
|
|
7212
7216
|
root: {
|
|
7213
7217
|
alignItems: "stretch",
|
|
@@ -7218,14 +7222,14 @@ var En = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r
|
|
|
7218
7222
|
subtract: { flex: "0 0 auto" },
|
|
7219
7223
|
textField: { width: "100%" }
|
|
7220
7224
|
});
|
|
7221
|
-
process.env.NODE_ENV === "development" && (
|
|
7225
|
+
process.env.NODE_ENV === "development" && (Dn.displayName = "Counter", kn.displayName = "Counter.AddButton", An.displayName = "Counter.SubtractButton", On.displayName = "Counter.TextField");
|
|
7222
7226
|
//#endregion
|
|
7223
7227
|
//#region src/primitives/Dial.tsx
|
|
7224
|
-
var
|
|
7228
|
+
var Nn = /* @__PURE__ */ a(({ style: e, angle: t = 0, children: n, knobLength: r = 30, knobThickness: i = 10, radius: a = 50, trackGap: o = 0, trackThickness: s = 2, ...c }, l) => {
|
|
7225
7229
|
let u = a * 2, d = Math.max(0, Math.min(360, r)), f = A(n, {
|
|
7226
|
-
knob:
|
|
7227
|
-
track:
|
|
7228
|
-
}), p =
|
|
7230
|
+
knob: Fn,
|
|
7231
|
+
track: Pn
|
|
7232
|
+
}), p = zn({
|
|
7229
7233
|
angle: t,
|
|
7230
7234
|
diameter: u
|
|
7231
7235
|
});
|
|
@@ -7243,7 +7247,7 @@ var Mn = /* @__PURE__ */ a(({ style: e, angle: t = 0, children: n, knobLength: r
|
|
|
7243
7247
|
children: /* @__PURE__ */ (0, D.jsx)(N, {
|
|
7244
7248
|
cx: a,
|
|
7245
7249
|
cy: a,
|
|
7246
|
-
element: f.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7250
|
+
element: f.track ?? /* @__PURE__ */ (0, D.jsx)(Pn, {}),
|
|
7247
7251
|
fill: "none",
|
|
7248
7252
|
r: a - s / 2,
|
|
7249
7253
|
strokeDasharray: o,
|
|
@@ -7257,27 +7261,27 @@ var Mn = /* @__PURE__ */ a(({ style: e, angle: t = 0, children: n, knobLength: r
|
|
|
7257
7261
|
viewBox: `0 0 ${u} ${u}`,
|
|
7258
7262
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7259
7263
|
children: /* @__PURE__ */ (0, D.jsx)(N, {
|
|
7260
|
-
d:
|
|
7261
|
-
element: f.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7264
|
+
d: Rn(a, a, a - i / 2 - (s - i) / 2, -d / 2, d / 2),
|
|
7265
|
+
element: f.knob ?? /* @__PURE__ */ (0, D.jsx)(Fn, {}),
|
|
7262
7266
|
fill: "none",
|
|
7263
7267
|
strokeWidth: i
|
|
7264
7268
|
})
|
|
7265
7269
|
})
|
|
7266
7270
|
})]
|
|
7267
7271
|
});
|
|
7268
|
-
}),
|
|
7269
|
-
Track:
|
|
7270
|
-
Knob:
|
|
7272
|
+
}), Pn = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("circle", { ...e }), Fn = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("path", { ...e }), In = /* @__PURE__ */ Object.assign(Nn, {
|
|
7273
|
+
Track: Pn,
|
|
7274
|
+
Knob: Fn
|
|
7271
7275
|
});
|
|
7272
|
-
function
|
|
7276
|
+
function Ln(e, t, n, r) {
|
|
7273
7277
|
let i = (r - 90) * Math.PI / 180;
|
|
7274
7278
|
return {
|
|
7275
7279
|
x: e + n * Math.cos(i),
|
|
7276
7280
|
y: t + n * Math.sin(i)
|
|
7277
7281
|
};
|
|
7278
7282
|
}
|
|
7279
|
-
function
|
|
7280
|
-
let a =
|
|
7283
|
+
function Rn(e, t, n, r, i) {
|
|
7284
|
+
let a = Ln(e, t, n, i), o = Ln(e, t, n, r), s = i - r <= 180 ? "0" : "1";
|
|
7281
7285
|
return [
|
|
7282
7286
|
"M",
|
|
7283
7287
|
a.x,
|
|
@@ -7292,7 +7296,7 @@ function Ln(e, t, n, r, i) {
|
|
|
7292
7296
|
o.y
|
|
7293
7297
|
].join(" ");
|
|
7294
7298
|
}
|
|
7295
|
-
function
|
|
7299
|
+
function zn({ angle: e = 0, diameter: t = 0 }) {
|
|
7296
7300
|
return j({
|
|
7297
7301
|
knobContainer: {
|
|
7298
7302
|
backgroundPosition: "center",
|
|
@@ -7326,11 +7330,11 @@ function Rn({ angle: e = 0, diameter: t = 0 }) {
|
|
|
7326
7330
|
}
|
|
7327
7331
|
});
|
|
7328
7332
|
}
|
|
7329
|
-
process.env.NODE_ENV === "development" && (
|
|
7333
|
+
process.env.NODE_ENV === "development" && (In.displayName = "Dial", Pn.displayName = "Dial.Track", Fn.displayName = "Dial.Knob");
|
|
7330
7334
|
//#endregion
|
|
7331
7335
|
//#region src/primitives/Dropdown.tsx
|
|
7332
|
-
var
|
|
7333
|
-
let L = d(null), R = re(L), z = s.length, B =
|
|
7336
|
+
var Bn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPadding: r = 0, ItemComponent: i, itemLength: a, itemPadding: o = 0, items: s = [], label: l, layout: u = "list", maxVisibleItems: p = -1, numSegments: m = 1, orientation: h = "vertical", selection: g = [], selectionMode: _ = "single", ToggleComponent: v, isCollapsed: y, isInverted: b = !1, isSelectionTogglable: x = !1, shouldCollapseOnSelect: S = !0, onActivateAt: w, onCollapse: T, onDeselectAt: E, onExpand: O, onSelectAt: k, onSelectionChange: j, onToggleCustomEvent: M, ...F }, I) => {
|
|
7337
|
+
let L = d(null), R = re(L), z = s.length, B = Xn(s, p, m, u), V = a ?? (h === "vertical" ? R.height : R.width), H = V * B + o * (B - 1), U = Jn(g, s), [W, G] = f(y ?? !0), K = Zn({
|
|
7334
7338
|
collectionPadding: r,
|
|
7335
7339
|
maxVisibleItems: p,
|
|
7336
7340
|
menuLength: H,
|
|
@@ -7339,11 +7343,11 @@ var zn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPad
|
|
|
7339
7343
|
isCollapsed: W,
|
|
7340
7344
|
isInverted: b
|
|
7341
7345
|
}), q = A(n, {
|
|
7342
|
-
collapseIcon:
|
|
7343
|
-
collection:
|
|
7344
|
-
expandIcon:
|
|
7345
|
-
item:
|
|
7346
|
-
toggle:
|
|
7346
|
+
collapseIcon: Wn,
|
|
7347
|
+
collection: Vn,
|
|
7348
|
+
expandIcon: Gn,
|
|
7349
|
+
item: Hn,
|
|
7350
|
+
toggle: Un
|
|
7347
7351
|
}), J = () => {
|
|
7348
7352
|
W && (G(!1), O?.());
|
|
7349
7353
|
}, ee = () => {
|
|
@@ -7401,7 +7405,7 @@ var zn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPad
|
|
|
7401
7405
|
style: P(K.toggle),
|
|
7402
7406
|
"aria-expanded": !W,
|
|
7403
7407
|
"aria-haspopup": "listbox",
|
|
7404
|
-
element: q.toggle ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7408
|
+
element: q.toggle ?? /* @__PURE__ */ (0, D.jsx)(Un, {}),
|
|
7405
7409
|
onClick: te,
|
|
7406
7410
|
children: [/* @__PURE__ */ (0, D.jsx)("span", { dangerouslySetInnerHTML: { __html: l?.(U) ?? (U.length > 0 ? U.map((e) => s[e]).join(", ") : "") } }), q.expandIcon && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
7407
7411
|
className: C({
|
|
@@ -7413,7 +7417,7 @@ var zn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPad
|
|
|
7413
7417
|
})]
|
|
7414
7418
|
}), /* @__PURE__ */ (0, D.jsx)(N, {
|
|
7415
7419
|
style: P(K.collection),
|
|
7416
|
-
element: q.collection ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7420
|
+
element: q.collection ?? /* @__PURE__ */ (0, D.jsx)(Vn, {}),
|
|
7417
7421
|
ItemComponent: i,
|
|
7418
7422
|
itemLength: V,
|
|
7419
7423
|
itemPadding: o,
|
|
@@ -7428,38 +7432,38 @@ var zn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPad
|
|
|
7428
7432
|
onDeselectAt: E,
|
|
7429
7433
|
onSelectAt: ne,
|
|
7430
7434
|
onSelectionChange: j,
|
|
7431
|
-
children: !i && (q.item ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7435
|
+
children: !i && (q.item ?? /* @__PURE__ */ (0, D.jsx)(Hn, {}))
|
|
7432
7436
|
})]
|
|
7433
7437
|
})
|
|
7434
7438
|
});
|
|
7435
|
-
}),
|
|
7439
|
+
}), Vn = Xt, Hn = Xt.Item, Un = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
7436
7440
|
...t,
|
|
7437
7441
|
children: e
|
|
7438
|
-
}),
|
|
7442
|
+
}), Wn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
7439
7443
|
...t,
|
|
7440
7444
|
"aria-hidden": !0,
|
|
7441
7445
|
children: e
|
|
7442
|
-
}),
|
|
7446
|
+
}), Gn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
7443
7447
|
...t,
|
|
7444
7448
|
"aria-hidden": !0,
|
|
7445
7449
|
children: e
|
|
7446
|
-
}),
|
|
7447
|
-
Collection:
|
|
7448
|
-
CollapseIcon:
|
|
7449
|
-
ExpandIcon:
|
|
7450
|
-
Item:
|
|
7451
|
-
Toggle:
|
|
7450
|
+
}), Kn = /* @__PURE__ */ Object.assign(Bn, {
|
|
7451
|
+
Collection: Vn,
|
|
7452
|
+
CollapseIcon: Wn,
|
|
7453
|
+
ExpandIcon: Gn,
|
|
7454
|
+
Item: Hn,
|
|
7455
|
+
Toggle: Un
|
|
7452
7456
|
});
|
|
7453
|
-
function
|
|
7457
|
+
function qn(e, t) {
|
|
7454
7458
|
return !!(isNaN(e) || e >= t.length || e < 0);
|
|
7455
7459
|
}
|
|
7456
|
-
function
|
|
7457
|
-
return
|
|
7460
|
+
function Jn(e, t) {
|
|
7461
|
+
return Yn(e).filter((e) => !qn(e, t));
|
|
7458
7462
|
}
|
|
7459
|
-
function
|
|
7463
|
+
function Yn(e) {
|
|
7460
7464
|
return e.sort((e, t) => e - t);
|
|
7461
7465
|
}
|
|
7462
|
-
function
|
|
7466
|
+
function Xn(e, t, n, r) {
|
|
7463
7467
|
let i = e.length;
|
|
7464
7468
|
switch (r) {
|
|
7465
7469
|
case "grid": {
|
|
@@ -7469,7 +7473,7 @@ function Yn(e, t, n, r) {
|
|
|
7469
7473
|
default: return t < 0 ? i : Math.min(i, t);
|
|
7470
7474
|
}
|
|
7471
7475
|
}
|
|
7472
|
-
function
|
|
7476
|
+
function Zn({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n = NaN, numItems: r = 0, orientation: i = "vertical", isCollapsed: a = !0, isInverted: o = !1 }) {
|
|
7473
7477
|
return j({
|
|
7474
7478
|
body: {
|
|
7475
7479
|
height: "100%",
|
|
@@ -7528,13 +7532,13 @@ function Xn({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n =
|
|
|
7528
7532
|
}
|
|
7529
7533
|
});
|
|
7530
7534
|
}
|
|
7531
|
-
process.env.NODE_ENV === "development" && (
|
|
7535
|
+
process.env.NODE_ENV === "development" && (Bn.displayName = "Dropdown", Vn.displayName = "Dropdown.Collection", Wn.displayName = "Dropdown.CollapseIcon", Gn.displayName = "Dropdown.ExpandIcon", Hn.displayName = "Dropdown.Item", Un.displayName = "Dropdown.Toggle");
|
|
7532
7536
|
//#endregion
|
|
7533
7537
|
//#region node_modules/fast-xml-parser/src/util.js
|
|
7534
|
-
var
|
|
7535
|
-
|
|
7536
|
-
var
|
|
7537
|
-
function
|
|
7538
|
+
var Qn = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
7539
|
+
Qn + "";
|
|
7540
|
+
var $n = "[" + Qn + "][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*", er = RegExp("^" + $n + "$");
|
|
7541
|
+
function tr(e, t) {
|
|
7538
7542
|
let n = [], r = t.exec(e);
|
|
7539
7543
|
for (; r;) {
|
|
7540
7544
|
let i = [];
|
|
@@ -7545,13 +7549,13 @@ function er(e, t) {
|
|
|
7545
7549
|
}
|
|
7546
7550
|
return n;
|
|
7547
7551
|
}
|
|
7548
|
-
var
|
|
7549
|
-
return
|
|
7552
|
+
var nr = function(e) {
|
|
7553
|
+
return er.exec(e) != null;
|
|
7550
7554
|
};
|
|
7551
|
-
function
|
|
7555
|
+
function rr(e) {
|
|
7552
7556
|
return e !== void 0;
|
|
7553
7557
|
}
|
|
7554
|
-
var
|
|
7558
|
+
var ir = [
|
|
7555
7559
|
"hasOwnProperty",
|
|
7556
7560
|
"toString",
|
|
7557
7561
|
"valueOf",
|
|
@@ -7559,41 +7563,41 @@ var rr = [
|
|
|
7559
7563
|
"__defineSetter__",
|
|
7560
7564
|
"__lookupGetter__",
|
|
7561
7565
|
"__lookupSetter__"
|
|
7562
|
-
],
|
|
7566
|
+
], ar = [
|
|
7563
7567
|
"__proto__",
|
|
7564
7568
|
"constructor",
|
|
7565
7569
|
"prototype"
|
|
7566
|
-
],
|
|
7570
|
+
], or = {
|
|
7567
7571
|
allowBooleanAttributes: !1,
|
|
7568
7572
|
unpairedTags: []
|
|
7569
7573
|
};
|
|
7570
|
-
function
|
|
7571
|
-
t = Object.assign({},
|
|
7574
|
+
function sr(e, t) {
|
|
7575
|
+
t = Object.assign({}, or, t);
|
|
7572
7576
|
let n = [], r = !1, i = !1;
|
|
7573
7577
|
e[0] === "" && (e = e.substr(1));
|
|
7574
7578
|
for (let a = 0; a < e.length; a++) if (e[a] === "<" && e[a + 1] === "?") {
|
|
7575
|
-
if (a += 2, a =
|
|
7579
|
+
if (a += 2, a = lr(e, a), a.err) return a;
|
|
7576
7580
|
} else if (e[a] === "<") {
|
|
7577
7581
|
let o = a;
|
|
7578
7582
|
if (a++, e[a] === "!") {
|
|
7579
|
-
a =
|
|
7583
|
+
a = ur(e, a);
|
|
7580
7584
|
continue;
|
|
7581
7585
|
} else {
|
|
7582
7586
|
let s = !1;
|
|
7583
7587
|
e[a] === "/" && (s = !0, a++);
|
|
7584
7588
|
let c = "";
|
|
7585
7589
|
for (; a < e.length && e[a] !== ">" && e[a] !== " " && e[a] !== " " && e[a] !== "\n" && e[a] !== "\r"; a++) c += e[a];
|
|
7586
|
-
if (c = c.trim(), c[c.length - 1] === "/" && (c = c.substring(0, c.length - 1), a--), !
|
|
7590
|
+
if (c = c.trim(), c[c.length - 1] === "/" && (c = c.substring(0, c.length - 1), a--), !yr(c)) {
|
|
7587
7591
|
let t;
|
|
7588
7592
|
return t = c.trim().length === 0 ? "Invalid space after '<'." : "Tag '" + c + "' is an invalid name.", Z("InvalidTag", t, Q(e, a));
|
|
7589
7593
|
}
|
|
7590
|
-
let l =
|
|
7594
|
+
let l = pr(e, a);
|
|
7591
7595
|
if (l === !1) return Z("InvalidAttr", "Attributes for '" + c + "' have open quote.", Q(e, a));
|
|
7592
7596
|
let u = l.value;
|
|
7593
7597
|
if (a = l.index, u[u.length - 1] === "/") {
|
|
7594
7598
|
let n = a - u.length;
|
|
7595
7599
|
u = u.substring(0, u.length - 1);
|
|
7596
|
-
let i =
|
|
7600
|
+
let i = hr(u, t);
|
|
7597
7601
|
if (i === !0) r = !0;
|
|
7598
7602
|
else return Z(i.err.code, i.err.msg, Q(e, n + i.err.line));
|
|
7599
7603
|
} else if (s) {
|
|
@@ -7609,7 +7613,7 @@ function or(e, t) {
|
|
|
7609
7613
|
n.length == 0 && (i = !0);
|
|
7610
7614
|
}
|
|
7611
7615
|
} else {
|
|
7612
|
-
let s =
|
|
7616
|
+
let s = hr(u, t);
|
|
7613
7617
|
if (s !== !0) return Z(s.err.code, s.err.msg, Q(e, a - u.length + s.err.line));
|
|
7614
7618
|
if (i === !0) return Z("InvalidXml", "Multiple possible root nodes found.", Q(e, a));
|
|
7615
7619
|
t.unpairedTags.indexOf(c) !== -1 || n.push({
|
|
@@ -7618,20 +7622,20 @@ function or(e, t) {
|
|
|
7618
7622
|
}), r = !0;
|
|
7619
7623
|
}
|
|
7620
7624
|
for (a++; a < e.length; a++) if (e[a] === "<") if (e[a + 1] === "!") {
|
|
7621
|
-
a++, a =
|
|
7625
|
+
a++, a = ur(e, a);
|
|
7622
7626
|
continue;
|
|
7623
7627
|
} else if (e[a + 1] === "?") {
|
|
7624
|
-
if (a =
|
|
7628
|
+
if (a = lr(e, ++a), a.err) return a;
|
|
7625
7629
|
} else break;
|
|
7626
7630
|
else if (e[a] === "&") {
|
|
7627
|
-
let t =
|
|
7631
|
+
let t = _r(e, a);
|
|
7628
7632
|
if (t == -1) return Z("InvalidChar", "char '&' is not expected.", Q(e, a));
|
|
7629
7633
|
a = t;
|
|
7630
|
-
} else if (i === !0 && !
|
|
7634
|
+
} else if (i === !0 && !cr(e[a])) return Z("InvalidXml", "Extra text at the end", Q(e, a));
|
|
7631
7635
|
e[a] === "<" && a--;
|
|
7632
7636
|
}
|
|
7633
7637
|
} else {
|
|
7634
|
-
if (
|
|
7638
|
+
if (cr(e[a])) continue;
|
|
7635
7639
|
return Z("InvalidChar", "char '" + e[a] + "' is not expected.", Q(e, a));
|
|
7636
7640
|
}
|
|
7637
7641
|
return r ? n.length == 1 ? Z("InvalidTag", "Unclosed tag '" + n[0].tagName + "'.", Q(e, n[0].tagStartPos)) : n.length > 0 ? Z("InvalidXml", "Invalid '" + JSON.stringify(n.map((e) => e.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", {
|
|
@@ -7639,10 +7643,10 @@ function or(e, t) {
|
|
|
7639
7643
|
col: 1
|
|
7640
7644
|
}) : !0 : Z("InvalidXml", "Start tag expected.", 1);
|
|
7641
7645
|
}
|
|
7642
|
-
function
|
|
7646
|
+
function cr(e) {
|
|
7643
7647
|
return e === " " || e === " " || e === "\n" || e === "\r";
|
|
7644
7648
|
}
|
|
7645
|
-
function
|
|
7649
|
+
function lr(e, t) {
|
|
7646
7650
|
let n = t;
|
|
7647
7651
|
for (; t < e.length; t++) if (e[t] == "?" || e[t] == " ") {
|
|
7648
7652
|
let r = e.substr(n, t - n);
|
|
@@ -7654,7 +7658,7 @@ function cr(e, t) {
|
|
|
7654
7658
|
}
|
|
7655
7659
|
return t;
|
|
7656
7660
|
}
|
|
7657
|
-
function
|
|
7661
|
+
function ur(e, t) {
|
|
7658
7662
|
if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
|
|
7659
7663
|
for (t += 3; t < e.length; t++) if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
|
|
7660
7664
|
t += 2;
|
|
@@ -7672,11 +7676,11 @@ function lr(e, t) {
|
|
|
7672
7676
|
}
|
|
7673
7677
|
return t;
|
|
7674
7678
|
}
|
|
7675
|
-
var
|
|
7676
|
-
function
|
|
7679
|
+
var dr = "\"", fr = "'";
|
|
7680
|
+
function pr(e, t) {
|
|
7677
7681
|
let n = "", r = "", i = !1;
|
|
7678
7682
|
for (; t < e.length; t++) {
|
|
7679
|
-
if (e[t] ===
|
|
7683
|
+
if (e[t] === dr || e[t] === fr) r === "" ? r = e[t] : r !== e[t] || (r = "");
|
|
7680
7684
|
else if (e[t] === ">" && r === "") {
|
|
7681
7685
|
i = !0;
|
|
7682
7686
|
break;
|
|
@@ -7689,21 +7693,21 @@ function fr(e, t) {
|
|
|
7689
7693
|
tagClosed: i
|
|
7690
7694
|
} : !1;
|
|
7691
7695
|
}
|
|
7692
|
-
var
|
|
7693
|
-
function
|
|
7694
|
-
let n =
|
|
7696
|
+
var mr = /* @__PURE__ */ RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
|
|
7697
|
+
function hr(e, t) {
|
|
7698
|
+
let n = tr(e, mr), r = {};
|
|
7695
7699
|
for (let e = 0; e < n.length; e++) {
|
|
7696
|
-
if (n[e][1].length === 0) return Z("InvalidAttr", "Attribute '" + n[e][2] + "' has no space in starting.",
|
|
7697
|
-
if (n[e][3] !== void 0 && n[e][4] === void 0) return Z("InvalidAttr", "Attribute '" + n[e][2] + "' is without value.",
|
|
7698
|
-
if (n[e][3] === void 0 && !t.allowBooleanAttributes) return Z("InvalidAttr", "boolean attribute '" + n[e][2] + "' is not allowed.",
|
|
7700
|
+
if (n[e][1].length === 0) return Z("InvalidAttr", "Attribute '" + n[e][2] + "' has no space in starting.", br(n[e]));
|
|
7701
|
+
if (n[e][3] !== void 0 && n[e][4] === void 0) return Z("InvalidAttr", "Attribute '" + n[e][2] + "' is without value.", br(n[e]));
|
|
7702
|
+
if (n[e][3] === void 0 && !t.allowBooleanAttributes) return Z("InvalidAttr", "boolean attribute '" + n[e][2] + "' is not allowed.", br(n[e]));
|
|
7699
7703
|
let i = n[e][2];
|
|
7700
|
-
if (!
|
|
7704
|
+
if (!vr(i)) return Z("InvalidAttr", "Attribute '" + i + "' is an invalid name.", br(n[e]));
|
|
7701
7705
|
if (!Object.prototype.hasOwnProperty.call(r, i)) r[i] = 1;
|
|
7702
|
-
else return Z("InvalidAttr", "Attribute '" + i + "' is repeated.",
|
|
7706
|
+
else return Z("InvalidAttr", "Attribute '" + i + "' is repeated.", br(n[e]));
|
|
7703
7707
|
}
|
|
7704
7708
|
return !0;
|
|
7705
7709
|
}
|
|
7706
|
-
function
|
|
7710
|
+
function gr(e, t) {
|
|
7707
7711
|
let n = /\d/;
|
|
7708
7712
|
for (e[t] === "x" && (t++, n = /[\da-fA-F]/); t < e.length; t++) {
|
|
7709
7713
|
if (e[t] === ";") return t;
|
|
@@ -7711,9 +7715,9 @@ function hr(e, t) {
|
|
|
7711
7715
|
}
|
|
7712
7716
|
return -1;
|
|
7713
7717
|
}
|
|
7714
|
-
function
|
|
7718
|
+
function _r(e, t) {
|
|
7715
7719
|
if (t++, e[t] === ";") return -1;
|
|
7716
|
-
if (e[t] === "#") return t++,
|
|
7720
|
+
if (e[t] === "#") return t++, gr(e, t);
|
|
7717
7721
|
let n = 0;
|
|
7718
7722
|
for (; t < e.length; t++, n++) if (!(e[t].match(/\w/) && n < 20)) {
|
|
7719
7723
|
if (e[t] === ";") break;
|
|
@@ -7729,11 +7733,11 @@ function Z(e, t, n) {
|
|
|
7729
7733
|
col: n.col
|
|
7730
7734
|
} };
|
|
7731
7735
|
}
|
|
7732
|
-
function _r(e) {
|
|
7733
|
-
return tr(e);
|
|
7734
|
-
}
|
|
7735
7736
|
function vr(e) {
|
|
7736
|
-
return
|
|
7737
|
+
return nr(e);
|
|
7738
|
+
}
|
|
7739
|
+
function yr(e) {
|
|
7740
|
+
return nr(e);
|
|
7737
7741
|
}
|
|
7738
7742
|
function Q(e, t) {
|
|
7739
7743
|
let n = e.substring(0, t).split(/\r?\n/);
|
|
@@ -7742,12 +7746,12 @@ function Q(e, t) {
|
|
|
7742
7746
|
col: n[n.length - 1].length + 1
|
|
7743
7747
|
};
|
|
7744
7748
|
}
|
|
7745
|
-
function
|
|
7749
|
+
function br(e) {
|
|
7746
7750
|
return e.startIndex + e[1].length;
|
|
7747
7751
|
}
|
|
7748
7752
|
//#endregion
|
|
7749
7753
|
//#region node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
|
|
7750
|
-
var
|
|
7754
|
+
var xr = (e) => ir.includes(e) ? "__" + e : e, Sr = {
|
|
7751
7755
|
preserveOrder: !1,
|
|
7752
7756
|
attributeNamePrefix: "@_",
|
|
7753
7757
|
attributesGroupName: !1,
|
|
@@ -7788,14 +7792,14 @@ var br = (e) => rr.includes(e) ? "__" + e : e, xr = {
|
|
|
7788
7792
|
maxNestedTags: 100,
|
|
7789
7793
|
strictReservedNames: !0,
|
|
7790
7794
|
jPath: !0,
|
|
7791
|
-
onDangerousProperty:
|
|
7795
|
+
onDangerousProperty: xr
|
|
7792
7796
|
};
|
|
7793
|
-
function
|
|
7797
|
+
function Cr(e, t) {
|
|
7794
7798
|
if (typeof e != "string") return;
|
|
7795
7799
|
let n = e.toLowerCase();
|
|
7796
|
-
if (
|
|
7800
|
+
if (ir.some((e) => n === e.toLowerCase()) || ar.some((e) => n === e.toLowerCase())) throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
7797
7801
|
}
|
|
7798
|
-
function
|
|
7802
|
+
function wr(e) {
|
|
7799
7803
|
return typeof e == "boolean" ? {
|
|
7800
7804
|
enabled: e,
|
|
7801
7805
|
maxEntitySize: 1e4,
|
|
@@ -7814,10 +7818,10 @@ function Cr(e) {
|
|
|
7814
7818
|
maxEntityCount: Math.max(1, e.maxEntityCount ?? 100),
|
|
7815
7819
|
allowedTags: e.allowedTags ?? null,
|
|
7816
7820
|
tagFilter: e.tagFilter ?? null
|
|
7817
|
-
} :
|
|
7821
|
+
} : wr(!0);
|
|
7818
7822
|
}
|
|
7819
|
-
var
|
|
7820
|
-
let t = Object.assign({},
|
|
7823
|
+
var Tr = function(e) {
|
|
7824
|
+
let t = Object.assign({}, Sr, e), n = [
|
|
7821
7825
|
{
|
|
7822
7826
|
value: t.attributeNamePrefix,
|
|
7823
7827
|
name: "attributeNamePrefix"
|
|
@@ -7839,9 +7843,9 @@ var wr = function(e) {
|
|
|
7839
7843
|
name: "commentPropName"
|
|
7840
7844
|
}
|
|
7841
7845
|
];
|
|
7842
|
-
for (let { value: e, name: t } of n) e &&
|
|
7843
|
-
return t.onDangerousProperty === null && (t.onDangerousProperty =
|
|
7844
|
-
},
|
|
7846
|
+
for (let { value: e, name: t } of n) e && Cr(e, t);
|
|
7847
|
+
return t.onDangerousProperty === null && (t.onDangerousProperty = xr), t.processEntities = wr(t.processEntities), t.stopNodes && Array.isArray(t.stopNodes) && (t.stopNodes = t.stopNodes.map((e) => typeof e == "string" && e.startsWith("*.") ? ".." + e.substring(2) : e)), t;
|
|
7848
|
+
}, Er = typeof Symbol == "function" ? Symbol("XML Node Metadata") : "@@xmlMetadata", Dr = class {
|
|
7845
7849
|
constructor(e) {
|
|
7846
7850
|
this.tagname = e, this.child = [], this[":@"] = Object.create(null);
|
|
7847
7851
|
}
|
|
@@ -7852,12 +7856,12 @@ var wr = function(e) {
|
|
|
7852
7856
|
e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({
|
|
7853
7857
|
[e.tagname]: e.child,
|
|
7854
7858
|
":@": e[":@"]
|
|
7855
|
-
}) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][
|
|
7859
|
+
}) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][Er] = { startIndex: t });
|
|
7856
7860
|
}
|
|
7857
7861
|
static getMetaDataSymbol() {
|
|
7858
|
-
return
|
|
7862
|
+
return Er;
|
|
7859
7863
|
}
|
|
7860
|
-
},
|
|
7864
|
+
}, Or = class {
|
|
7861
7865
|
constructor(e) {
|
|
7862
7866
|
this.suppressValidationErr = !e, this.options = e;
|
|
7863
7867
|
}
|
|
@@ -7867,7 +7871,7 @@ var wr = function(e) {
|
|
|
7867
7871
|
t += 9;
|
|
7868
7872
|
let i = 1, a = !1, o = !1, s = "";
|
|
7869
7873
|
for (; t < e.length; t++) if (e[t] === "<" && !o) {
|
|
7870
|
-
if (a &&
|
|
7874
|
+
if (a && kr(e, "!ENTITY", t)) {
|
|
7871
7875
|
t += 7;
|
|
7872
7876
|
let i, a;
|
|
7873
7877
|
if ([i, a, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr), a.indexOf("&") === -1) {
|
|
@@ -7878,16 +7882,16 @@ var wr = function(e) {
|
|
|
7878
7882
|
val: a
|
|
7879
7883
|
}, r++;
|
|
7880
7884
|
}
|
|
7881
|
-
} else if (a &&
|
|
7885
|
+
} else if (a && kr(e, "!ELEMENT", t)) {
|
|
7882
7886
|
t += 8;
|
|
7883
7887
|
let { index: n } = this.readElementExp(e, t + 1);
|
|
7884
7888
|
t = n;
|
|
7885
|
-
} else if (a &&
|
|
7886
|
-
else if (a &&
|
|
7889
|
+
} else if (a && kr(e, "!ATTLIST", t)) t += 8;
|
|
7890
|
+
else if (a && kr(e, "!NOTATION", t)) {
|
|
7887
7891
|
t += 9;
|
|
7888
7892
|
let { index: n } = this.readNotationExp(e, t + 1, this.suppressValidationErr);
|
|
7889
7893
|
t = n;
|
|
7890
|
-
} else if (
|
|
7894
|
+
} else if (kr(e, "!--", t)) o = !0;
|
|
7891
7895
|
else throw Error("Invalid DOCTYPE");
|
|
7892
7896
|
i++, s = "";
|
|
7893
7897
|
} else if (e[t] === ">") {
|
|
@@ -7905,7 +7909,7 @@ var wr = function(e) {
|
|
|
7905
7909
|
let n = t;
|
|
7906
7910
|
for (; t < e.length && !/\s/.test(e[t]) && e[t] !== "\"" && e[t] !== "'";) t++;
|
|
7907
7911
|
let r = e.substring(n, t);
|
|
7908
|
-
if (
|
|
7912
|
+
if (Ar(r), t = $(e, t), !this.suppressValidationErr) {
|
|
7909
7913
|
if (e.substring(t, t + 6).toUpperCase() === "SYSTEM") throw Error("External entities are not supported");
|
|
7910
7914
|
if (e[t] === "%") throw Error("Parameter entities are not supported");
|
|
7911
7915
|
}
|
|
@@ -7922,7 +7926,7 @@ var wr = function(e) {
|
|
|
7922
7926
|
let n = t;
|
|
7923
7927
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
7924
7928
|
let r = e.substring(n, t);
|
|
7925
|
-
!this.suppressValidationErr &&
|
|
7929
|
+
!this.suppressValidationErr && Ar(r), t = $(e, t);
|
|
7926
7930
|
let i = e.substring(t, t + 6).toUpperCase();
|
|
7927
7931
|
if (!this.suppressValidationErr && i !== "SYSTEM" && i !== "PUBLIC") throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);
|
|
7928
7932
|
t += i.length, t = $(e, t);
|
|
@@ -7950,11 +7954,11 @@ var wr = function(e) {
|
|
|
7950
7954
|
let n = t;
|
|
7951
7955
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
7952
7956
|
let r = e.substring(n, t);
|
|
7953
|
-
if (!this.suppressValidationErr && !
|
|
7957
|
+
if (!this.suppressValidationErr && !nr(r)) throw Error(`Invalid element name: "${r}"`);
|
|
7954
7958
|
t = $(e, t);
|
|
7955
7959
|
let i = "";
|
|
7956
|
-
if (e[t] === "E" &&
|
|
7957
|
-
else if (e[t] === "A" &&
|
|
7960
|
+
if (e[t] === "E" && kr(e, "MPTY", t)) t += 4;
|
|
7961
|
+
else if (e[t] === "A" && kr(e, "NY", t)) t += 2;
|
|
7958
7962
|
else if (e[t] === "(") {
|
|
7959
7963
|
t++;
|
|
7960
7964
|
let n = t;
|
|
@@ -7972,9 +7976,9 @@ var wr = function(e) {
|
|
|
7972
7976
|
let n = t;
|
|
7973
7977
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
7974
7978
|
let r = e.substring(n, t);
|
|
7975
|
-
for (
|
|
7979
|
+
for (Ar(r), t = $(e, t), n = t; t < e.length && !/\s/.test(e[t]);) t++;
|
|
7976
7980
|
let i = e.substring(n, t);
|
|
7977
|
-
if (!
|
|
7981
|
+
if (!Ar(i)) throw Error(`Invalid attribute name: "${i}"`);
|
|
7978
7982
|
t = $(e, t);
|
|
7979
7983
|
let a = "";
|
|
7980
7984
|
if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
|
|
@@ -7985,7 +7989,7 @@ var wr = function(e) {
|
|
|
7985
7989
|
let r = t;
|
|
7986
7990
|
for (; t < e.length && e[t] !== "|" && e[t] !== ")";) t++;
|
|
7987
7991
|
let i = e.substring(r, t);
|
|
7988
|
-
if (i = i.trim(), !
|
|
7992
|
+
if (i = i.trim(), !Ar(i)) throw Error(`Invalid notation name: "${i}"`);
|
|
7989
7993
|
n.push(i), e[t] === "|" && (t++, t = $(e, t));
|
|
7990
7994
|
}
|
|
7991
7995
|
if (e[t] !== ")") throw Error("Unterminated list of notations");
|
|
@@ -8018,35 +8022,35 @@ var wr = function(e) {
|
|
|
8018
8022
|
for (; t < e.length && /\s/.test(e[t]);) t++;
|
|
8019
8023
|
return t;
|
|
8020
8024
|
};
|
|
8021
|
-
function
|
|
8025
|
+
function kr(e, t, n) {
|
|
8022
8026
|
for (let r = 0; r < t.length; r++) if (t[r] !== e[n + r + 1]) return !1;
|
|
8023
8027
|
return !0;
|
|
8024
8028
|
}
|
|
8025
|
-
function
|
|
8026
|
-
if (
|
|
8029
|
+
function Ar(e) {
|
|
8030
|
+
if (nr(e)) return e;
|
|
8027
8031
|
throw Error(`Invalid entity name ${e}`);
|
|
8028
8032
|
}
|
|
8029
8033
|
//#endregion
|
|
8030
8034
|
//#region node_modules/strnum/strnum.js
|
|
8031
|
-
var
|
|
8035
|
+
var jr = /^[-+]?0x[a-fA-F0-9]+$/, Mr = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Nr = {
|
|
8032
8036
|
hex: !0,
|
|
8033
8037
|
leadingZeros: !0,
|
|
8034
8038
|
decimalPoint: ".",
|
|
8035
8039
|
eNotation: !0,
|
|
8036
8040
|
infinity: "original"
|
|
8037
8041
|
};
|
|
8038
|
-
function
|
|
8039
|
-
if (t = Object.assign({},
|
|
8042
|
+
function Pr(e, t = {}) {
|
|
8043
|
+
if (t = Object.assign({}, Nr, t), !e || typeof e != "string") return e;
|
|
8040
8044
|
let n = e.trim();
|
|
8041
8045
|
if (n.length === 0 || t.skipLike !== void 0 && t.skipLike.test(n)) return e;
|
|
8042
8046
|
if (n === "0") return 0;
|
|
8043
|
-
if (t.hex &&
|
|
8044
|
-
if (!isFinite(n)) return
|
|
8045
|
-
if (n.includes("e") || n.includes("E")) return
|
|
8047
|
+
if (t.hex && jr.test(n)) return Rr(n, 16);
|
|
8048
|
+
if (!isFinite(n)) return zr(e, Number(n), t);
|
|
8049
|
+
if (n.includes("e") || n.includes("E")) return Ir(e, n, t);
|
|
8046
8050
|
{
|
|
8047
|
-
let r =
|
|
8051
|
+
let r = Mr.exec(n);
|
|
8048
8052
|
if (r) {
|
|
8049
|
-
let i = r[1] || "", a = r[2], o =
|
|
8053
|
+
let i = r[1] || "", a = r[2], o = Lr(r[3]), s = i ? e[a.length + 1] === "." : e[a.length] === ".";
|
|
8050
8054
|
if (!t.leadingZeros && (a.length > 1 || a.length === 1 && !s)) return e;
|
|
8051
8055
|
{
|
|
8052
8056
|
let r = Number(n), s = String(r);
|
|
@@ -8059,25 +8063,25 @@ function Nr(e, t = {}) {
|
|
|
8059
8063
|
} else return e;
|
|
8060
8064
|
}
|
|
8061
8065
|
}
|
|
8062
|
-
var
|
|
8063
|
-
function
|
|
8066
|
+
var Fr = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
|
|
8067
|
+
function Ir(e, t, n) {
|
|
8064
8068
|
if (!n.eNotation) return e;
|
|
8065
|
-
let r = t.match(
|
|
8069
|
+
let r = t.match(Fr);
|
|
8066
8070
|
if (r) {
|
|
8067
8071
|
let i = r[1] || "", a = r[3].indexOf("e") === -1 ? "E" : "e", o = r[2], s = i ? e[o.length + 1] === a : e[o.length] === a;
|
|
8068
8072
|
return o.length > 1 && s ? e : o.length === 1 && (r[3].startsWith(`.${a}`) || r[3][0] === a) ? Number(t) : o.length > 0 ? n.leadingZeros && !s ? (t = (r[1] || "") + r[3], Number(t)) : e : Number(t);
|
|
8069
8073
|
} else return e;
|
|
8070
8074
|
}
|
|
8071
|
-
function
|
|
8075
|
+
function Lr(e) {
|
|
8072
8076
|
return e && e.indexOf(".") !== -1 ? (e = e.replace(/0+$/, ""), e === "." ? e = "0" : e[0] === "." ? e = "0" + e : e[e.length - 1] === "." && (e = e.substring(0, e.length - 1)), e) : e;
|
|
8073
8077
|
}
|
|
8074
|
-
function
|
|
8078
|
+
function Rr(e, t) {
|
|
8075
8079
|
if (parseInt) return parseInt(e, t);
|
|
8076
8080
|
if (Number.parseInt) return Number.parseInt(e, t);
|
|
8077
8081
|
if (window && window.parseInt) return window.parseInt(e, t);
|
|
8078
8082
|
throw Error("parseInt, Number.parseInt, window.parseInt are not supported");
|
|
8079
8083
|
}
|
|
8080
|
-
function
|
|
8084
|
+
function zr(e, t, n) {
|
|
8081
8085
|
let r = t === Infinity;
|
|
8082
8086
|
switch (n.infinity.toLowerCase()) {
|
|
8083
8087
|
case "null": return null;
|
|
@@ -8088,14 +8092,14 @@ function Rr(e, t, n) {
|
|
|
8088
8092
|
}
|
|
8089
8093
|
//#endregion
|
|
8090
8094
|
//#region node_modules/fast-xml-parser/src/ignoreAttributes.js
|
|
8091
|
-
function
|
|
8095
|
+
function Br(e) {
|
|
8092
8096
|
return typeof e == "function" ? e : Array.isArray(e) ? (t) => {
|
|
8093
8097
|
for (let n of e) if (typeof n == "string" && t === n || n instanceof RegExp && n.test(t)) return !0;
|
|
8094
8098
|
} : () => !1;
|
|
8095
8099
|
}
|
|
8096
8100
|
//#endregion
|
|
8097
8101
|
//#region node_modules/path-expression-matcher/src/Expression.js
|
|
8098
|
-
var
|
|
8102
|
+
var Vr = class {
|
|
8099
8103
|
constructor(e, t = {}) {
|
|
8100
8104
|
this.pattern = e, this.separator = t.separator || ".", this.segments = this._parse(e), this._hasDeepWildcard = this.segments.some((e) => e.type === "deep-wildcard"), this._hasAttributeCondition = this.segments.some((e) => e.attrName !== void 0), this._hasPositionSelector = this.segments.some((e) => e.position !== void 0);
|
|
8101
8105
|
}
|
|
@@ -8151,13 +8155,13 @@ var Br = class {
|
|
|
8151
8155
|
toString() {
|
|
8152
8156
|
return this.pattern;
|
|
8153
8157
|
}
|
|
8154
|
-
},
|
|
8158
|
+
}, Hr = new Set([
|
|
8155
8159
|
"push",
|
|
8156
8160
|
"pop",
|
|
8157
8161
|
"reset",
|
|
8158
8162
|
"updateCurrent",
|
|
8159
8163
|
"restore"
|
|
8160
|
-
]),
|
|
8164
|
+
]), Ur = class {
|
|
8161
8165
|
constructor(e = {}) {
|
|
8162
8166
|
this.separator = e.separator || ".", this.path = [], this.siblingStacks = [];
|
|
8163
8167
|
}
|
|
@@ -8288,7 +8292,7 @@ var Br = class {
|
|
|
8288
8292
|
readOnly() {
|
|
8289
8293
|
return new Proxy(this, {
|
|
8290
8294
|
get(e, t, n) {
|
|
8291
|
-
if (
|
|
8295
|
+
if (Hr.has(t)) return () => {
|
|
8292
8296
|
throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`);
|
|
8293
8297
|
};
|
|
8294
8298
|
let r = Reflect.get(e, t, n);
|
|
@@ -8305,7 +8309,7 @@ var Br = class {
|
|
|
8305
8309
|
};
|
|
8306
8310
|
//#endregion
|
|
8307
8311
|
//#region node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
|
|
8308
|
-
function
|
|
8312
|
+
function Wr(e, t) {
|
|
8309
8313
|
if (!e) return {};
|
|
8310
8314
|
let n = t.attributesGroupName ? e[t.attributesGroupName] : e;
|
|
8311
8315
|
if (!n) return {};
|
|
@@ -8316,7 +8320,7 @@ function Ur(e, t) {
|
|
|
8316
8320
|
} else r[e] = n[e];
|
|
8317
8321
|
return r;
|
|
8318
8322
|
}
|
|
8319
|
-
function
|
|
8323
|
+
function Gr(e) {
|
|
8320
8324
|
if (!e || typeof e != "string") return;
|
|
8321
8325
|
let t = e.indexOf(":");
|
|
8322
8326
|
if (t !== -1 && t > 0) {
|
|
@@ -8324,7 +8328,7 @@ function Wr(e) {
|
|
|
8324
8328
|
if (n !== "xmlns") return n;
|
|
8325
8329
|
}
|
|
8326
8330
|
}
|
|
8327
|
-
var
|
|
8331
|
+
var Kr = class {
|
|
8328
8332
|
constructor(e) {
|
|
8329
8333
|
if (this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
|
|
8330
8334
|
apos: {
|
|
@@ -8381,22 +8385,22 @@ var Gr = class {
|
|
|
8381
8385
|
},
|
|
8382
8386
|
num_dec: {
|
|
8383
8387
|
regex: /&#([0-9]{1,7});/g,
|
|
8384
|
-
val: (e, t) =>
|
|
8388
|
+
val: (e, t) => ci(t, 10, "&#")
|
|
8385
8389
|
},
|
|
8386
8390
|
num_hex: {
|
|
8387
8391
|
regex: /&#x([0-9a-fA-F]{1,6});/g,
|
|
8388
|
-
val: (e, t) =>
|
|
8392
|
+
val: (e, t) => ci(t, 16, "&#x")
|
|
8389
8393
|
}
|
|
8390
|
-
}, this.addExternalEntities =
|
|
8394
|
+
}, this.addExternalEntities = qr, this.parseXml = Qr, this.parseTextData = Jr, this.resolveNameSpace = Yr, this.buildAttributesMap = Zr, this.isItStopNode = ni, this.replaceEntitiesValue = ei, this.readStopNodeData = oi, this.saveTextToParentTag = ti, this.addChild = $r, this.ignoreAttributesFn = Br(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.matcher = new Ur(), this.readonlyMatcher = this.matcher.readOnly(), this.isCurrentNodeStopNode = !1, this.options.stopNodes && this.options.stopNodes.length > 0) {
|
|
8391
8395
|
this.stopNodeExpressions = [];
|
|
8392
8396
|
for (let e = 0; e < this.options.stopNodes.length; e++) {
|
|
8393
8397
|
let t = this.options.stopNodes[e];
|
|
8394
|
-
typeof t == "string" ? this.stopNodeExpressions.push(new
|
|
8398
|
+
typeof t == "string" ? this.stopNodeExpressions.push(new Vr(t)) : t instanceof Vr && this.stopNodeExpressions.push(t);
|
|
8395
8399
|
}
|
|
8396
8400
|
}
|
|
8397
8401
|
}
|
|
8398
8402
|
};
|
|
8399
|
-
function
|
|
8403
|
+
function qr(e) {
|
|
8400
8404
|
let t = Object.keys(e);
|
|
8401
8405
|
for (let n = 0; n < t.length; n++) {
|
|
8402
8406
|
let r = t[n], i = r.replace(/[.\-+*:]/g, "\\.");
|
|
@@ -8406,14 +8410,14 @@ function Kr(e) {
|
|
|
8406
8410
|
};
|
|
8407
8411
|
}
|
|
8408
8412
|
}
|
|
8409
|
-
function
|
|
8413
|
+
function Jr(e, t, n, r, i, a, o) {
|
|
8410
8414
|
if (e !== void 0 && (this.options.trimValues && !r && (e = e.trim()), e.length > 0)) {
|
|
8411
8415
|
o || (e = this.replaceEntitiesValue(e, t, n));
|
|
8412
8416
|
let r = this.options.jPath ? n.toString() : n, s = this.options.tagValueProcessor(t, e, r, i, a);
|
|
8413
|
-
return s == null ? e : typeof s != typeof e || s !== e ? s : this.options.trimValues || e.trim() === e ?
|
|
8417
|
+
return s == null ? e : typeof s != typeof e || s !== e ? s : this.options.trimValues || e.trim() === e ? si(e, this.options.parseTagValue, this.options.numberParseOptions) : e;
|
|
8414
8418
|
}
|
|
8415
8419
|
}
|
|
8416
|
-
function
|
|
8420
|
+
function Yr(e) {
|
|
8417
8421
|
if (this.options.removeNSPrefix) {
|
|
8418
8422
|
let t = e.split(":"), n = e.charAt(0) === "/" ? "/" : "";
|
|
8419
8423
|
if (t[0] === "xmlns") return "";
|
|
@@ -8421,10 +8425,10 @@ function Jr(e) {
|
|
|
8421
8425
|
}
|
|
8422
8426
|
return e;
|
|
8423
8427
|
}
|
|
8424
|
-
var
|
|
8425
|
-
function
|
|
8428
|
+
var Xr = /* @__PURE__ */ RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
|
|
8429
|
+
function Zr(e, t, n) {
|
|
8426
8430
|
if (this.options.ignoreAttributes !== !0 && typeof e == "string") {
|
|
8427
|
-
let r =
|
|
8431
|
+
let r = tr(e, Xr), i = r.length, a = {}, o = {};
|
|
8428
8432
|
for (let e = 0; e < i; e++) {
|
|
8429
8433
|
let t = this.resolveNameSpace(r[e][1]), i = r[e][4];
|
|
8430
8434
|
if (t.length && i !== void 0) {
|
|
@@ -8437,10 +8441,10 @@ function Xr(e, t, n) {
|
|
|
8437
8441
|
let i = this.resolveNameSpace(r[e][1]), o = this.options.jPath ? t.toString() : this.readonlyMatcher;
|
|
8438
8442
|
if (this.ignoreAttributesFn(i, o)) continue;
|
|
8439
8443
|
let s = r[e][4], c = this.options.attributeNamePrefix + i;
|
|
8440
|
-
if (i.length) if (this.options.transformAttributeName && (c = this.options.transformAttributeName(c)), c =
|
|
8444
|
+
if (i.length) if (this.options.transformAttributeName && (c = this.options.transformAttributeName(c)), c = ui(c, this.options), s !== void 0) {
|
|
8441
8445
|
this.options.trimValues && (s = s.trim()), s = this.replaceEntitiesValue(s, n, this.readonlyMatcher);
|
|
8442
8446
|
let e = this.options.jPath ? t.toString() : this.readonlyMatcher, r = this.options.attributeValueProcessor(i, s, e);
|
|
8443
|
-
r == null ? a[c] = s : typeof r != typeof s || r !== s ? a[c] = r : a[c] =
|
|
8447
|
+
r == null ? a[c] = s : typeof r != typeof s || r !== s ? a[c] = r : a[c] = si(s, this.options.parseAttributeValue, this.options.numberParseOptions);
|
|
8444
8448
|
} else this.options.allowBooleanAttributes && (a[c] = !0);
|
|
8445
8449
|
}
|
|
8446
8450
|
if (!Object.keys(a).length) return;
|
|
@@ -8451,31 +8455,31 @@ function Xr(e, t, n) {
|
|
|
8451
8455
|
return a;
|
|
8452
8456
|
}
|
|
8453
8457
|
}
|
|
8454
|
-
var
|
|
8458
|
+
var Qr = function(e) {
|
|
8455
8459
|
e = e.replace(/\r\n?/g, "\n");
|
|
8456
|
-
let t = new
|
|
8460
|
+
let t = new Dr("!xml"), n = t, r = "";
|
|
8457
8461
|
this.matcher.reset(), this.entityExpansionCount = 0, this.currentExpandedLength = 0;
|
|
8458
|
-
let i = new
|
|
8462
|
+
let i = new Or(this.options.processEntities);
|
|
8459
8463
|
for (let a = 0; a < e.length; a++) if (e[a] === "<") if (e[a + 1] === "/") {
|
|
8460
|
-
let t =
|
|
8464
|
+
let t = ii(e, ">", a, "Closing Tag is not closed."), i = e.substring(a + 2, t).trim();
|
|
8461
8465
|
if (this.options.removeNSPrefix) {
|
|
8462
8466
|
let e = i.indexOf(":");
|
|
8463
8467
|
e !== -1 && (i = i.substr(e + 1));
|
|
8464
8468
|
}
|
|
8465
|
-
i =
|
|
8469
|
+
i = li(this.options.transformTagName, i, "", this.options).tagName, n && (r = this.saveTextToParentTag(r, n, this.readonlyMatcher));
|
|
8466
8470
|
let o = this.matcher.getCurrentTag();
|
|
8467
8471
|
if (i && this.options.unpairedTags.indexOf(i) !== -1) throw Error(`Unpaired tag can not be used as closing tag: </${i}>`);
|
|
8468
8472
|
o && this.options.unpairedTags.indexOf(o) !== -1 && (this.matcher.pop(), this.tagsNodeStack.pop()), this.matcher.pop(), this.isCurrentNodeStopNode = !1, n = this.tagsNodeStack.pop(), r = "", a = t;
|
|
8469
8473
|
} else if (e[a + 1] === "?") {
|
|
8470
|
-
let t =
|
|
8474
|
+
let t = ai(e, a, !1, "?>");
|
|
8471
8475
|
if (!t) throw Error("Pi Tag is not closed.");
|
|
8472
8476
|
if (r = this.saveTextToParentTag(r, n, this.readonlyMatcher), !(this.options.ignoreDeclaration && t.tagName === "?xml" || this.options.ignorePiTags)) {
|
|
8473
|
-
let e = new
|
|
8477
|
+
let e = new Dr(t.tagName);
|
|
8474
8478
|
e.add(this.options.textNodeName, ""), t.tagName !== t.tagExp && t.attrExpPresent && (e[":@"] = this.buildAttributesMap(t.tagExp, this.matcher, t.tagName)), this.addChild(n, e, this.readonlyMatcher, a);
|
|
8475
8479
|
}
|
|
8476
8480
|
a = t.closeIndex + 1;
|
|
8477
8481
|
} else if (e.substr(a + 1, 3) === "!--") {
|
|
8478
|
-
let t =
|
|
8482
|
+
let t = ii(e, "-->", a + 4, "Comment is not closed.");
|
|
8479
8483
|
if (this.options.commentPropName) {
|
|
8480
8484
|
let i = e.substring(a + 4, t - 2);
|
|
8481
8485
|
r = this.saveTextToParentTag(r, n, this.readonlyMatcher), n.add(this.options.commentPropName, [{ [this.options.textNodeName]: i }]);
|
|
@@ -8485,25 +8489,25 @@ var Zr = function(e) {
|
|
|
8485
8489
|
let t = i.readDocType(e, a);
|
|
8486
8490
|
this.docTypeEntities = t.entities, a = t.i;
|
|
8487
8491
|
} else if (e.substr(a + 1, 2) === "![") {
|
|
8488
|
-
let t =
|
|
8492
|
+
let t = ii(e, "]]>", a, "CDATA is not closed.") - 2, i = e.substring(a + 9, t);
|
|
8489
8493
|
r = this.saveTextToParentTag(r, n, this.readonlyMatcher);
|
|
8490
8494
|
let o = this.parseTextData(i, n.tagname, this.readonlyMatcher, !0, !1, !0, !0);
|
|
8491
8495
|
o ??= "", this.options.cdataPropName ? n.add(this.options.cdataPropName, [{ [this.options.textNodeName]: i }]) : n.add(this.options.textNodeName, o), a = t + 2;
|
|
8492
8496
|
} else {
|
|
8493
|
-
let i =
|
|
8497
|
+
let i = ai(e, a, this.options.removeNSPrefix);
|
|
8494
8498
|
if (!i) {
|
|
8495
8499
|
let t = e.substring(Math.max(0, a - 50), Math.min(e.length, a + 50));
|
|
8496
8500
|
throw Error(`readTagExp returned undefined at position ${a}. Context: "${t}"`);
|
|
8497
8501
|
}
|
|
8498
8502
|
let o = i.tagName, s = i.rawTagName, c = i.tagExp, l = i.attrExpPresent, u = i.closeIndex;
|
|
8499
|
-
if ({tagName: o, tagExp: c} =
|
|
8503
|
+
if ({tagName: o, tagExp: c} = li(this.options.transformTagName, o, c, this.options), this.options.strictReservedNames && (o === this.options.commentPropName || o === this.options.cdataPropName || o === this.options.textNodeName || o === this.options.attributesGroupName)) throw Error(`Invalid tag name: ${o}`);
|
|
8500
8504
|
n && r && n.tagname !== "!xml" && (r = this.saveTextToParentTag(r, n, this.readonlyMatcher, !1));
|
|
8501
8505
|
let d = n;
|
|
8502
8506
|
d && this.options.unpairedTags.indexOf(d.tagname) !== -1 && (n = this.tagsNodeStack.pop(), this.matcher.pop());
|
|
8503
8507
|
let f = !1;
|
|
8504
8508
|
c.length > 0 && c.lastIndexOf("/") === c.length - 1 && (f = !0, o[o.length - 1] === "/" ? (o = o.substr(0, o.length - 1), c = o) : c = c.substr(0, c.length - 1), l = o !== c);
|
|
8505
8509
|
let p = null, m;
|
|
8506
|
-
m =
|
|
8510
|
+
m = Gr(s), o !== t.tagname && this.matcher.push(o, {}, m), o !== c && l && (p = this.buildAttributesMap(c, this.matcher, o), p && Wr(p, this.options)), o !== t.tagname && (this.isCurrentNodeStopNode = this.isItStopNode(this.stopNodeExpressions, this.matcher));
|
|
8507
8511
|
let h = a;
|
|
8508
8512
|
if (this.isCurrentNodeStopNode) {
|
|
8509
8513
|
let t = "";
|
|
@@ -8514,19 +8518,19 @@ var Zr = function(e) {
|
|
|
8514
8518
|
if (!n) throw Error(`Unexpected end of ${s}`);
|
|
8515
8519
|
a = n.i, t = n.tagContent;
|
|
8516
8520
|
}
|
|
8517
|
-
let r = new
|
|
8521
|
+
let r = new Dr(o);
|
|
8518
8522
|
p && (r[":@"] = p), r.add(this.options.textNodeName, t), this.matcher.pop(), this.isCurrentNodeStopNode = !1, this.addChild(n, r, this.readonlyMatcher, h);
|
|
8519
8523
|
} else {
|
|
8520
8524
|
if (f) {
|
|
8521
|
-
({tagName: o, tagExp: c} =
|
|
8522
|
-
let e = new
|
|
8525
|
+
({tagName: o, tagExp: c} = li(this.options.transformTagName, o, c, this.options));
|
|
8526
|
+
let e = new Dr(o);
|
|
8523
8527
|
p && (e[":@"] = p), this.addChild(n, e, this.readonlyMatcher, h), this.matcher.pop(), this.isCurrentNodeStopNode = !1;
|
|
8524
8528
|
} else if (this.options.unpairedTags.indexOf(o) !== -1) {
|
|
8525
|
-
let e = new
|
|
8529
|
+
let e = new Dr(o);
|
|
8526
8530
|
p && (e[":@"] = p), this.addChild(n, e, this.readonlyMatcher, h), this.matcher.pop(), this.isCurrentNodeStopNode = !1, a = i.closeIndex;
|
|
8527
8531
|
continue;
|
|
8528
8532
|
} else {
|
|
8529
|
-
let e = new
|
|
8533
|
+
let e = new Dr(o);
|
|
8530
8534
|
if (this.tagsNodeStack.length > this.options.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
8531
8535
|
this.tagsNodeStack.push(n), p && (e[":@"] = p), this.addChild(n, e, this.readonlyMatcher, h), n = e;
|
|
8532
8536
|
}
|
|
@@ -8536,12 +8540,12 @@ var Zr = function(e) {
|
|
|
8536
8540
|
else r += e[a];
|
|
8537
8541
|
return t.child;
|
|
8538
8542
|
};
|
|
8539
|
-
function
|
|
8543
|
+
function $r(e, t, n, r) {
|
|
8540
8544
|
this.options.captureMetaData || (r = void 0);
|
|
8541
8545
|
let i = this.options.jPath ? n.toString() : n, a = this.options.updateTag(t.tagname, i, t[":@"]);
|
|
8542
8546
|
a === !1 || (typeof a == "string" && (t.tagname = a), e.addChild(t, r));
|
|
8543
8547
|
}
|
|
8544
|
-
function
|
|
8548
|
+
function ei(e, t, n) {
|
|
8545
8549
|
let r = this.options.processEntities;
|
|
8546
8550
|
if (!r || !r.enabled) return e;
|
|
8547
8551
|
if (r.allowedTags) {
|
|
@@ -8573,15 +8577,15 @@ function $r(e, t, n) {
|
|
|
8573
8577
|
}
|
|
8574
8578
|
return e = e.replace(this.ampEntity.regex, this.ampEntity.val), e;
|
|
8575
8579
|
}
|
|
8576
|
-
function
|
|
8580
|
+
function ti(e, t, n, r) {
|
|
8577
8581
|
return e &&= (r === void 0 && (r = t.child.length === 0), e = this.parseTextData(e, t.tagname, n, !1, t[":@"] ? Object.keys(t[":@"]).length !== 0 : !1, r), e !== void 0 && e !== "" && t.add(this.options.textNodeName, e), ""), e;
|
|
8578
8582
|
}
|
|
8579
|
-
function
|
|
8583
|
+
function ni(e, t) {
|
|
8580
8584
|
if (!e || e.length === 0) return !1;
|
|
8581
8585
|
for (let n = 0; n < e.length; n++) if (t.matches(e[n])) return !0;
|
|
8582
8586
|
return !1;
|
|
8583
8587
|
}
|
|
8584
|
-
function
|
|
8588
|
+
function ri(e, t, n = ">") {
|
|
8585
8589
|
let r, i = "";
|
|
8586
8590
|
for (let a = t; a < e.length; a++) {
|
|
8587
8591
|
let t = e[a];
|
|
@@ -8600,13 +8604,13 @@ function ni(e, t, n = ">") {
|
|
|
8600
8604
|
i += t;
|
|
8601
8605
|
}
|
|
8602
8606
|
}
|
|
8603
|
-
function
|
|
8607
|
+
function ii(e, t, n, r) {
|
|
8604
8608
|
let i = e.indexOf(t, n);
|
|
8605
8609
|
if (i === -1) throw Error(r);
|
|
8606
8610
|
return i + t.length - 1;
|
|
8607
8611
|
}
|
|
8608
|
-
function
|
|
8609
|
-
let i =
|
|
8612
|
+
function ai(e, t, n, r = ">") {
|
|
8613
|
+
let i = ri(e, t + 1, r);
|
|
8610
8614
|
if (!i) return;
|
|
8611
8615
|
let a = i.data, o = i.index, s = a.search(/\s/), c = a, l = !0;
|
|
8612
8616
|
s !== -1 && (c = a.substring(0, s), a = a.substring(s + 1).trimStart());
|
|
@@ -8623,52 +8627,52 @@ function ii(e, t, n, r = ">") {
|
|
|
8623
8627
|
rawTagName: u
|
|
8624
8628
|
};
|
|
8625
8629
|
}
|
|
8626
|
-
function
|
|
8630
|
+
function oi(e, t, n) {
|
|
8627
8631
|
let r = n, i = 1;
|
|
8628
8632
|
for (; n < e.length; n++) if (e[n] === "<") if (e[n + 1] === "/") {
|
|
8629
|
-
let a =
|
|
8633
|
+
let a = ii(e, ">", n, `${t} is not closed`);
|
|
8630
8634
|
if (e.substring(n + 2, a).trim() === t && (i--, i === 0)) return {
|
|
8631
8635
|
tagContent: e.substring(r, n),
|
|
8632
8636
|
i: a
|
|
8633
8637
|
};
|
|
8634
8638
|
n = a;
|
|
8635
|
-
} else if (e[n + 1] === "?") n =
|
|
8636
|
-
else if (e.substr(n + 1, 3) === "!--") n =
|
|
8637
|
-
else if (e.substr(n + 1, 2) === "![") n =
|
|
8639
|
+
} else if (e[n + 1] === "?") n = ii(e, "?>", n + 1, "StopNode is not closed.");
|
|
8640
|
+
else if (e.substr(n + 1, 3) === "!--") n = ii(e, "-->", n + 3, "StopNode is not closed.");
|
|
8641
|
+
else if (e.substr(n + 1, 2) === "![") n = ii(e, "]]>", n, "StopNode is not closed.") - 2;
|
|
8638
8642
|
else {
|
|
8639
|
-
let r =
|
|
8643
|
+
let r = ai(e, n, ">");
|
|
8640
8644
|
r && ((r && r.tagName) === t && r.tagExp[r.tagExp.length - 1] !== "/" && i++, n = r.closeIndex);
|
|
8641
8645
|
}
|
|
8642
8646
|
}
|
|
8643
|
-
function
|
|
8647
|
+
function si(e, t, n) {
|
|
8644
8648
|
if (t && typeof e == "string") {
|
|
8645
8649
|
let t = e.trim();
|
|
8646
|
-
return t === "true" ? !0 : t === "false" ? !1 :
|
|
8647
|
-
} else if (
|
|
8650
|
+
return t === "true" ? !0 : t === "false" ? !1 : Pr(e, n);
|
|
8651
|
+
} else if (rr(e)) return e;
|
|
8648
8652
|
else return "";
|
|
8649
8653
|
}
|
|
8650
|
-
function
|
|
8654
|
+
function ci(e, t, n) {
|
|
8651
8655
|
let r = Number.parseInt(e, t);
|
|
8652
8656
|
return r >= 0 && r <= 1114111 ? String.fromCodePoint(r) : n + e + ";";
|
|
8653
8657
|
}
|
|
8654
|
-
function
|
|
8658
|
+
function li(e, t, n, r) {
|
|
8655
8659
|
if (e) {
|
|
8656
8660
|
let r = e(t);
|
|
8657
8661
|
n === t && (n = r), t = r;
|
|
8658
8662
|
}
|
|
8659
|
-
return t =
|
|
8663
|
+
return t = ui(t, r), {
|
|
8660
8664
|
tagName: t,
|
|
8661
8665
|
tagExp: n
|
|
8662
8666
|
};
|
|
8663
8667
|
}
|
|
8664
|
-
function
|
|
8665
|
-
if (
|
|
8666
|
-
return
|
|
8668
|
+
function ui(e, t) {
|
|
8669
|
+
if (ar.includes(e)) throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
8670
|
+
return ir.includes(e) ? t.onDangerousProperty(e) : e;
|
|
8667
8671
|
}
|
|
8668
8672
|
//#endregion
|
|
8669
8673
|
//#region node_modules/fast-xml-parser/src/xmlparser/node2json.js
|
|
8670
|
-
var
|
|
8671
|
-
function
|
|
8674
|
+
var di = Dr.getMetaDataSymbol();
|
|
8675
|
+
function fi(e, t) {
|
|
8672
8676
|
if (!e || typeof e != "object") return {};
|
|
8673
8677
|
if (!t) return e;
|
|
8674
8678
|
let n = {};
|
|
@@ -8678,22 +8682,22 @@ function di(e, t) {
|
|
|
8678
8682
|
} else n[r] = e[r];
|
|
8679
8683
|
return n;
|
|
8680
8684
|
}
|
|
8681
|
-
function fi(e, t, n, r) {
|
|
8682
|
-
return pi(e, t, n, r);
|
|
8683
|
-
}
|
|
8684
8685
|
function pi(e, t, n, r) {
|
|
8686
|
+
return mi(e, t, n, r);
|
|
8687
|
+
}
|
|
8688
|
+
function mi(e, t, n, r) {
|
|
8685
8689
|
let i, a = {};
|
|
8686
8690
|
for (let o = 0; o < e.length; o++) {
|
|
8687
|
-
let s = e[o], c =
|
|
8691
|
+
let s = e[o], c = hi(s);
|
|
8688
8692
|
if (c !== void 0 && c !== t.textNodeName) {
|
|
8689
|
-
let e =
|
|
8693
|
+
let e = fi(s[":@"] || {}, t.attributeNamePrefix);
|
|
8690
8694
|
n.push(c, e);
|
|
8691
8695
|
}
|
|
8692
8696
|
if (c === t.textNodeName) i === void 0 ? i = s[c] : i += "" + s[c];
|
|
8693
8697
|
else if (c === void 0) continue;
|
|
8694
8698
|
else if (s[c]) {
|
|
8695
|
-
let e =
|
|
8696
|
-
if (s[":@"] ?
|
|
8699
|
+
let e = mi(s[c], t, n, r), i = _i(e, t);
|
|
8700
|
+
if (s[":@"] ? gi(e, s[":@"], r, t) : Object.keys(e).length === 1 && e[t.textNodeName] !== void 0 && !t.alwaysCreateTextNode ? e = e[t.textNodeName] : Object.keys(e).length === 0 && (t.alwaysCreateTextNode ? e[t.textNodeName] = "" : e = ""), s[di] !== void 0 && typeof e == "object" && e && (e[di] = s[di]), a[c] !== void 0 && Object.prototype.hasOwnProperty.call(a, c)) Array.isArray(a[c]) || (a[c] = [a[c]]), a[c].push(e);
|
|
8697
8701
|
else {
|
|
8698
8702
|
let n = t.jPath ? r.toString() : r;
|
|
8699
8703
|
t.isArray(c, n, i) ? a[c] = [e] : a[c] = e;
|
|
@@ -8703,14 +8707,14 @@ function pi(e, t, n, r) {
|
|
|
8703
8707
|
}
|
|
8704
8708
|
return typeof i == "string" ? i.length > 0 && (a[t.textNodeName] = i) : i !== void 0 && (a[t.textNodeName] = i), a;
|
|
8705
8709
|
}
|
|
8706
|
-
function
|
|
8710
|
+
function hi(e) {
|
|
8707
8711
|
let t = Object.keys(e);
|
|
8708
8712
|
for (let e = 0; e < t.length; e++) {
|
|
8709
8713
|
let n = t[e];
|
|
8710
8714
|
if (n !== ":@") return n;
|
|
8711
8715
|
}
|
|
8712
8716
|
}
|
|
8713
|
-
function
|
|
8717
|
+
function gi(e, t, n, r) {
|
|
8714
8718
|
if (t) {
|
|
8715
8719
|
let i = Object.keys(t), a = i.length;
|
|
8716
8720
|
for (let o = 0; o < a; o++) {
|
|
@@ -8719,28 +8723,28 @@ function hi(e, t, n, r) {
|
|
|
8719
8723
|
}
|
|
8720
8724
|
}
|
|
8721
8725
|
}
|
|
8722
|
-
function
|
|
8726
|
+
function _i(e, t) {
|
|
8723
8727
|
let { textNodeName: n } = t, r = Object.keys(e).length;
|
|
8724
8728
|
return !!(r === 0 || r === 1 && (e[n] || typeof e[n] == "boolean" || e[n] === 0));
|
|
8725
8729
|
}
|
|
8726
8730
|
//#endregion
|
|
8727
8731
|
//#region node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
|
|
8728
|
-
var
|
|
8732
|
+
var vi = class {
|
|
8729
8733
|
constructor(e) {
|
|
8730
|
-
this.externalEntities = {}, this.options =
|
|
8734
|
+
this.externalEntities = {}, this.options = Tr(e);
|
|
8731
8735
|
}
|
|
8732
8736
|
parse(e, t) {
|
|
8733
8737
|
if (typeof e != "string" && e.toString) e = e.toString();
|
|
8734
8738
|
else if (typeof e != "string") throw Error("XML data is accepted in String or Bytes[] form.");
|
|
8735
8739
|
if (t) {
|
|
8736
8740
|
t === !0 && (t = {});
|
|
8737
|
-
let n =
|
|
8741
|
+
let n = sr(e, t);
|
|
8738
8742
|
if (n !== !0) throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
|
|
8739
8743
|
}
|
|
8740
|
-
let n = new
|
|
8744
|
+
let n = new Kr(this.options);
|
|
8741
8745
|
n.addExternalEntities(this.externalEntities);
|
|
8742
8746
|
let r = n.parseXml(e);
|
|
8743
|
-
return this.options.preserveOrder || r === void 0 ? r :
|
|
8747
|
+
return this.options.preserveOrder || r === void 0 ? r : pi(r, this.options, n.matcher, n.readonlyMatcher);
|
|
8744
8748
|
}
|
|
8745
8749
|
addEntity(e, t) {
|
|
8746
8750
|
if (t.indexOf("&") !== -1) throw Error("Entity value can't have '&'");
|
|
@@ -8749,39 +8753,39 @@ var _i = class {
|
|
|
8749
8753
|
this.externalEntities[e] = t;
|
|
8750
8754
|
}
|
|
8751
8755
|
static getMetaDataSymbol() {
|
|
8752
|
-
return
|
|
8756
|
+
return Dr.getMetaDataSymbol();
|
|
8753
8757
|
}
|
|
8754
|
-
},
|
|
8755
|
-
function
|
|
8758
|
+
}, yi = "\n";
|
|
8759
|
+
function bi(e, t) {
|
|
8756
8760
|
let n = "";
|
|
8757
|
-
t.format && t.indentBy.length > 0 && (n =
|
|
8761
|
+
t.format && t.indentBy.length > 0 && (n = yi);
|
|
8758
8762
|
let r = [];
|
|
8759
8763
|
if (t.stopNodes && Array.isArray(t.stopNodes)) for (let e = 0; e < t.stopNodes.length; e++) {
|
|
8760
8764
|
let n = t.stopNodes[e];
|
|
8761
|
-
typeof n == "string" ? r.push(new
|
|
8765
|
+
typeof n == "string" ? r.push(new Vr(n)) : n instanceof Vr && r.push(n);
|
|
8762
8766
|
}
|
|
8763
|
-
let i = new
|
|
8764
|
-
return
|
|
8767
|
+
let i = new Ur();
|
|
8768
|
+
return xi(e, t, n, i, r);
|
|
8765
8769
|
}
|
|
8766
|
-
function
|
|
8770
|
+
function xi(e, t, n, r, i) {
|
|
8767
8771
|
let a = "", o = !1;
|
|
8768
8772
|
if (t.maxNestedTags && r.getDepth() > t.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
8769
8773
|
if (!Array.isArray(e)) {
|
|
8770
8774
|
if (e != null) {
|
|
8771
8775
|
let n = e.toString();
|
|
8772
|
-
return n =
|
|
8776
|
+
return n = Oi(n, t), n;
|
|
8773
8777
|
}
|
|
8774
8778
|
return "";
|
|
8775
8779
|
}
|
|
8776
8780
|
for (let s = 0; s < e.length; s++) {
|
|
8777
|
-
let c = e[s], l =
|
|
8781
|
+
let c = e[s], l = Ti(c);
|
|
8778
8782
|
if (l === void 0) continue;
|
|
8779
|
-
let u =
|
|
8783
|
+
let u = Si(c[":@"], t);
|
|
8780
8784
|
r.push(l, u);
|
|
8781
|
-
let d =
|
|
8785
|
+
let d = Di(r, i);
|
|
8782
8786
|
if (l === t.textNodeName) {
|
|
8783
8787
|
let e = c[l];
|
|
8784
|
-
d || (e = t.tagValueProcessor(l, e), e =
|
|
8788
|
+
d || (e = t.tagValueProcessor(l, e), e = Oi(e, t)), o && (a += n), a += e, o = !1, r.pop();
|
|
8785
8789
|
continue;
|
|
8786
8790
|
} else if (l === t.cdataPropName) {
|
|
8787
8791
|
o && (a += n), a += `<![CDATA[${c[l][0][t.textNodeName]}]]>`, o = !1, r.pop();
|
|
@@ -8790,18 +8794,18 @@ function bi(e, t, n, r, i) {
|
|
|
8790
8794
|
a += n + `<!--${c[l][0][t.textNodeName]}-->`, o = !0, r.pop();
|
|
8791
8795
|
continue;
|
|
8792
8796
|
} else if (l[0] === "?") {
|
|
8793
|
-
let e =
|
|
8797
|
+
let e = Ei(c[":@"], t, d), i = l === "?xml" ? "" : n, s = c[l][0][t.textNodeName];
|
|
8794
8798
|
s = s.length === 0 ? "" : " " + s, a += i + `<${l}${s}${e}?>`, o = !0, r.pop();
|
|
8795
8799
|
continue;
|
|
8796
8800
|
}
|
|
8797
8801
|
let f = n;
|
|
8798
8802
|
f !== "" && (f += t.indentBy);
|
|
8799
|
-
let p = n + `<${l}${
|
|
8800
|
-
m = d ?
|
|
8803
|
+
let p = n + `<${l}${Ei(c[":@"], t, d)}`, m;
|
|
8804
|
+
m = d ? Ci(c[l], t) : xi(c[l], t, f, r, i), t.unpairedTags.indexOf(l) === -1 ? (!m || m.length === 0) && t.suppressEmptyNode ? a += p + "/>" : m && m.endsWith(">") ? a += p + `>${m}${n}</${l}>` : (a += p + ">", m && n !== "" && (m.includes("/>") || m.includes("</")) ? a += n + t.indentBy + m + n : a += m, a += `</${l}>`) : t.suppressUnpairedNode ? a += p + ">" : a += p + "/>", o = !0, r.pop();
|
|
8801
8805
|
}
|
|
8802
8806
|
return a;
|
|
8803
8807
|
}
|
|
8804
|
-
function
|
|
8808
|
+
function Si(e, t) {
|
|
8805
8809
|
if (!e || t.ignoreAttributes) return null;
|
|
8806
8810
|
let n = {}, r = !1;
|
|
8807
8811
|
for (let i in e) {
|
|
@@ -8811,23 +8815,23 @@ function xi(e, t) {
|
|
|
8811
8815
|
}
|
|
8812
8816
|
return r ? n : null;
|
|
8813
8817
|
}
|
|
8814
|
-
function
|
|
8818
|
+
function Ci(e, t) {
|
|
8815
8819
|
if (!Array.isArray(e)) return e == null ? "" : e.toString();
|
|
8816
8820
|
let n = "";
|
|
8817
8821
|
for (let r = 0; r < e.length; r++) {
|
|
8818
|
-
let i = e[r], a =
|
|
8822
|
+
let i = e[r], a = Ti(i);
|
|
8819
8823
|
if (a === t.textNodeName) n += i[a];
|
|
8820
8824
|
else if (a === t.cdataPropName) n += i[a][0][t.textNodeName];
|
|
8821
8825
|
else if (a === t.commentPropName) n += i[a][0][t.textNodeName];
|
|
8822
8826
|
else if (a && a[0] === "?") continue;
|
|
8823
8827
|
else if (a) {
|
|
8824
|
-
let e =
|
|
8828
|
+
let e = wi(i[":@"], t), r = Ci(i[a], t);
|
|
8825
8829
|
!r || r.length === 0 ? n += `<${a}${e}/>` : n += `<${a}${e}>${r}</${a}>`;
|
|
8826
8830
|
}
|
|
8827
8831
|
}
|
|
8828
8832
|
return n;
|
|
8829
8833
|
}
|
|
8830
|
-
function
|
|
8834
|
+
function wi(e, t) {
|
|
8831
8835
|
let n = "";
|
|
8832
8836
|
if (e && !t.ignoreAttributes) for (let r in e) {
|
|
8833
8837
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
@@ -8836,28 +8840,28 @@ function Ci(e, t) {
|
|
|
8836
8840
|
}
|
|
8837
8841
|
return n;
|
|
8838
8842
|
}
|
|
8839
|
-
function
|
|
8843
|
+
function Ti(e) {
|
|
8840
8844
|
let t = Object.keys(e);
|
|
8841
8845
|
for (let n = 0; n < t.length; n++) {
|
|
8842
8846
|
let r = t[n];
|
|
8843
8847
|
if (Object.prototype.hasOwnProperty.call(e, r) && r !== ":@") return r;
|
|
8844
8848
|
}
|
|
8845
8849
|
}
|
|
8846
|
-
function
|
|
8850
|
+
function Ei(e, t, n) {
|
|
8847
8851
|
let r = "";
|
|
8848
8852
|
if (e && !t.ignoreAttributes) for (let i in e) {
|
|
8849
8853
|
if (!Object.prototype.hasOwnProperty.call(e, i)) continue;
|
|
8850
8854
|
let a;
|
|
8851
|
-
n ? a = e[i] : (a = t.attributeValueProcessor(i, e[i]), a =
|
|
8855
|
+
n ? a = e[i] : (a = t.attributeValueProcessor(i, e[i]), a = Oi(a, t)), a === !0 && t.suppressBooleanAttributes ? r += ` ${i.substr(t.attributeNamePrefix.length)}` : r += ` ${i.substr(t.attributeNamePrefix.length)}="${a}"`;
|
|
8852
8856
|
}
|
|
8853
8857
|
return r;
|
|
8854
8858
|
}
|
|
8855
|
-
function
|
|
8859
|
+
function Di(e, t) {
|
|
8856
8860
|
if (!t || t.length === 0) return !1;
|
|
8857
8861
|
for (let n = 0; n < t.length; n++) if (e.matches(t[n])) return !0;
|
|
8858
8862
|
return !1;
|
|
8859
8863
|
}
|
|
8860
|
-
function
|
|
8864
|
+
function Oi(e, t) {
|
|
8861
8865
|
if (e && e.length > 0 && t.processEntities) for (let n = 0; n < t.entities.length; n++) {
|
|
8862
8866
|
let r = t.entities[n];
|
|
8863
8867
|
e = e.replace(r.regex, r.val);
|
|
@@ -8866,14 +8870,14 @@ function Di(e, t) {
|
|
|
8866
8870
|
}
|
|
8867
8871
|
//#endregion
|
|
8868
8872
|
//#region node_modules/fast-xml-builder/src/ignoreAttributes.js
|
|
8869
|
-
function
|
|
8873
|
+
function ki(e) {
|
|
8870
8874
|
return typeof e == "function" ? e : Array.isArray(e) ? (t) => {
|
|
8871
8875
|
for (let n of e) if (typeof n == "string" && t === n || n instanceof RegExp && n.test(t)) return !0;
|
|
8872
8876
|
} : () => !1;
|
|
8873
8877
|
}
|
|
8874
8878
|
//#endregion
|
|
8875
8879
|
//#region node_modules/fast-xml-builder/src/fxb.js
|
|
8876
|
-
var
|
|
8880
|
+
var Ai = {
|
|
8877
8881
|
attributeNamePrefix: "@_",
|
|
8878
8882
|
attributesGroupName: !1,
|
|
8879
8883
|
textNodeName: "#text",
|
|
@@ -8921,25 +8925,25 @@ var ki = {
|
|
|
8921
8925
|
maxNestedTags: 100,
|
|
8922
8926
|
jPath: !0
|
|
8923
8927
|
};
|
|
8924
|
-
function
|
|
8925
|
-
if (this.options = Object.assign({},
|
|
8928
|
+
function ji(e) {
|
|
8929
|
+
if (this.options = Object.assign({}, Ai, e), this.options.stopNodes && Array.isArray(this.options.stopNodes) && (this.options.stopNodes = this.options.stopNodes.map((e) => typeof e == "string" && e.startsWith("*.") ? ".." + e.substring(2) : e)), this.stopNodeExpressions = [], this.options.stopNodes && Array.isArray(this.options.stopNodes)) for (let e = 0; e < this.options.stopNodes.length; e++) {
|
|
8926
8930
|
let t = this.options.stopNodes[e];
|
|
8927
|
-
typeof t == "string" ? this.stopNodeExpressions.push(new
|
|
8931
|
+
typeof t == "string" ? this.stopNodeExpressions.push(new Vr(t)) : t instanceof Vr && this.stopNodeExpressions.push(t);
|
|
8928
8932
|
}
|
|
8929
8933
|
this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
8930
8934
|
return !1;
|
|
8931
|
-
} : (this.ignoreAttributesFn =
|
|
8935
|
+
} : (this.ignoreAttributesFn = ki(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Pi), this.processTextOrObjNode = Mi, this.options.format ? (this.indentate = Ni, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
|
|
8932
8936
|
return "";
|
|
8933
8937
|
}, this.tagEndChar = ">", this.newLine = "");
|
|
8934
8938
|
}
|
|
8935
|
-
|
|
8936
|
-
if (this.options.preserveOrder) return
|
|
8939
|
+
ji.prototype.build = function(e) {
|
|
8940
|
+
if (this.options.preserveOrder) return bi(e, this.options);
|
|
8937
8941
|
{
|
|
8938
8942
|
Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e = { [this.options.arrayNodeName]: e });
|
|
8939
|
-
let t = new
|
|
8943
|
+
let t = new Ur();
|
|
8940
8944
|
return this.j2x(e, 0, t).val;
|
|
8941
8945
|
}
|
|
8942
|
-
},
|
|
8946
|
+
}, ji.prototype.j2x = function(e, t, n) {
|
|
8943
8947
|
let r = "", i = "";
|
|
8944
8948
|
if (this.options.maxNestedTags && n.getDepth() >= this.options.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
8945
8949
|
let a = this.options.jPath ? n.toString() : n, o = this.checkStopNode(n);
|
|
@@ -8991,10 +8995,10 @@ Ai.prototype.build = function(e) {
|
|
|
8991
8995
|
attrStr: r,
|
|
8992
8996
|
val: i
|
|
8993
8997
|
};
|
|
8994
|
-
},
|
|
8998
|
+
}, ji.prototype.buildAttrPairStr = function(e, t, n) {
|
|
8995
8999
|
return n || (t = this.options.attributeValueProcessor(e, "" + t), t = this.replaceEntitiesValue(t)), this.options.suppressBooleanAttributes && t === "true" ? " " + e : " " + e + "=\"" + t + "\"";
|
|
8996
9000
|
};
|
|
8997
|
-
function
|
|
9001
|
+
function Mi(e, t, n, r) {
|
|
8998
9002
|
let i = this.extractAttributes(e);
|
|
8999
9003
|
if (r.push(t, i), this.checkStopNode(r)) {
|
|
9000
9004
|
let i = this.buildRawContent(e), a = this.buildAttributesForStopNode(e);
|
|
@@ -9003,7 +9007,7 @@ function ji(e, t, n, r) {
|
|
|
9003
9007
|
let a = this.j2x(e, n + 1, r);
|
|
9004
9008
|
return r.pop(), e[this.options.textNodeName] !== void 0 && Object.keys(e).length === 1 ? this.buildTextValNode(e[this.options.textNodeName], t, a.attrStr, n, r) : this.buildObjectNode(a.val, t, a.attrStr, n);
|
|
9005
9009
|
}
|
|
9006
|
-
|
|
9010
|
+
ji.prototype.extractAttributes = function(e) {
|
|
9007
9011
|
if (!e || typeof e != "object") return null;
|
|
9008
9012
|
let t = {}, n = !1;
|
|
9009
9013
|
if (this.options.attributesGroupName && e[this.options.attributesGroupName]) {
|
|
@@ -9019,7 +9023,7 @@ Ai.prototype.extractAttributes = function(e) {
|
|
|
9019
9023
|
i && (t[i] = e[r], n = !0);
|
|
9020
9024
|
}
|
|
9021
9025
|
return n ? t : null;
|
|
9022
|
-
},
|
|
9026
|
+
}, ji.prototype.buildRawContent = function(e) {
|
|
9023
9027
|
if (typeof e == "string") return e;
|
|
9024
9028
|
if (typeof e != "object" || !e) return String(e);
|
|
9025
9029
|
if (e[this.options.textNodeName] !== void 0) return e[this.options.textNodeName];
|
|
@@ -9040,7 +9044,7 @@ Ai.prototype.extractAttributes = function(e) {
|
|
|
9040
9044
|
} else t += `<${n}>${r}</${n}>`;
|
|
9041
9045
|
}
|
|
9042
9046
|
return t;
|
|
9043
|
-
},
|
|
9047
|
+
}, ji.prototype.buildAttributesForStopNode = function(e) {
|
|
9044
9048
|
if (!e || typeof e != "object") return "";
|
|
9045
9049
|
let t = "";
|
|
9046
9050
|
if (this.options.attributesGroupName && e[this.options.attributesGroupName]) {
|
|
@@ -9059,20 +9063,20 @@ Ai.prototype.extractAttributes = function(e) {
|
|
|
9059
9063
|
}
|
|
9060
9064
|
}
|
|
9061
9065
|
return t;
|
|
9062
|
-
},
|
|
9066
|
+
}, ji.prototype.buildObjectNode = function(e, t, n, r) {
|
|
9063
9067
|
if (e === "") return t[0] === "?" ? this.indentate(r) + "<" + t + n + "?" + this.tagEndChar : this.indentate(r) + "<" + t + n + this.closeTag(t) + this.tagEndChar;
|
|
9064
9068
|
{
|
|
9065
9069
|
let i = "</" + t + this.tagEndChar, a = "";
|
|
9066
9070
|
return t[0] === "?" && (a = "?", i = ""), (n || n === "") && e.indexOf("<") === -1 ? this.indentate(r) + "<" + t + n + a + ">" + e + i : this.options.commentPropName !== !1 && t === this.options.commentPropName && a.length === 0 ? this.indentate(r) + `<!--${e}-->` + this.newLine : this.indentate(r) + "<" + t + n + a + this.tagEndChar + e + this.indentate(r) + i;
|
|
9067
9071
|
}
|
|
9068
|
-
},
|
|
9072
|
+
}, ji.prototype.closeTag = function(e) {
|
|
9069
9073
|
let t = "";
|
|
9070
9074
|
return this.options.unpairedTags.indexOf(e) === -1 ? t = this.options.suppressEmptyNode ? "/" : `></${e}` : this.options.suppressUnpairedNode || (t = "/"), t;
|
|
9071
|
-
},
|
|
9075
|
+
}, ji.prototype.checkStopNode = function(e) {
|
|
9072
9076
|
if (!this.stopNodeExpressions || this.stopNodeExpressions.length === 0) return !1;
|
|
9073
9077
|
for (let t = 0; t < this.stopNodeExpressions.length; t++) if (e.matches(this.stopNodeExpressions[t])) return !0;
|
|
9074
9078
|
return !1;
|
|
9075
|
-
},
|
|
9079
|
+
}, ji.prototype.buildTextValNode = function(e, t, n, r, i) {
|
|
9076
9080
|
if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName) return this.indentate(r) + `<![CDATA[${e}]]>` + this.newLine;
|
|
9077
9081
|
if (this.options.commentPropName !== !1 && t === this.options.commentPropName) return this.indentate(r) + `<!--${e}-->` + this.newLine;
|
|
9078
9082
|
if (t[0] === "?") return this.indentate(r) + "<" + t + n + "?" + this.tagEndChar;
|
|
@@ -9080,28 +9084,28 @@ Ai.prototype.extractAttributes = function(e) {
|
|
|
9080
9084
|
let i = this.options.tagValueProcessor(t, e);
|
|
9081
9085
|
return i = this.replaceEntitiesValue(i), i === "" ? this.indentate(r) + "<" + t + n + this.closeTag(t) + this.tagEndChar : this.indentate(r) + "<" + t + n + ">" + i + "</" + t + this.tagEndChar;
|
|
9082
9086
|
}
|
|
9083
|
-
},
|
|
9087
|
+
}, ji.prototype.replaceEntitiesValue = function(e) {
|
|
9084
9088
|
if (e && e.length > 0 && this.options.processEntities) for (let t = 0; t < this.options.entities.length; t++) {
|
|
9085
9089
|
let n = this.options.entities[t];
|
|
9086
9090
|
e = e.replace(n.regex, n.val);
|
|
9087
9091
|
}
|
|
9088
9092
|
return e;
|
|
9089
9093
|
};
|
|
9090
|
-
function
|
|
9094
|
+
function Ni(e) {
|
|
9091
9095
|
return this.options.indentBy.repeat(e);
|
|
9092
9096
|
}
|
|
9093
|
-
function
|
|
9097
|
+
function Pi(e) {
|
|
9094
9098
|
return e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName ? e.substr(this.attrPrefixLen) : !1;
|
|
9095
9099
|
}
|
|
9096
9100
|
//#endregion
|
|
9097
9101
|
//#region node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js
|
|
9098
|
-
var
|
|
9102
|
+
var Fi = ji, Ii = /* @__PURE__ */ a(({ fillMode: e = "preserve", svg: t, shouldStripClasses: n = !0, shouldStripIds: r = !0, shouldStripPositions: i = !0, shouldStripStyles: a = !0, ...o }, s) => {
|
|
9099
9103
|
let c = ["id"].map((e) => `@_${e}`), l = ["class"].map((e) => `@_${e}`), u = [
|
|
9100
9104
|
"fill",
|
|
9101
9105
|
"stroke",
|
|
9102
9106
|
"style"
|
|
9103
9107
|
].map((e) => `@_${e}`), d = ["x", "y"].map((e) => `@_${e}`), f = () => {
|
|
9104
|
-
let o = new
|
|
9108
|
+
let o = new vi({
|
|
9105
9109
|
attributeNamePrefix: "@_",
|
|
9106
9110
|
ignoreAttributes: !1,
|
|
9107
9111
|
ignoreDeclaration: !0,
|
|
@@ -9126,7 +9130,7 @@ var Pi = Ai, Fi = /* @__PURE__ */ a(({ fillMode: e = "preserve", svg: t, shouldS
|
|
|
9126
9130
|
}
|
|
9127
9131
|
return t;
|
|
9128
9132
|
}
|
|
9129
|
-
}), s = new
|
|
9133
|
+
}), s = new Fi({
|
|
9130
9134
|
attributeNamePrefix: "@_",
|
|
9131
9135
|
format: !1,
|
|
9132
9136
|
ignoreAttributes: !1
|
|
@@ -9139,20 +9143,20 @@ var Pi = Ai, Fi = /* @__PURE__ */ a(({ fillMode: e = "preserve", svg: t, shouldS
|
|
|
9139
9143
|
dangerouslySetInnerHTML: { __html: f() }
|
|
9140
9144
|
});
|
|
9141
9145
|
});
|
|
9142
|
-
process.env.NODE_ENV === "development" && (
|
|
9146
|
+
process.env.NODE_ENV === "development" && (Ii.displayName = "FlatSVG");
|
|
9143
9147
|
//#endregion
|
|
9144
9148
|
//#region src/primitives/Form.tsx
|
|
9145
|
-
var
|
|
9149
|
+
var Li = /* @__PURE__ */ a(({ onSubmit: e, ...t }, n) => /* @__PURE__ */ (0, D.jsx)("form", {
|
|
9146
9150
|
...t,
|
|
9147
9151
|
ref: n,
|
|
9148
9152
|
onSubmit: (t) => {
|
|
9149
9153
|
t.preventDefault(), e();
|
|
9150
9154
|
}
|
|
9151
9155
|
}));
|
|
9152
|
-
process.env.NODE_ENV !== "production" && (
|
|
9156
|
+
process.env.NODE_ENV !== "production" && (Li.displayName = "Form");
|
|
9153
9157
|
//#endregion
|
|
9154
9158
|
//#region src/primitives/MasonryGrid.tsx
|
|
9155
|
-
var
|
|
9159
|
+
var Ri = "base-", zi = /* @__PURE__ */ a(({ className: e, alignSections: t = !1, children: n, horizontalSpacing: r = 0, orientation: i = "vertical", sections: a = 3, verticalSpacing: o = 0, isReversed: l = !1, ...u }, p) => {
|
|
9156
9160
|
let m = d(null), [h, g] = f(NaN), [_, v] = f(NaN), [y, b] = f(NaN), [x, S] = f(NaN), w = () => K.from(m.current).width, T = () => K.from(m.current).height, E = () => {
|
|
9157
9161
|
let e = m.current;
|
|
9158
9162
|
if (!e) return;
|
|
@@ -9165,29 +9169,29 @@ var Li = "base-", Ri = /* @__PURE__ */ a(({ className: e, alignSections: t = !1,
|
|
|
9165
9169
|
let i = [...Array(s)].map(() => 0);
|
|
9166
9170
|
for (let e of Array.from(n)) {
|
|
9167
9171
|
if (!(e instanceof HTMLElement)) continue;
|
|
9168
|
-
let n =
|
|
9172
|
+
let n = Wi(e, a), [c, l] = Hi(i, n);
|
|
9169
9173
|
e.role = "gridcell", e.style.position = "absolute", e.style.width = `calc(${100 / s * n}% - ${r * (s - 1) / s * n}px + ${r * (n - 1)}px)`, e.style.height = "", e.style.left = `calc(${100 / s * c}% - ${r * (s - 1) / s * c}px + ${r * c}px)`, e.style.top = `${l + (l === 0 ? 0 : o)}px`;
|
|
9170
9174
|
for (let t = 0; t < n; t++) i[c + t] = l + (l === 0 ? 0 : o) + K.from(e).height;
|
|
9171
9175
|
if (t && c + n === s) {
|
|
9172
|
-
let e =
|
|
9176
|
+
let e = Ui(i);
|
|
9173
9177
|
for (let t = 0; t < s; t++) i[t] = e;
|
|
9174
9178
|
}
|
|
9175
9179
|
}
|
|
9176
|
-
let c = w(), u =
|
|
9180
|
+
let c = w(), u = Ui(i, s);
|
|
9177
9181
|
if (g(c), v(u), isNaN(u) || (e.style.height = `${u}px`), l) for (let e of Array.from(n)) e instanceof HTMLElement && (e.style.left = `calc(${c}px - ${e.style.left} - ${e.getBoundingClientRect().width}px)`);
|
|
9178
9182
|
} else {
|
|
9179
9183
|
let i = [...Array(s)].map(() => 0);
|
|
9180
9184
|
for (let e of Array.from(n)) {
|
|
9181
9185
|
if (!(e instanceof HTMLElement)) continue;
|
|
9182
|
-
let n =
|
|
9186
|
+
let n = Wi(e, a), [c, l] = Hi(i, n);
|
|
9183
9187
|
e.style.position = "absolute", e.style.width = "", e.style.height = `calc(${100 / s * n}% - ${o * (s - 1) / s * n}px + ${o * (n - 1)}px)`, e.style.top = `calc(${100 / s * c}% - ${o * (s - 1) / s * c}px + ${o * c}px)`, e.style.left = `${l + (l === 0 ? 0 : r)}px`;
|
|
9184
9188
|
for (let t = 0; t < n; t++) i[c + t] = l + (l === 0 ? 0 : r) + K.from(e).width;
|
|
9185
9189
|
if (t && c + n === s) {
|
|
9186
|
-
let e =
|
|
9190
|
+
let e = Ui(i);
|
|
9187
9191
|
for (let t = 0; t < s; t++) i[t] = e;
|
|
9188
9192
|
}
|
|
9189
9193
|
}
|
|
9190
|
-
let c = T(), u =
|
|
9194
|
+
let c = T(), u = Ui(i, s);
|
|
9191
9195
|
if (v(c), g(u), isNaN(u) || (e.style.width = `${u}px`), l) for (let e of Array.from(n)) e instanceof HTMLElement && (e.style.top = `calc(${c}px - ${e.style.top} - ${e.getBoundingClientRect().height}px)`);
|
|
9192
9196
|
}
|
|
9193
9197
|
};
|
|
@@ -9202,7 +9206,7 @@ var Li = "base-", Ri = /* @__PURE__ */ a(({ className: e, alignSections: t = !1,
|
|
|
9202
9206
|
o,
|
|
9203
9207
|
i
|
|
9204
9208
|
])), c(() => {
|
|
9205
|
-
let e =
|
|
9209
|
+
let e = Gi(m.current?.innerHTML);
|
|
9206
9210
|
if (e.length === 0) return E();
|
|
9207
9211
|
let t = e.length;
|
|
9208
9212
|
for (let n = 0; n < t; n++) {
|
|
@@ -9210,7 +9214,7 @@ var Li = "base-", Ri = /* @__PURE__ */ a(({ className: e, alignSections: t = !1,
|
|
|
9210
9214
|
r.src = t, r.onload = () => E();
|
|
9211
9215
|
}
|
|
9212
9216
|
}, [n]);
|
|
9213
|
-
let O =
|
|
9217
|
+
let O = Bi({ orientation: i }), k = Vi({
|
|
9214
9218
|
minHeight: _,
|
|
9215
9219
|
minWidth: h,
|
|
9216
9220
|
orientation: i
|
|
@@ -9227,10 +9231,10 @@ var Li = "base-", Ri = /* @__PURE__ */ a(({ className: e, alignSections: t = !1,
|
|
|
9227
9231
|
})
|
|
9228
9232
|
});
|
|
9229
9233
|
});
|
|
9230
|
-
function
|
|
9234
|
+
function Bi({ orientation: e = "horizontal" }) {
|
|
9231
9235
|
return k({ root: C(e) });
|
|
9232
9236
|
}
|
|
9233
|
-
function
|
|
9237
|
+
function Vi({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizontal" }) {
|
|
9234
9238
|
return j({ body: {
|
|
9235
9239
|
height: n === "horizontal" ? "100%" : "auto",
|
|
9236
9240
|
minHeight: n === "vertical" && !isNaN(e) ? `${e}px` : "",
|
|
@@ -9239,28 +9243,28 @@ function Bi({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizonta
|
|
|
9239
9243
|
width: n === "horizontal" ? "auto" : "100%"
|
|
9240
9244
|
} });
|
|
9241
9245
|
}
|
|
9242
|
-
function
|
|
9246
|
+
function Hi(e, t) {
|
|
9243
9247
|
let n = e.length, r = NaN, i = Infinity;
|
|
9244
9248
|
for (let a = 0; a < n; a++) {
|
|
9245
9249
|
let o = e[a], s = o < i, c = a + t <= n, l = !0;
|
|
9246
9250
|
for (let n = 1; n < t; n++) e[a + n] > o && (l = !1);
|
|
9247
9251
|
s && c && l && (r = a, i = o);
|
|
9248
9252
|
}
|
|
9249
|
-
return isNaN(r) ? [0,
|
|
9253
|
+
return isNaN(r) ? [0, Ui(e, t)] : [r, i];
|
|
9250
9254
|
}
|
|
9251
|
-
function
|
|
9255
|
+
function Ui(e, t) {
|
|
9252
9256
|
let n = e;
|
|
9253
9257
|
return t != null && !isNaN(t) && (n = n.slice(0, Math.max(1, Math.min(t, e.length)))), n.reduce((e, t, n) => t > e ? t : e, 0);
|
|
9254
9258
|
}
|
|
9255
|
-
function
|
|
9259
|
+
function Wi(e, t) {
|
|
9256
9260
|
let n = e.classList;
|
|
9257
|
-
for (let e of Array.from(n)) if (e.startsWith(
|
|
9258
|
-
let n = parseFloat(e.replace(
|
|
9261
|
+
for (let e of Array.from(n)) if (e.startsWith(Ri)) {
|
|
9262
|
+
let n = parseFloat(e.replace(Ri, ""));
|
|
9259
9263
|
if (!isNaN(n)) return Math.min(Math.max(n, 1), t);
|
|
9260
9264
|
}
|
|
9261
9265
|
return 1;
|
|
9262
9266
|
}
|
|
9263
|
-
function
|
|
9267
|
+
function Gi(e) {
|
|
9264
9268
|
if (!e) return [];
|
|
9265
9269
|
let t = /<img.*?src=(["'])(.*?)\1/g, n = /<img.*?src=(["'])(.*?)\1/, r = t.exec(e) ?? [], i = [];
|
|
9266
9270
|
for (let e of r) {
|
|
@@ -9269,19 +9273,19 @@ function Wi(e) {
|
|
|
9269
9273
|
}
|
|
9270
9274
|
return i;
|
|
9271
9275
|
}
|
|
9272
|
-
process.env.NODE_ENV === "development" && (
|
|
9276
|
+
process.env.NODE_ENV === "development" && (zi.displayName = "MasonryGrid");
|
|
9273
9277
|
//#endregion
|
|
9274
9278
|
//#region src/primitives/RangeSlider.tsx
|
|
9275
|
-
var
|
|
9276
|
-
let y = d(null), b = re(y), x = d(null), S = d(null), [w, T] = f(p ?? [l, o]), E =
|
|
9277
|
-
gutter:
|
|
9278
|
-
highlight:
|
|
9279
|
-
knob:
|
|
9280
|
-
knobContainer:
|
|
9281
|
-
label:
|
|
9279
|
+
var Ki = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, knobHeight: r = 28, knobPadding: i = 0, knobWidth: a = 40, max: o, min: l, orientation: u = "vertical", range: p, steps: m = -1, isClipped: h = !1, onChange: g, ..._ }, v) => {
|
|
9280
|
+
let y = d(null), b = re(y), x = d(null), S = d(null), [w, T] = f(p ?? [l, o]), E = ca(l, o, m), [O, k] = w.map((e) => oa(e, l, o, u, b, a, r, h)), j = k - O, M = A(t, {
|
|
9281
|
+
gutter: qi,
|
|
9282
|
+
highlight: Yi,
|
|
9283
|
+
knob: Xi,
|
|
9284
|
+
knobContainer: Zi,
|
|
9285
|
+
label: Ji
|
|
9282
9286
|
}), F = s((e, t, n) => {
|
|
9283
|
-
let i = u === "horizontal" ? t : n, s =
|
|
9284
|
-
return
|
|
9287
|
+
let i = u === "horizontal" ? t : n, s = oa(l, l, o, u, b, a, r, h), c = oa(w[1], l, o, u, b, a, r, h), d = oa(e, l, o, u, b, a, r, h) + i;
|
|
9288
|
+
return ia(Math.max(s, Math.min(c, d)), l, o, u, b, a, r, h);
|
|
9285
9289
|
}, [
|
|
9286
9290
|
a,
|
|
9287
9291
|
r,
|
|
@@ -9292,8 +9296,8 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9292
9296
|
w[1],
|
|
9293
9297
|
K.toString(b)
|
|
9294
9298
|
]), I = s((e, t, n) => {
|
|
9295
|
-
let i = u === "horizontal" ? t : n, s =
|
|
9296
|
-
return
|
|
9299
|
+
let i = u === "horizontal" ? t : n, s = oa(w[0], l, o, u, b, a, r, h), c = oa(o, l, o, u, b, a, r, h), d = oa(e, l, o, u, b, a, r, h) + i;
|
|
9300
|
+
return ia(Math.max(s, Math.min(c, d)), l, o, u, b, a, r, h);
|
|
9297
9301
|
}, [
|
|
9298
9302
|
a,
|
|
9299
9303
|
r,
|
|
@@ -9309,12 +9313,12 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9309
9313
|
}), { setValue: V, value: H, isDragging: U, isReleasing: W } = Ne(S, {
|
|
9310
9314
|
initialValue: p?.[1] ?? o,
|
|
9311
9315
|
transform: I
|
|
9312
|
-
}), G =
|
|
9316
|
+
}), G = $i({
|
|
9313
9317
|
isDraggingEndKnob: U,
|
|
9314
9318
|
isDraggingStartKnob: z,
|
|
9315
9319
|
isReleasingEndKnob: W,
|
|
9316
9320
|
isReleasingStartKnob: B
|
|
9317
|
-
}), q =
|
|
9321
|
+
}), q = ea({
|
|
9318
9322
|
highlightLength: j,
|
|
9319
9323
|
knobHeight: r,
|
|
9320
9324
|
knobPadding: i,
|
|
@@ -9335,9 +9339,9 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9335
9339
|
U,
|
|
9336
9340
|
W
|
|
9337
9341
|
]), c(() => {
|
|
9338
|
-
E && L(
|
|
9342
|
+
E && L(sa(R, E));
|
|
9339
9343
|
}, [B, je(E)]), c(() => {
|
|
9340
|
-
!E || !W || V(
|
|
9344
|
+
!E || !W || V(sa(H, E));
|
|
9341
9345
|
}, [W, je(E)]), /* @__PURE__ */ (0, D.jsx)("div", {
|
|
9342
9346
|
..._,
|
|
9343
9347
|
className: C(e, u),
|
|
@@ -9351,11 +9355,11 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9351
9355
|
children: [
|
|
9352
9356
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
9353
9357
|
style: P(q.gutter),
|
|
9354
|
-
element: M.gutter ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9358
|
+
element: M.gutter ?? /* @__PURE__ */ (0, D.jsx)(qi, {})
|
|
9355
9359
|
}),
|
|
9356
9360
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
9357
9361
|
style: P(q.highlight),
|
|
9358
|
-
element: M.highlight ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9362
|
+
element: M.highlight ?? /* @__PURE__ */ (0, D.jsx)(Yi, {})
|
|
9359
9363
|
}),
|
|
9360
9364
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
9361
9365
|
className: G.startKnobContainer,
|
|
@@ -9368,15 +9372,15 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9368
9372
|
top: `${O}px`
|
|
9369
9373
|
}),
|
|
9370
9374
|
disabled: (0, Ae.default)([R, H], [l, l]),
|
|
9371
|
-
element: M.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9375
|
+
element: M.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(Zi, {}),
|
|
9372
9376
|
children: /* @__PURE__ */ (0, D.jsxs)(N, {
|
|
9373
9377
|
className: G.startKnob,
|
|
9374
9378
|
style: P(q.knob),
|
|
9375
|
-
element: M.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9379
|
+
element: M.knob ?? /* @__PURE__ */ (0, D.jsx)(Xi, {}),
|
|
9376
9380
|
children: [/* @__PURE__ */ (0, D.jsx)("div", { style: q.knobHitBox }), M.label && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9377
9381
|
className: G.startLabel,
|
|
9378
9382
|
style: P(q.label),
|
|
9379
|
-
element: M.label ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9383
|
+
element: M.label ?? /* @__PURE__ */ (0, D.jsx)(Ji, {}),
|
|
9380
9384
|
children: Number(R.toFixed(n)).toLocaleString()
|
|
9381
9385
|
})]
|
|
9382
9386
|
})
|
|
@@ -9392,15 +9396,15 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9392
9396
|
top: `${k}px`
|
|
9393
9397
|
}),
|
|
9394
9398
|
disabled: (0, Ae.default)([R, H], [o, o]),
|
|
9395
|
-
element: M.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9399
|
+
element: M.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(Zi, {}),
|
|
9396
9400
|
children: /* @__PURE__ */ (0, D.jsxs)(N, {
|
|
9397
9401
|
className: G.endKnob,
|
|
9398
9402
|
style: P(q.knob),
|
|
9399
|
-
element: M.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9403
|
+
element: M.knob ?? /* @__PURE__ */ (0, D.jsx)(Xi, {}),
|
|
9400
9404
|
children: [/* @__PURE__ */ (0, D.jsx)("div", { style: q.knobHitBox }), M.label && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9401
9405
|
className: G.endLabel,
|
|
9402
9406
|
style: P(q.label),
|
|
9403
|
-
element: M.label ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9407
|
+
element: M.label ?? /* @__PURE__ */ (0, D.jsx)(Ji, {}),
|
|
9404
9408
|
children: Number(H.toFixed(n)).toLocaleString()
|
|
9405
9409
|
})]
|
|
9406
9410
|
})
|
|
@@ -9408,14 +9412,14 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9408
9412
|
]
|
|
9409
9413
|
})
|
|
9410
9414
|
});
|
|
9411
|
-
}),
|
|
9412
|
-
Gutter:
|
|
9413
|
-
Highlight:
|
|
9414
|
-
Knob:
|
|
9415
|
-
KnobContainer:
|
|
9416
|
-
Label:
|
|
9415
|
+
}), qi = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Ji = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Yi = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Xi = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Zi = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("button", { ...e }), Qi = /* @__PURE__ */ Object.assign(Ki, {
|
|
9416
|
+
Gutter: qi,
|
|
9417
|
+
Highlight: Yi,
|
|
9418
|
+
Knob: Xi,
|
|
9419
|
+
KnobContainer: Zi,
|
|
9420
|
+
Label: Ji
|
|
9417
9421
|
});
|
|
9418
|
-
function
|
|
9422
|
+
function $i({ isDraggingEndKnob: e = !1, isDraggingStartKnob: t = !1, isReleasingEndKnob: n = !1, isReleasingStartKnob: r = !1 }) {
|
|
9419
9423
|
return k({
|
|
9420
9424
|
endKnob: C({
|
|
9421
9425
|
dragging: e,
|
|
@@ -9443,7 +9447,7 @@ function Qi({ isDraggingEndKnob: e = !1, isDraggingStartKnob: t = !1, isReleasin
|
|
|
9443
9447
|
})
|
|
9444
9448
|
});
|
|
9445
9449
|
}
|
|
9446
|
-
function
|
|
9450
|
+
function ea({ highlightLength: e = 0, knobHeight: t = 0, knobPadding: n = 0, knobWidth: r = 0, orientation: i = "horizontal", start: a = 0 }) {
|
|
9447
9451
|
return j({
|
|
9448
9452
|
body: {
|
|
9449
9453
|
height: "100%",
|
|
@@ -9500,10 +9504,10 @@ function $i({ highlightLength: e = 0, knobHeight: t = 0, knobPadding: n = 0, kno
|
|
|
9500
9504
|
}
|
|
9501
9505
|
});
|
|
9502
9506
|
}
|
|
9503
|
-
function
|
|
9507
|
+
function ta(e, t, n) {
|
|
9504
9508
|
return (e - t) / (n - t);
|
|
9505
9509
|
}
|
|
9506
|
-
function
|
|
9510
|
+
function na(e, t, n, r, i, a) {
|
|
9507
9511
|
switch (t) {
|
|
9508
9512
|
case "horizontal": {
|
|
9509
9513
|
let t = a ? n.width - r : n.width;
|
|
@@ -9516,23 +9520,23 @@ function ta(e, t, n, r, i, a) {
|
|
|
9516
9520
|
default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
|
|
9517
9521
|
}
|
|
9518
9522
|
}
|
|
9519
|
-
function
|
|
9523
|
+
function ra(e, t, n) {
|
|
9520
9524
|
return e * (n - t) + t;
|
|
9521
9525
|
}
|
|
9522
|
-
function
|
|
9523
|
-
return na(
|
|
9526
|
+
function ia(e, t, n, r, i, a, o, s) {
|
|
9527
|
+
return ra(na(e, r, i, a, o, s), t, n);
|
|
9524
9528
|
}
|
|
9525
|
-
function
|
|
9529
|
+
function aa(e, t, n, r, i, a) {
|
|
9526
9530
|
switch (t) {
|
|
9527
9531
|
case "horizontal": return e * (a ? n.width - r : n.width) + (a ? r * .5 : 0);
|
|
9528
9532
|
case "vertical": return e * (a ? n.height - i : n.height) + (a ? i * .5 : 0);
|
|
9529
9533
|
default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
|
|
9530
9534
|
}
|
|
9531
9535
|
}
|
|
9532
|
-
function
|
|
9533
|
-
return
|
|
9536
|
+
function oa(e, t, n, r, i, a, o, s) {
|
|
9537
|
+
return aa(ta(e, t, n), r, i, a, o, s);
|
|
9534
9538
|
}
|
|
9535
|
-
function
|
|
9539
|
+
function sa(e, t) {
|
|
9536
9540
|
let n = t.length, r = 0, i = Infinity;
|
|
9537
9541
|
for (let a = 0; a < n; a++) {
|
|
9538
9542
|
let n = t[a], o = Math.abs(e - n);
|
|
@@ -9540,63 +9544,63 @@ function oa(e, t) {
|
|
|
9540
9544
|
}
|
|
9541
9545
|
return t[r];
|
|
9542
9546
|
}
|
|
9543
|
-
function
|
|
9547
|
+
function ca(e, t, n) {
|
|
9544
9548
|
if (!(n < 0)) return [
|
|
9545
9549
|
e,
|
|
9546
9550
|
...[...Array(n)].map((r, i) => e + (i + 1) * (t - e) / (1 + n)),
|
|
9547
9551
|
t
|
|
9548
9552
|
];
|
|
9549
9553
|
}
|
|
9550
|
-
process.env.NODE_ENV === "development" && (
|
|
9554
|
+
process.env.NODE_ENV === "development" && (Ki.displayName = "RangeSlider", qi.displayName = "RangeSlider.Gutter", Ji.displayName = "RangeSlider.Label", Yi.displayName = "RangeSlider.Highlight", Xi.displayName = "RangeSlider.Knob");
|
|
9551
9555
|
//#endregion
|
|
9552
9556
|
//#region src/primitives/Select.tsx
|
|
9553
|
-
var
|
|
9557
|
+
var la = /* @__PURE__ */ a(({ id: e, children: t, name: n, options: r, placeholder: i, value: a = "", isRequired: o = !1, onChange: s, ...c }, l) => {
|
|
9554
9558
|
let u = A(t, {
|
|
9555
|
-
expandIcon:
|
|
9556
|
-
option:
|
|
9557
|
-
toggle:
|
|
9559
|
+
expandIcon: ua,
|
|
9560
|
+
option: fa,
|
|
9561
|
+
toggle: da
|
|
9558
9562
|
});
|
|
9559
9563
|
return /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
9560
9564
|
...c,
|
|
9561
9565
|
ref: l,
|
|
9562
|
-
style:
|
|
9566
|
+
style: ma.root,
|
|
9563
9567
|
children: [/* @__PURE__ */ (0, D.jsxs)(N, {
|
|
9564
|
-
style:
|
|
9568
|
+
style: ma.select,
|
|
9565
9569
|
"aria-required": o ? "true" : void 0,
|
|
9566
|
-
element: u.toggle ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9570
|
+
element: u.toggle ?? /* @__PURE__ */ (0, D.jsx)(da, {}),
|
|
9567
9571
|
name: n,
|
|
9568
9572
|
required: o,
|
|
9569
9573
|
value: a,
|
|
9570
9574
|
onChange: (e) => s?.(e.target.value),
|
|
9571
9575
|
children: [i !== void 0 && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9572
9576
|
disabled: !0,
|
|
9573
|
-
element: u.option ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9577
|
+
element: u.option ?? /* @__PURE__ */ (0, D.jsx)(fa, {}),
|
|
9574
9578
|
hidden: !0,
|
|
9575
9579
|
value: "",
|
|
9576
9580
|
children: i
|
|
9577
9581
|
}), r.map((e, t) => /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9578
|
-
element: u.option ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9582
|
+
element: u.option ?? /* @__PURE__ */ (0, D.jsx)(fa, {}),
|
|
9579
9583
|
value: e,
|
|
9580
9584
|
children: e
|
|
9581
9585
|
}, `${t}-${e}`))]
|
|
9582
9586
|
}), u.expandIcon && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9583
|
-
style:
|
|
9587
|
+
style: ma.expandIcon,
|
|
9584
9588
|
element: u.expandIcon
|
|
9585
9589
|
})]
|
|
9586
9590
|
});
|
|
9587
|
-
}),
|
|
9591
|
+
}), ua = ({ style: e, children: t, ...n }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
9588
9592
|
...n,
|
|
9589
9593
|
style: P(e, { pointerEvents: "none" }),
|
|
9590
9594
|
"aria-hidden": !0,
|
|
9591
9595
|
children: t
|
|
9592
|
-
}),
|
|
9596
|
+
}), da = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("select", {
|
|
9593
9597
|
...t,
|
|
9594
9598
|
children: e
|
|
9595
|
-
}),
|
|
9596
|
-
ExpandIcon:
|
|
9597
|
-
Option:
|
|
9598
|
-
Toggle:
|
|
9599
|
-
}),
|
|
9599
|
+
}), fa = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("option", { ...e }), pa = /* @__PURE__ */ Object.assign(la, {
|
|
9600
|
+
ExpandIcon: ua,
|
|
9601
|
+
Option: fa,
|
|
9602
|
+
Toggle: da
|
|
9603
|
+
}), ma = j({
|
|
9600
9604
|
expandIcon: {
|
|
9601
9605
|
pointerEvents: "none",
|
|
9602
9606
|
zIndex: 1
|
|
@@ -9618,10 +9622,10 @@ var ca = /* @__PURE__ */ a(({ id: e, children: t, name: n, options: r, placehold
|
|
|
9618
9622
|
width: "100%"
|
|
9619
9623
|
}
|
|
9620
9624
|
});
|
|
9621
|
-
process.env.NODE_ENV === "development" && (
|
|
9625
|
+
process.env.NODE_ENV === "development" && (la.displayName = "Select", ua.displayName = "Select.ExpandIcon", fa.displayName = "Select.Option", da.displayName = "Select.Toggle");
|
|
9622
9626
|
//#endregion
|
|
9623
9627
|
//#region src/primitives/Slider.tsx
|
|
9624
|
-
var
|
|
9628
|
+
var ha = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobWidth: i = 30, labelProvider: a, orientation: o = "vertical", position: l = 0, trackPadding: u = 0, isClipped: f = !1, isInverted: p = !1, isTrackInteractive: m = !0, shouldOnlyDispatchOnDragEnd: h = !1, onChange: g, onDragEnd: _, onDragStart: v, ...y }, b) => {
|
|
9625
9629
|
let x = d(null), S = d(null), w = s((e, t, r) => {
|
|
9626
9630
|
let a = K.from(x.current), s = p ? 1 - e : e;
|
|
9627
9631
|
switch (o) {
|
|
@@ -9668,13 +9672,13 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9668
9672
|
transform: w,
|
|
9669
9673
|
onDragEnd: _,
|
|
9670
9674
|
onDragStart: v
|
|
9671
|
-
}), M = p ? 1 - O : O, F =
|
|
9675
|
+
}), M = p ? 1 - O : O, F = xa({
|
|
9672
9676
|
orientation: o,
|
|
9673
9677
|
isAtEnd: p ? O === 0 : O === 1,
|
|
9674
9678
|
isAtStart: p ? O === 1 : O === 0,
|
|
9675
9679
|
isDragging: k,
|
|
9676
9680
|
isReleasing: j
|
|
9677
|
-
}), I =
|
|
9681
|
+
}), I = Sa({
|
|
9678
9682
|
knobHeight: n,
|
|
9679
9683
|
knobPadding: r,
|
|
9680
9684
|
knobWidth: i,
|
|
@@ -9691,10 +9695,10 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9691
9695
|
k || !h || g?.(O, !0);
|
|
9692
9696
|
}, [k]);
|
|
9693
9697
|
let L = A(t, {
|
|
9694
|
-
knob:
|
|
9695
|
-
knobContainer:
|
|
9696
|
-
label:
|
|
9697
|
-
track:
|
|
9698
|
+
knob: _a,
|
|
9699
|
+
knobContainer: va,
|
|
9700
|
+
label: ya,
|
|
9701
|
+
track: ga
|
|
9698
9702
|
});
|
|
9699
9703
|
return /* @__PURE__ */ (0, D.jsx)("div", {
|
|
9700
9704
|
...y,
|
|
@@ -9716,7 +9720,7 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9716
9720
|
left: "0",
|
|
9717
9721
|
width: `calc(${M * 100}% - ${u <= 0 ? 0 : i * .5}px - ${u}px)`
|
|
9718
9722
|
}),
|
|
9719
|
-
element: L.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9723
|
+
element: L.track ?? /* @__PURE__ */ (0, D.jsx)(ga, {}),
|
|
9720
9724
|
onClick: T,
|
|
9721
9725
|
children: /* @__PURE__ */ (0, D.jsx)("div", { style: I.trackHitBox })
|
|
9722
9726
|
}),
|
|
@@ -9729,7 +9733,7 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9729
9733
|
right: "0",
|
|
9730
9734
|
width: `calc(${(1 - M) * 100}% - ${u <= 0 ? 0 : i * .5}px - ${u}px)`
|
|
9731
9735
|
}),
|
|
9732
|
-
element: L.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9736
|
+
element: L.track ?? /* @__PURE__ */ (0, D.jsx)(ga, {}),
|
|
9733
9737
|
onClick: T,
|
|
9734
9738
|
children: /* @__PURE__ */ (0, D.jsx)("div", { style: I.trackHitBox })
|
|
9735
9739
|
}),
|
|
@@ -9737,15 +9741,15 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9737
9741
|
className: C(F.knobContainer),
|
|
9738
9742
|
ref: S,
|
|
9739
9743
|
style: I.knobContainer,
|
|
9740
|
-
element: L.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9744
|
+
element: L.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(va, {}),
|
|
9741
9745
|
children: /* @__PURE__ */ (0, D.jsxs)(N, {
|
|
9742
9746
|
className: C(F.knob),
|
|
9743
9747
|
style: P(I.knob),
|
|
9744
|
-
element: L.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9748
|
+
element: L.knob ?? /* @__PURE__ */ (0, D.jsx)(_a, {}),
|
|
9745
9749
|
children: [/* @__PURE__ */ (0, D.jsx)("div", { style: I.knobHitBox }), a && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9746
9750
|
className: C(F.label),
|
|
9747
9751
|
style: P(I.label),
|
|
9748
|
-
element: L.label ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9752
|
+
element: L.label ?? /* @__PURE__ */ (0, D.jsx)(ya, {}),
|
|
9749
9753
|
children: a(O)
|
|
9750
9754
|
})]
|
|
9751
9755
|
})
|
|
@@ -9753,13 +9757,13 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9753
9757
|
]
|
|
9754
9758
|
})
|
|
9755
9759
|
});
|
|
9756
|
-
}),
|
|
9757
|
-
Track:
|
|
9758
|
-
Knob:
|
|
9759
|
-
KnobContainer:
|
|
9760
|
-
Label:
|
|
9760
|
+
}), ga = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), _a = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), va = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("button", { ...e }), ya = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), ba = /* @__PURE__ */ Object.assign(ha, {
|
|
9761
|
+
Track: ga,
|
|
9762
|
+
Knob: _a,
|
|
9763
|
+
KnobContainer: va,
|
|
9764
|
+
Label: ya
|
|
9761
9765
|
});
|
|
9762
|
-
function
|
|
9766
|
+
function xa({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, isDragging: r = !1, isReleasing: i = !1 }) {
|
|
9763
9767
|
return k({
|
|
9764
9768
|
knob: C(e, {
|
|
9765
9769
|
"at-end": t,
|
|
@@ -9793,7 +9797,7 @@ function ba({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, i
|
|
|
9793
9797
|
})
|
|
9794
9798
|
});
|
|
9795
9799
|
}
|
|
9796
|
-
function
|
|
9800
|
+
function Sa({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPosition: r = 0, orientation: i = "vertical", isClipped: a = !1, isTrackInteractive: o = !0 }) {
|
|
9797
9801
|
return j({
|
|
9798
9802
|
body: {
|
|
9799
9803
|
height: "100%",
|
|
@@ -9858,20 +9862,20 @@ function xa({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
|
|
|
9858
9862
|
}
|
|
9859
9863
|
});
|
|
9860
9864
|
}
|
|
9861
|
-
process.env.NODE_ENV === "development" && (
|
|
9865
|
+
process.env.NODE_ENV === "development" && (ha.displayName = "Slider", ga.displayName = "Slider.Track", _a.displayName = "Slider.Knob", va.displayName = "Slider.KnobContainer", ya.displayName = "Slider.Label");
|
|
9862
9866
|
//#endregion
|
|
9863
9867
|
//#region src/primitives/StepSlider.tsx
|
|
9864
|
-
var
|
|
9868
|
+
var Ca = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding: i = 0, knobWidth: a = 30, labelProvider: o, orientation: l = "vertical", steps: u = Oa(10), trackPadding: p = 0, isClipped: m = !1, isInverted: h = !1, isTrackInteractive: g = !0, shouldOnlyDispatchOnDragEnd: _ = !1, onDragEnd: v, onDragStart: y, onIndexChange: b, onPositionChange: x, ...S }, w) => {
|
|
9865
9869
|
let T = d(null), E = d(null), O = re(T), [k, j] = f(n), M = s((e, t, n) => {
|
|
9866
|
-
let i = h ?
|
|
9870
|
+
let i = h ? Pa(e) : e;
|
|
9867
9871
|
switch (l) {
|
|
9868
9872
|
case "horizontal": {
|
|
9869
|
-
let e = m ? O.width - a : O.width, n =
|
|
9870
|
-
return h ?
|
|
9873
|
+
let e = m ? O.width - a : O.width, n = Fa((i * e + t) / e);
|
|
9874
|
+
return h ? Pa(n) : n;
|
|
9871
9875
|
}
|
|
9872
9876
|
case "vertical": {
|
|
9873
|
-
let e = m ? O.height - r : O.height, t =
|
|
9874
|
-
return h ?
|
|
9877
|
+
let e = m ? O.height - r : O.height, t = Fa((i * e + n) / e);
|
|
9878
|
+
return h ? Pa(t) : t;
|
|
9875
9879
|
}
|
|
9876
9880
|
default: return console.error(`[etudes::StepSlider] Invalid orientation: ${l}`), NaN;
|
|
9877
9881
|
}
|
|
@@ -9884,7 +9888,7 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9884
9888
|
r,
|
|
9885
9889
|
l
|
|
9886
9890
|
]), { setValue: F, value: I, isDragging: L, isReleasing: R } = Ne(E, {
|
|
9887
|
-
initialValue:
|
|
9891
|
+
initialValue: ja(n, u),
|
|
9888
9892
|
transform: M,
|
|
9889
9893
|
onDragEnd: v,
|
|
9890
9894
|
onDragStart: y
|
|
@@ -9893,16 +9897,16 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9893
9897
|
let t = K.fromViewport();
|
|
9894
9898
|
switch (l) {
|
|
9895
9899
|
case "horizontal": {
|
|
9896
|
-
let n = (e.clientX + t.left - O.left) / O.width, r = h ?
|
|
9897
|
-
j(i === k ?
|
|
9900
|
+
let n = (e.clientX + t.left - O.left) / O.width, r = h ? Pa(n) : n, i = Aa(r, u);
|
|
9901
|
+
j(i === k ? Fa(r > I ? i + 1 : i - 1, u.length - 1) : i);
|
|
9898
9902
|
break;
|
|
9899
9903
|
}
|
|
9900
9904
|
case "vertical": {
|
|
9901
|
-
let n = (e.clientY + t.top - O.top) / O.height, r = h ?
|
|
9905
|
+
let n = (e.clientY + t.top - O.top) / O.height, r = h ? Pa(n) : n, i = Aa(r, u);
|
|
9902
9906
|
if (i === k) {
|
|
9903
9907
|
let e = r > I ? i + 1 : i - 1;
|
|
9904
|
-
F(
|
|
9905
|
-
} else F(
|
|
9908
|
+
F(ja(e, u)), j(Fa(e, u.length - 1));
|
|
9909
|
+
} else F(ja(i, u)), j(i);
|
|
9906
9910
|
break;
|
|
9907
9911
|
}
|
|
9908
9912
|
default: console.error(`[etudes::StepSlider] Invalid orientation: ${l}`);
|
|
@@ -9918,13 +9922,13 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9918
9922
|
g,
|
|
9919
9923
|
l,
|
|
9920
9924
|
je(u)
|
|
9921
|
-
]), B = h ?
|
|
9925
|
+
]), B = h ? Pa(I) : I, V = Ma({
|
|
9922
9926
|
orientation: l,
|
|
9923
9927
|
isAtEnd: h ? I === 0 : I === 1,
|
|
9924
9928
|
isAtStart: h ? I === 1 : I === 0,
|
|
9925
9929
|
isDragging: L,
|
|
9926
9930
|
isReleasing: R
|
|
9927
|
-
}), H =
|
|
9931
|
+
}), H = Na({
|
|
9928
9932
|
knobHeight: r,
|
|
9929
9933
|
knobPadding: i,
|
|
9930
9934
|
knobWidth: a,
|
|
@@ -9933,13 +9937,13 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9933
9937
|
isClipped: m,
|
|
9934
9938
|
isTrackInteractive: g
|
|
9935
9939
|
}), U = A(t, {
|
|
9936
|
-
knob:
|
|
9937
|
-
knobContainer:
|
|
9938
|
-
label:
|
|
9939
|
-
track:
|
|
9940
|
+
knob: wa,
|
|
9941
|
+
knobContainer: Ta,
|
|
9942
|
+
label: Ea,
|
|
9943
|
+
track: Da
|
|
9940
9944
|
});
|
|
9941
9945
|
return c(() => {
|
|
9942
|
-
L || (F(
|
|
9946
|
+
L || (F(ja(n, u)), j(n));
|
|
9943
9947
|
}, [
|
|
9944
9948
|
n,
|
|
9945
9949
|
L,
|
|
@@ -9947,10 +9951,10 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9947
9951
|
]), c(() => {
|
|
9948
9952
|
if (L) {
|
|
9949
9953
|
if (_) return;
|
|
9950
|
-
j(
|
|
9954
|
+
j(Aa(I, u));
|
|
9951
9955
|
} else {
|
|
9952
|
-
let e =
|
|
9953
|
-
F(
|
|
9956
|
+
let e = Aa(I, u);
|
|
9957
|
+
F(ja(e, u)), j(e);
|
|
9954
9958
|
}
|
|
9955
9959
|
}, [
|
|
9956
9960
|
I,
|
|
@@ -9980,7 +9984,7 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9980
9984
|
left: "0",
|
|
9981
9985
|
width: `calc(${B * 100}% - ${p <= 0 ? 0 : a * .5}px - ${p}px)`
|
|
9982
9986
|
}),
|
|
9983
|
-
element: U.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9987
|
+
element: U.track ?? /* @__PURE__ */ (0, D.jsx)(Da, {}),
|
|
9984
9988
|
onClick: z,
|
|
9985
9989
|
children: /* @__PURE__ */ (0, D.jsx)("div", { style: H.trackHitBox })
|
|
9986
9990
|
}),
|
|
@@ -9988,12 +9992,12 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9988
9992
|
className: C(h ? "start" : "end", V.track),
|
|
9989
9993
|
style: P(H.track, l === "vertical" ? {
|
|
9990
9994
|
bottom: "0",
|
|
9991
|
-
height: `calc(${
|
|
9995
|
+
height: `calc(${Pa(B) * 100}% - ${p <= 0 ? 0 : r * .5}px - ${p}px)`
|
|
9992
9996
|
} : {
|
|
9993
9997
|
right: "0",
|
|
9994
|
-
width: `calc(${
|
|
9998
|
+
width: `calc(${Pa(B) * 100}% - ${p <= 0 ? 0 : a * .5}px - ${p}px)`
|
|
9995
9999
|
}),
|
|
9996
|
-
element: U.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10000
|
+
element: U.track ?? /* @__PURE__ */ (0, D.jsx)(Da, {}),
|
|
9997
10001
|
onClick: z,
|
|
9998
10002
|
children: /* @__PURE__ */ (0, D.jsx)("div", { style: H.trackHitBox })
|
|
9999
10003
|
}),
|
|
@@ -10001,50 +10005,50 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
10001
10005
|
className: C(V.knobContainer),
|
|
10002
10006
|
ref: E,
|
|
10003
10007
|
style: P(H.knobContainer),
|
|
10004
|
-
element: U.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10008
|
+
element: U.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(Ta, {}),
|
|
10005
10009
|
children: /* @__PURE__ */ (0, D.jsxs)(N, {
|
|
10006
10010
|
className: C(V.knob),
|
|
10007
10011
|
style: P(H.knob),
|
|
10008
|
-
element: U.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10012
|
+
element: U.knob ?? /* @__PURE__ */ (0, D.jsx)(wa, {}),
|
|
10009
10013
|
children: [/* @__PURE__ */ (0, D.jsx)("div", { style: H.knobHitBox }), u && o && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
10010
10014
|
className: C(V.label),
|
|
10011
10015
|
style: P(H.label),
|
|
10012
|
-
element: U.label ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10013
|
-
children: o(I,
|
|
10016
|
+
element: U.label ?? /* @__PURE__ */ (0, D.jsx)(Ea, {}),
|
|
10017
|
+
children: o(I, Aa(I, u))
|
|
10014
10018
|
})]
|
|
10015
10019
|
})
|
|
10016
10020
|
})
|
|
10017
10021
|
]
|
|
10018
10022
|
})
|
|
10019
10023
|
});
|
|
10020
|
-
}),
|
|
10021
|
-
function
|
|
10024
|
+
}), wa = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Ta = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("button", { ...e }), Ea = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Da = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e });
|
|
10025
|
+
function Oa(e) {
|
|
10022
10026
|
if (e <= 1) return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"), [];
|
|
10023
10027
|
if (Math.round(e) !== e) return console.error("[etudes::StepSlider] `length` value must be an integer"), [];
|
|
10024
10028
|
let t = 1 / (e - 1);
|
|
10025
10029
|
return Array(e).fill(null).map((e, n) => t * n);
|
|
10026
10030
|
}
|
|
10027
|
-
var
|
|
10028
|
-
Knob:
|
|
10029
|
-
KnobContainer:
|
|
10030
|
-
Label:
|
|
10031
|
-
Track:
|
|
10032
|
-
generateSteps:
|
|
10031
|
+
var ka = /* @__PURE__ */ Object.assign(Ca, {
|
|
10032
|
+
Knob: wa,
|
|
10033
|
+
KnobContainer: Ta,
|
|
10034
|
+
Label: Ea,
|
|
10035
|
+
Track: Da,
|
|
10036
|
+
generateSteps: Oa
|
|
10033
10037
|
});
|
|
10034
|
-
function
|
|
10038
|
+
function Aa(e, t) {
|
|
10035
10039
|
let n = -1, r = NaN;
|
|
10036
10040
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
10037
|
-
let a =
|
|
10041
|
+
let a = ja(i, t);
|
|
10038
10042
|
if (isNaN(a)) continue;
|
|
10039
10043
|
let o = Math.abs(e - a);
|
|
10040
10044
|
(isNaN(r) || o < r) && (r = o, n = i);
|
|
10041
10045
|
}
|
|
10042
10046
|
return n;
|
|
10043
10047
|
}
|
|
10044
|
-
function
|
|
10048
|
+
function ja(e, t) {
|
|
10045
10049
|
return e >= t.length ? NaN : t[e];
|
|
10046
10050
|
}
|
|
10047
|
-
function
|
|
10051
|
+
function Ma({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, isDragging: r = !1, isReleasing: i = !1 }) {
|
|
10048
10052
|
return k({
|
|
10049
10053
|
knob: C(e, {
|
|
10050
10054
|
"at-end": t,
|
|
@@ -10078,7 +10082,7 @@ function ja({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, i
|
|
|
10078
10082
|
})
|
|
10079
10083
|
});
|
|
10080
10084
|
}
|
|
10081
|
-
function
|
|
10085
|
+
function Na({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPosition: r = 0, orientation: i = "vertical", isClipped: a = !1, isTrackInteractive: o = !1 }) {
|
|
10082
10086
|
return j({
|
|
10083
10087
|
body: {
|
|
10084
10088
|
height: "100%",
|
|
@@ -10143,16 +10147,16 @@ function Ma({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
|
|
|
10143
10147
|
}
|
|
10144
10148
|
});
|
|
10145
10149
|
}
|
|
10146
|
-
function
|
|
10150
|
+
function Pa(e) {
|
|
10147
10151
|
return 1 - e;
|
|
10148
10152
|
}
|
|
10149
|
-
function
|
|
10153
|
+
function Fa(e, t = 1, n = 0) {
|
|
10150
10154
|
return Math.max(n, Math.min(t, e));
|
|
10151
10155
|
}
|
|
10152
|
-
process.env.NODE_ENV === "development" && (
|
|
10156
|
+
process.env.NODE_ENV === "development" && (Ca.displayName = "StepSlider", Da.displayName = "StepSlider.Track", wa.displayName = "StepSlider.Knob", Ta.displayName = "StepSlider.KnobContainer", Ea.displayName = "StepSlider.Label");
|
|
10153
10157
|
//#endregion
|
|
10154
10158
|
//#region src/primitives/SwipeRegion.tsx
|
|
10155
|
-
var
|
|
10159
|
+
var Ia = /* @__PURE__ */ a(({ children: e, threshold: t = .5, isEnabled: n = !0, onSwipeDown: r, onSwipeLeft: i, onSwipeRight: a, onSwipeUp: o, ...s }, c) => {
|
|
10156
10160
|
let [l, u] = f(void 0), [d, p] = f(void 0), [m, h] = f(NaN), g = (e, t) => {
|
|
10157
10161
|
if (isNaN(e) || isNaN(t)) return y();
|
|
10158
10162
|
u(U.make(e, t));
|
|
@@ -10180,22 +10184,22 @@ var Fa = /* @__PURE__ */ a(({ children: e, threshold: t = .5, isEnabled: n = !0,
|
|
|
10180
10184
|
children: e
|
|
10181
10185
|
});
|
|
10182
10186
|
});
|
|
10183
|
-
process.env.NODE_ENV === "development" && (
|
|
10187
|
+
process.env.NODE_ENV === "development" && (Ia.displayName = "SwipeRegion");
|
|
10184
10188
|
//#endregion
|
|
10185
10189
|
//#region src/primitives/TextArea.tsx
|
|
10186
|
-
var
|
|
10190
|
+
var La = /* @__PURE__ */ a(({ onChange: e, ...t }, n) => /* @__PURE__ */ (0, D.jsx)("textarea", {
|
|
10187
10191
|
...t,
|
|
10188
10192
|
ref: n,
|
|
10189
10193
|
onChange: (t) => e(t.target.value)
|
|
10190
10194
|
}));
|
|
10191
|
-
process.env.NODE_ENV === "development" && (
|
|
10195
|
+
process.env.NODE_ENV === "development" && (La.displayName = "TextArea");
|
|
10192
10196
|
//#endregion
|
|
10193
10197
|
//#region src/primitives/Toggle.tsx
|
|
10194
|
-
var
|
|
10195
|
-
let l = d(null), u =
|
|
10196
|
-
knob:
|
|
10197
|
-
track:
|
|
10198
|
-
}), p =
|
|
10198
|
+
var Ra = /* @__PURE__ */ a(({ className: e, style: t, children: n, orientation: r = "horizontal", isInverted: i = !1, isOn: a = !1, onChange: o, ...s }, c) => {
|
|
10199
|
+
let l = d(null), u = Ht(l), f = A(n, {
|
|
10200
|
+
knob: Ba,
|
|
10201
|
+
track: za
|
|
10202
|
+
}), p = Ha({ isOn: a }), m = Ua({
|
|
10199
10203
|
knobSize: u,
|
|
10200
10204
|
orientation: r,
|
|
10201
10205
|
isInverted: i,
|
|
@@ -10214,7 +10218,7 @@ var La = /* @__PURE__ */ a(({ className: e, style: t, children: n, orientation:
|
|
|
10214
10218
|
}), /* @__PURE__ */ (0, D.jsx)(N, {
|
|
10215
10219
|
className: p.track,
|
|
10216
10220
|
style: m.track,
|
|
10217
|
-
element: f.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10221
|
+
element: f.track ?? /* @__PURE__ */ (0, D.jsx)(za, {}),
|
|
10218
10222
|
children: /* @__PURE__ */ (0, D.jsx)("div", {
|
|
10219
10223
|
style: {
|
|
10220
10224
|
height: "100%",
|
|
@@ -10225,29 +10229,29 @@ var La = /* @__PURE__ */ a(({ className: e, style: t, children: n, orientation:
|
|
|
10225
10229
|
className: p.knob,
|
|
10226
10230
|
ref: l,
|
|
10227
10231
|
style: m.knob,
|
|
10228
|
-
element: f.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10232
|
+
element: f.knob ?? /* @__PURE__ */ (0, D.jsx)(Ba, {})
|
|
10229
10233
|
})
|
|
10230
10234
|
})
|
|
10231
10235
|
})]
|
|
10232
10236
|
});
|
|
10233
|
-
}),
|
|
10237
|
+
}), za = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("div", {
|
|
10234
10238
|
...t,
|
|
10235
10239
|
children: e
|
|
10236
|
-
}),
|
|
10240
|
+
}), Ba = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("div", {
|
|
10237
10241
|
...t,
|
|
10238
10242
|
children: e
|
|
10239
|
-
}),
|
|
10240
|
-
Knob:
|
|
10241
|
-
Track:
|
|
10243
|
+
}), Va = /* @__PURE__ */ Object.assign(Ra, {
|
|
10244
|
+
Knob: Ba,
|
|
10245
|
+
Track: za
|
|
10242
10246
|
});
|
|
10243
|
-
function
|
|
10247
|
+
function Ha({ isOn: e = !1 }) {
|
|
10244
10248
|
return k({
|
|
10245
10249
|
knob: C({ active: e }),
|
|
10246
10250
|
root: C({ active: e }),
|
|
10247
10251
|
track: C({ active: e })
|
|
10248
10252
|
});
|
|
10249
10253
|
}
|
|
10250
|
-
function
|
|
10254
|
+
function Ua({ knobSize: e = G.zero, orientation: t = "horizontal", isInverted: n = !1, isOn: r = !1 }) {
|
|
10251
10255
|
return j({
|
|
10252
10256
|
input: {
|
|
10253
10257
|
height: 0,
|
|
@@ -10277,26 +10281,26 @@ function Ha({ knobSize: e = G.zero, orientation: t = "horizontal", isInverted: n
|
|
|
10277
10281
|
track: { position: "relative" }
|
|
10278
10282
|
});
|
|
10279
10283
|
}
|
|
10280
|
-
process.env.NODE_ENV === "development" && (
|
|
10284
|
+
process.env.NODE_ENV === "development" && (Ra.displayName = "Toggle", Ba.displayName = "Toggle.Knob", za.displayName = "Toggle.Track");
|
|
10281
10285
|
//#endregion
|
|
10282
10286
|
//#region src/utils/createKeyDeep.ts
|
|
10283
|
-
function
|
|
10284
|
-
return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(
|
|
10287
|
+
function Wa(e) {
|
|
10288
|
+
return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(Wa)) : typeof e == "object" ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => [e, Wa(t)])) : je(e);
|
|
10285
10289
|
}
|
|
10286
10290
|
//#endregion
|
|
10287
10291
|
//#region src/utils/ExtractChildren.tsx
|
|
10288
|
-
function
|
|
10292
|
+
function Ga({ children: e, ...n }) {
|
|
10289
10293
|
return /* @__PURE__ */ (0, D.jsx)(D.Fragment, { children: t.map(e, (e) => o(e) ? M(e, { ...n }) : e) });
|
|
10290
10294
|
}
|
|
10291
|
-
process.env.NODE_ENV === "development" && (
|
|
10295
|
+
process.env.NODE_ENV === "development" && (Ga.displayName = "ExtractChildren");
|
|
10292
10296
|
//#endregion
|
|
10293
10297
|
//#region src/utils/getSystemColorScheme.ts
|
|
10294
|
-
function
|
|
10298
|
+
function Ka() {
|
|
10295
10299
|
return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
10296
10300
|
}
|
|
10297
10301
|
//#endregion
|
|
10298
10302
|
//#region src/utils/NoSSR.tsx
|
|
10299
|
-
function
|
|
10303
|
+
function qa({ children: e, fallback: t = void 0 }) {
|
|
10300
10304
|
let [n, i] = f(!1);
|
|
10301
10305
|
if (c(() => {
|
|
10302
10306
|
i(typeof window < "u");
|
|
@@ -10306,4 +10310,4 @@ function Ka({ children: e, fallback: t = void 0 }) {
|
|
|
10306
10310
|
});
|
|
10307
10311
|
}
|
|
10308
10312
|
//#endregion
|
|
10309
|
-
export {
|
|
10313
|
+
export { cn as Accordion, L as Burger, V as BurgerButton, we as Button, mn as Carousel, xn as CodeInput, Xt as Collection, Y as Conditional, jn as Counter, pe as CoverImage, Se as CoverVideo, In as Dial, Kn as Dropdown, qe as Each, $e as ExtractChild, Ga as ExtractChildren, Ii as FlatSVG, Li as Form, ce as Image, ie as ImageSource, zi as MasonryGrid, qa as NoSSR, De as OptionButton, Fe as Panorama, We as PanoramaSlider, le as Picture, Qi as RangeSlider, O as Repeat, pa as Select, Ke as SelectableButton, ba as Slider, ka as StepSlider, N as Styled, Ia as SwipeRegion, Ze as Switch, La as TextArea, En as TextField, Va as Toggle, ve as Video, nt as WithTooltip, de as _Content, _a as _Knob, va as _KnobContainer, ya as _Label, ga as _Track, fe as _Viewport, k as asClassNameDict, A as asComponentDict, j as asStyleDict, M as cloneStyledElement, je as createKey, Wa as createKeyDeep, xt as createLocalCache, It as createSessionCache, Ut as getStyle, Ka as getSystemColorScheme, _t as isTouchDevice, et as measureIntrinsicSize, Wt as setStyle, tt as setStyles, P as styles, st as useClassName, ct as useClickOutside, lt as useCopyBlobToClipboard, ft as useDPR, ut as useDownloadBlob, pt as useDrag, mt as useDropzone, ae as useImageLoader, oe as useImageSize, Me as useInertiaDrag, Ne as useInertiaDragValue, ee as useIntersectionObserver, ht as useInterval, gt as useIsMounted, vt as useIsTouchDevice, yt as useKeyboardShortcut, J as useLatest, Et as useLocalCache, Dt as useMouseEnter, Ot as useMouseLeave, kt as useOS, At as usePrevious, re as useRect, jt as useScrollPosition, Vt as useSessionCache, Ht as useSize, te as useSizeObserver, Gt as useStyle, Kt as useSystemColorScheme, qt as useTimeout, he as useVideoMetadataLoader, ge as useVideoSize, ne as useViewportSize };
|