@epam/ai-dial-share 1.2.0-dev.148 → 1.2.0-dev.152
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/components/AccessControl/AccessControl.d.ts +3 -7
- package/components/AccessControl/AccessControl.d.ts.map +1 -1
- package/components/QrActions/QrActions.d.ts +20 -0
- package/components/QrActions/QrActions.d.ts.map +1 -0
- package/components/QrCode/QrCode.d.ts +3 -1
- package/components/QrCode/QrCode.d.ts.map +1 -1
- package/components/SharePopover/SharePopover.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.js +354 -292
- package/models/share-popover-props.d.ts +8 -0
- package/models/share-popover-props.d.ts.map +1 -1
- package/package.json +3 -3
- package/utils/qr-image.d.ts +19 -0
- package/utils/qr-image.d.ts.map +1 -0
package/index.js
CHANGED
|
@@ -1,146 +1,210 @@
|
|
|
1
|
-
import { buildCssVars as e,
|
|
2
|
-
import
|
|
3
|
-
import { DIAL_ICON_SIZE as
|
|
4
|
-
import { IconCheck as
|
|
5
|
-
import { Fragment as
|
|
1
|
+
import { buildCssVars as e, copyToClipboard as t, mergeClasses as n, triggerBlobDownload as r, useCodeCopy as i } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import a, { forwardRef as o, memo as s, useEffect as c, useRef as l, useState as u } from "react";
|
|
3
|
+
import { DIAL_ICON_SIZE as d, DIAL_KIT_ICON_STROKE as f, Dropdown as p, GhostButton as m, GhostIconButton as h, Input as g, MenuItemMark as _, Skeleton as v, SkeletonVariant as y } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { IconCheck as b, IconChevronDown as x, IconCopy as S, IconDownload as C, IconLink as w, IconQrcode as T, IconWorld as E } from "@tabler/icons-react";
|
|
5
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
6
6
|
//#region \0rolldown/runtime.js
|
|
7
|
-
var
|
|
8
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
7
|
+
var A = Object.create, j = Object.defineProperty, M = Object.getOwnPropertyDescriptor, N = Object.getOwnPropertyNames, P = Object.getPrototypeOf, F = Object.prototype.hasOwnProperty, I = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), L = (e, t, n, r) => {
|
|
8
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = N(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !F.call(e, s) && s !== n && j(e, s, {
|
|
9
9
|
get: ((e) => t[e]).bind(null, s),
|
|
10
|
-
enumerable: !(r =
|
|
10
|
+
enumerable: !(r = M(t, s)) || r.enumerable
|
|
11
11
|
});
|
|
12
12
|
return e;
|
|
13
|
-
}, ee = (e, t, n) => (n = e == null ? {} :
|
|
13
|
+
}, ee = (e, t, n) => (n = e == null ? {} : A(P(e)), L(t || !e || !e.__esModule ? j(n, "default", {
|
|
14
14
|
value: e,
|
|
15
15
|
enumerable: !0
|
|
16
|
-
}) : n, e)),
|
|
16
|
+
}) : n, e)), te = { popover: "dial-share-popover" }, R = /* @__PURE__ */ function(e) {
|
|
17
17
|
return e.View = "view", e.Edit = "edit", e;
|
|
18
|
-
}({}),
|
|
18
|
+
}({}), z = /* @__PURE__ */ function(e) {
|
|
19
19
|
return e.Link = "link", e.Qr = "qr", e;
|
|
20
|
-
}({}),
|
|
21
|
-
let [t] =
|
|
20
|
+
}({}), ne = "button:not(:disabled), input:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", re = (e) => Array.from(e?.querySelectorAll(ne) ?? []), ie = (e) => {
|
|
21
|
+
let [t] = re(e);
|
|
22
22
|
(t ?? e)?.focus();
|
|
23
|
-
},
|
|
23
|
+
}, B = {
|
|
24
24
|
skeletonColor: "var(--shp-skeleton-color, var(--bg-layer-sunken, #eef1f7))",
|
|
25
|
-
accessTriggerBtn: "
|
|
26
|
-
accessTriggerBtnOpen: "
|
|
27
|
-
accessTriggerLabel: "
|
|
28
|
-
title: "
|
|
29
|
-
linkIconBadge: "
|
|
30
|
-
anyoneWithLinkTitle: "
|
|
31
|
-
anyoneWithLinkSubtitle: "
|
|
32
|
-
accessTriggerChevron: "
|
|
33
|
-
|
|
34
|
-
linkRow: "
|
|
35
|
-
errorText: "
|
|
36
|
-
note: "
|
|
37
|
-
divider: "
|
|
38
|
-
},
|
|
39
|
-
let
|
|
40
|
-
|
|
25
|
+
accessTriggerBtn: "_accessTriggerBtn_11e4z_2",
|
|
26
|
+
accessTriggerBtnOpen: "_accessTriggerBtnOpen_11e4z_18",
|
|
27
|
+
accessTriggerLabel: "_accessTriggerLabel_11e4z_22",
|
|
28
|
+
title: "_title_11e4z_26",
|
|
29
|
+
linkIconBadge: "_linkIconBadge_11e4z_30",
|
|
30
|
+
anyoneWithLinkTitle: "_anyoneWithLinkTitle_11e4z_35",
|
|
31
|
+
anyoneWithLinkSubtitle: "_anyoneWithLinkSubtitle_11e4z_39",
|
|
32
|
+
accessTriggerChevron: "_accessTriggerChevron_11e4z_43",
|
|
33
|
+
accessMenuItem: "_accessMenuItem_11e4z_58",
|
|
34
|
+
linkRow: "_linkRow_11e4z_62",
|
|
35
|
+
errorText: "_errorText_11e4z_69",
|
|
36
|
+
note: "_note_11e4z_73",
|
|
37
|
+
divider: "_divider_11e4z_77"
|
|
38
|
+
}, ae = ({ anyoneWithLinkTitle: e, anyoneWithLinkSubtitle: t, access: r, canEditAccess: i, accessViewLabel: a, accessEditLabel: o, accessAriaLabel: s, isOpen: c, onOpenChange: l, onAccessChange: u, menuStyle: m, triggerRef: h, titleClassName: g = "dial-small-semi-text", subtitleClassName: v = "dial-small-text", accessTriggerLabelClassName: y = "dial-small-semi-text" }) => {
|
|
39
|
+
let b = r.includes(R.Edit) ? R.Edit : R.View, S = [{
|
|
40
|
+
key: R.View,
|
|
41
41
|
label: a
|
|
42
42
|
}, {
|
|
43
|
-
|
|
43
|
+
key: R.Edit,
|
|
44
44
|
label: o
|
|
45
|
-
}]
|
|
46
|
-
|
|
45
|
+
}].map((e) => ({
|
|
46
|
+
...e,
|
|
47
|
+
mark: _.Check,
|
|
48
|
+
checked: e.key === b,
|
|
49
|
+
className: B.accessMenuItem
|
|
50
|
+
}));
|
|
51
|
+
return /* @__PURE__ */ k("div", {
|
|
47
52
|
className: "flex items-center gap-2.5",
|
|
48
53
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
className:
|
|
51
|
-
children: /* @__PURE__ */ E
|
|
52
|
-
size:
|
|
54
|
+
/* @__PURE__ */ O("span", {
|
|
55
|
+
className: n("flex size-8 shrink-0 items-center justify-center rounded-full", B.linkIconBadge),
|
|
56
|
+
children: /* @__PURE__ */ O(E, {
|
|
57
|
+
size: d.MD,
|
|
53
58
|
"aria-hidden": !0,
|
|
54
|
-
stroke:
|
|
59
|
+
stroke: f
|
|
55
60
|
})
|
|
56
61
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ k("div", {
|
|
58
63
|
className: "min-w-0 flex-1",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
60
|
-
className:
|
|
64
|
+
children: [/* @__PURE__ */ O("p", {
|
|
65
|
+
className: n(g, "truncate", B.anyoneWithLinkTitle),
|
|
61
66
|
children: e
|
|
62
|
-
}), /* @__PURE__ */
|
|
63
|
-
className:
|
|
64
|
-
children:
|
|
67
|
+
}), /* @__PURE__ */ O("p", {
|
|
68
|
+
className: n(v, B.anyoneWithLinkSubtitle),
|
|
69
|
+
children: t
|
|
65
70
|
})]
|
|
66
71
|
}),
|
|
67
|
-
i ? /* @__PURE__ */
|
|
72
|
+
i ? /* @__PURE__ */ O(p, {
|
|
68
73
|
matchReferenceWidth: !1,
|
|
69
74
|
placement: "bottom-end",
|
|
70
75
|
open: c,
|
|
71
|
-
onOpenChange:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
let n = O === e.value;
|
|
81
|
-
return /* @__PURE__ */ E(h, {
|
|
82
|
-
role: "menuitemradio",
|
|
83
|
-
"aria-checked": n,
|
|
84
|
-
mark: g.Check,
|
|
85
|
-
selected: n,
|
|
86
|
-
label: e.label,
|
|
87
|
-
labelClassName: t(C, z.accessMenuItemLabel),
|
|
88
|
-
onClick: () => {
|
|
89
|
-
p(e.value === L.Edit ? [L.View, L.Edit] : [L.View]), f(!1);
|
|
90
|
-
}
|
|
91
|
-
}, e.value);
|
|
92
|
-
})
|
|
93
|
-
}),
|
|
94
|
-
children: /* @__PURE__ */ D("button", {
|
|
95
|
-
ref: _,
|
|
76
|
+
onOpenChange: l,
|
|
77
|
+
items: S,
|
|
78
|
+
listClassName: "min-w-[160px]",
|
|
79
|
+
listStyle: m,
|
|
80
|
+
onItemClick: ({ key: e }) => {
|
|
81
|
+
u(e === R.Edit ? [R.View, R.Edit] : [R.View]);
|
|
82
|
+
},
|
|
83
|
+
children: /* @__PURE__ */ k("button", {
|
|
84
|
+
ref: h,
|
|
96
85
|
type: "button",
|
|
97
86
|
"aria-haspopup": "menu",
|
|
98
87
|
"aria-expanded": c,
|
|
99
|
-
className:
|
|
100
|
-
children: [/* @__PURE__ */
|
|
101
|
-
className:
|
|
102
|
-
children:
|
|
103
|
-
}), /* @__PURE__ */
|
|
104
|
-
size:
|
|
105
|
-
stroke:
|
|
106
|
-
className:
|
|
88
|
+
className: n("flex h-10 shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap rounded-full border px-3 outline-none", B.accessTriggerBtn, c && B.accessTriggerBtnOpen),
|
|
89
|
+
children: [/* @__PURE__ */ O("span", {
|
|
90
|
+
className: n(B.accessTriggerLabel, y),
|
|
91
|
+
children: b === R.Edit ? o : a
|
|
92
|
+
}), /* @__PURE__ */ O(x, {
|
|
93
|
+
size: d.MD,
|
|
94
|
+
stroke: f,
|
|
95
|
+
className: n("shrink-0 transition-transform duration-150 rtl:scale-x-[-1]", B.accessTriggerChevron, c && "rotate-180"),
|
|
107
96
|
"aria-hidden": !0
|
|
108
97
|
})]
|
|
109
98
|
})
|
|
110
|
-
}) : /* @__PURE__ */
|
|
99
|
+
}) : /* @__PURE__ */ O("span", {
|
|
111
100
|
"aria-label": s,
|
|
112
|
-
className:
|
|
113
|
-
children: /* @__PURE__ */
|
|
114
|
-
className:
|
|
101
|
+
className: n("flex h-10 shrink-0 items-center whitespace-nowrap rounded-full px-3", B.accessTriggerBtn),
|
|
102
|
+
children: /* @__PURE__ */ O("span", {
|
|
103
|
+
className: n(B.accessTriggerLabel, y),
|
|
115
104
|
children: a
|
|
116
105
|
})
|
|
117
106
|
})
|
|
118
107
|
]
|
|
119
108
|
});
|
|
120
|
-
},
|
|
121
|
-
className:
|
|
122
|
-
children: [/* @__PURE__ */
|
|
109
|
+
}, oe = ({ url: e, linkAriaLabel: t, isCopied: r, copyButtonLabel: i, copiedButtonLabel: a, onCopy: o }) => /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ k("div", {
|
|
110
|
+
className: n("flex items-center gap-3 rounded-full px-4 py-2", B.linkRow),
|
|
111
|
+
children: [/* @__PURE__ */ O(g, {
|
|
123
112
|
readOnly: !0,
|
|
124
113
|
value: e,
|
|
125
|
-
"aria-label":
|
|
114
|
+
"aria-label": t,
|
|
126
115
|
containerClassName: "min-w-0 flex-1",
|
|
127
116
|
wrapperClassName: "border-0 bg-transparent px-0 outline-none"
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
-
icon:
|
|
130
|
-
size:
|
|
117
|
+
}), /* @__PURE__ */ O(h, {
|
|
118
|
+
icon: O(r ? b : S, {
|
|
119
|
+
size: d.LG,
|
|
131
120
|
"aria-hidden": !0,
|
|
132
|
-
stroke:
|
|
121
|
+
stroke: f
|
|
133
122
|
}),
|
|
134
123
|
"aria-label": r ? a : i,
|
|
135
124
|
tooltipProps: { tooltip: r ? a : i },
|
|
136
125
|
onClick: o
|
|
137
126
|
})]
|
|
138
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ O("span", {
|
|
139
128
|
role: "status",
|
|
140
129
|
"aria-live": "polite",
|
|
141
130
|
className: "sr-only",
|
|
142
131
|
children: r ? a : ""
|
|
143
|
-
})] }),
|
|
132
|
+
})] }), se = 512, ce = 32, le = "http://www.w3.org/2000/svg", ue = "#000000", de = "#ffffff", V = (e, t) => {
|
|
133
|
+
let n = e.cloneNode(!0);
|
|
134
|
+
return n.setAttribute("xmlns", le), n.setAttribute("width", String(t)), n.setAttribute("height", String(t)), n.removeAttribute("class"), n.removeAttribute("style"), n.removeAttribute("aria-hidden"), n.querySelectorAll("path").forEach((e) => {
|
|
135
|
+
e.getAttribute("fill") === "currentColor" && e.setAttribute("fill", ue);
|
|
136
|
+
}), new XMLSerializer().serializeToString(n);
|
|
137
|
+
}, fe = (e) => new Promise((t, n) => {
|
|
138
|
+
let r = new Image();
|
|
139
|
+
r.onload = () => t(r), r.onerror = () => n(/* @__PURE__ */ Error("Failed to load the QR code SVG.")), r.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`;
|
|
140
|
+
}), pe = async (e, { size: t = se, margin: n = ce } = {}) => {
|
|
141
|
+
let r = t - n * 2, i = await fe(V(e, r)), a = document.createElement("canvas");
|
|
142
|
+
a.width = t, a.height = t;
|
|
143
|
+
let o = a.getContext("2d");
|
|
144
|
+
if (o == null) throw Error("Canvas 2D context is not available.");
|
|
145
|
+
return o.fillStyle = de, o.fillRect(0, 0, t, t), o.drawImage(i, n, n, r, r), new Promise((e, t) => {
|
|
146
|
+
a.toBlob((n) => {
|
|
147
|
+
if (n == null) {
|
|
148
|
+
t(/* @__PURE__ */ Error("Failed to encode the QR code as PNG."));
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
e(n);
|
|
152
|
+
}, "image/png");
|
|
153
|
+
});
|
|
154
|
+
}, me = () => typeof navigator < "u" && typeof navigator.clipboard?.write == "function" && typeof ClipboardItem < "u", he = (e) => {
|
|
155
|
+
let t = pe(e);
|
|
156
|
+
return t.catch(() => void 0), navigator.clipboard.write([new ClipboardItem({ "image/png": t })]);
|
|
157
|
+
}, ge = 2e3, _e = ({ url: e, getSvg: n, copyLabel: i, copiedLabel: a, downloadLabel: o, downloadFileName: s }) => {
|
|
158
|
+
let [p, h] = u(!1), g = l(null);
|
|
159
|
+
c(() => () => {
|
|
160
|
+
g.current != null && clearTimeout(g.current);
|
|
161
|
+
}, []);
|
|
162
|
+
let _ = () => {
|
|
163
|
+
g.current != null && clearTimeout(g.current), h(!0), g.current = setTimeout(() => h(!1), ge);
|
|
164
|
+
}, v = async () => {
|
|
165
|
+
let e = n();
|
|
166
|
+
if (e == null || !me()) return !1;
|
|
167
|
+
try {
|
|
168
|
+
return await he(e), !0;
|
|
169
|
+
} catch {
|
|
170
|
+
return !1;
|
|
171
|
+
}
|
|
172
|
+
}, y = async () => {
|
|
173
|
+
try {
|
|
174
|
+
(await v() || await t(e)) && _();
|
|
175
|
+
} catch {}
|
|
176
|
+
}, x = async () => {
|
|
177
|
+
let e = n();
|
|
178
|
+
if (e != null) try {
|
|
179
|
+
r(await pe(e), s);
|
|
180
|
+
} catch {}
|
|
181
|
+
};
|
|
182
|
+
return /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ k("div", {
|
|
183
|
+
className: "flex items-center justify-center gap-4 self-center",
|
|
184
|
+
children: [/* @__PURE__ */ O(m, {
|
|
185
|
+
label: p ? a : i,
|
|
186
|
+
iconBefore: O(p ? b : S, {
|
|
187
|
+
size: d.SM,
|
|
188
|
+
"aria-hidden": !0,
|
|
189
|
+
stroke: f
|
|
190
|
+
}),
|
|
191
|
+
onClick: () => void y()
|
|
192
|
+
}), /* @__PURE__ */ O(m, {
|
|
193
|
+
label: o,
|
|
194
|
+
iconBefore: /* @__PURE__ */ O(C, {
|
|
195
|
+
size: d.SM,
|
|
196
|
+
"aria-hidden": !0,
|
|
197
|
+
stroke: f
|
|
198
|
+
}),
|
|
199
|
+
onClick: () => void x()
|
|
200
|
+
})]
|
|
201
|
+
}), /* @__PURE__ */ O("span", {
|
|
202
|
+
role: "status",
|
|
203
|
+
"aria-live": "polite",
|
|
204
|
+
className: "sr-only",
|
|
205
|
+
children: p ? a : ""
|
|
206
|
+
})] });
|
|
207
|
+
}, ve = /* @__PURE__ */ I(((e) => {
|
|
144
208
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
145
209
|
function b(e) {
|
|
146
210
|
if (typeof e == "object" && e) {
|
|
@@ -196,7 +260,7 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
196
260
|
}, e.isValidElementType = function(e) {
|
|
197
261
|
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
198
262
|
}, e.typeOf = b;
|
|
199
|
-
})),
|
|
263
|
+
})), ye = /* @__PURE__ */ I(((e) => {
|
|
200
264
|
process.env.NODE_ENV !== "production" && (function() {
|
|
201
265
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
202
266
|
function b(e) {
|
|
@@ -231,50 +295,50 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
231
295
|
}
|
|
232
296
|
}
|
|
233
297
|
var S = l, C = u, w = c, T = s, E = n, D = d, O = i, k = h, A = m, j = r, M = o, N = a, P = f, F = !1;
|
|
234
|
-
function ee(e) {
|
|
235
|
-
return F || (F = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), I(e) || x(e) === l;
|
|
236
|
-
}
|
|
237
298
|
function I(e) {
|
|
238
|
-
return x(e) ===
|
|
299
|
+
return F || (F = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), L(e) || x(e) === l;
|
|
239
300
|
}
|
|
240
301
|
function L(e) {
|
|
302
|
+
return x(e) === u;
|
|
303
|
+
}
|
|
304
|
+
function ee(e) {
|
|
241
305
|
return x(e) === c;
|
|
242
306
|
}
|
|
243
|
-
function
|
|
307
|
+
function te(e) {
|
|
244
308
|
return x(e) === s;
|
|
245
309
|
}
|
|
246
|
-
function
|
|
310
|
+
function R(e) {
|
|
247
311
|
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
248
312
|
}
|
|
249
|
-
function
|
|
313
|
+
function z(e) {
|
|
250
314
|
return x(e) === d;
|
|
251
315
|
}
|
|
252
|
-
function
|
|
316
|
+
function ne(e) {
|
|
253
317
|
return x(e) === i;
|
|
254
318
|
}
|
|
255
|
-
function
|
|
319
|
+
function re(e) {
|
|
256
320
|
return x(e) === h;
|
|
257
321
|
}
|
|
258
322
|
function ie(e) {
|
|
259
323
|
return x(e) === m;
|
|
260
324
|
}
|
|
261
|
-
function
|
|
325
|
+
function B(e) {
|
|
262
326
|
return x(e) === r;
|
|
263
327
|
}
|
|
264
|
-
function
|
|
328
|
+
function ae(e) {
|
|
265
329
|
return x(e) === o;
|
|
266
330
|
}
|
|
267
|
-
function
|
|
331
|
+
function oe(e) {
|
|
268
332
|
return x(e) === a;
|
|
269
333
|
}
|
|
270
|
-
function
|
|
334
|
+
function se(e) {
|
|
271
335
|
return x(e) === f;
|
|
272
336
|
}
|
|
273
|
-
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode =
|
|
337
|
+
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = L, e.isContextConsumer = ee, e.isContextProvider = te, e.isElement = R, e.isForwardRef = z, e.isFragment = ne, e.isLazy = re, e.isMemo = ie, e.isPortal = B, e.isProfiler = ae, e.isStrictMode = oe, e.isSuspense = se, e.isValidElementType = b, e.typeOf = x;
|
|
274
338
|
})();
|
|
275
|
-
})),
|
|
276
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
277
|
-
})),
|
|
339
|
+
})), H = /* @__PURE__ */ I(((e, t) => {
|
|
340
|
+
process.env.NODE_ENV === "production" ? t.exports = ve() : t.exports = ye();
|
|
341
|
+
})), U = /* @__PURE__ */ I(((e, t) => {
|
|
278
342
|
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
279
343
|
function a(e) {
|
|
280
344
|
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
@@ -307,14 +371,14 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
307
371
|
}
|
|
308
372
|
return s;
|
|
309
373
|
};
|
|
310
|
-
})),
|
|
374
|
+
})), W = /* @__PURE__ */ I(((e, t) => {
|
|
311
375
|
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
312
|
-
})),
|
|
376
|
+
})), be = /* @__PURE__ */ I(((e, t) => {
|
|
313
377
|
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
314
|
-
})),
|
|
378
|
+
})), xe = /* @__PURE__ */ I(((e, t) => {
|
|
315
379
|
var n = function() {};
|
|
316
380
|
if (process.env.NODE_ENV !== "production") {
|
|
317
|
-
var r =
|
|
381
|
+
var r = W(), i = {}, a = be();
|
|
318
382
|
n = function(e) {
|
|
319
383
|
var t = "Warning: " + e;
|
|
320
384
|
typeof console < "u" && console.error(t);
|
|
@@ -347,8 +411,8 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
347
411
|
o.resetWarningCache = function() {
|
|
348
412
|
process.env.NODE_ENV !== "production" && (i = {});
|
|
349
413
|
}, t.exports = o;
|
|
350
|
-
})),
|
|
351
|
-
var n =
|
|
414
|
+
})), Se = /* @__PURE__ */ I(((e, t) => {
|
|
415
|
+
var n = H(), r = U(), i = W(), a = be(), o = xe(), s = function() {};
|
|
352
416
|
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
353
417
|
var t = "Warning: " + e;
|
|
354
418
|
typeof console < "u" && console.error(t);
|
|
@@ -606,8 +670,8 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
606
670
|
}
|
|
607
671
|
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
608
672
|
};
|
|
609
|
-
})),
|
|
610
|
-
var n =
|
|
673
|
+
})), Ce = /* @__PURE__ */ I(((e, t) => {
|
|
674
|
+
var n = W();
|
|
611
675
|
function r() {}
|
|
612
676
|
function i() {}
|
|
613
677
|
i.resetWarningCache = r, t.exports = function() {
|
|
@@ -646,11 +710,11 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
646
710
|
};
|
|
647
711
|
return a.PropTypes = a, a;
|
|
648
712
|
};
|
|
649
|
-
})), G = /* @__PURE__ */ ee((/* @__PURE__ */
|
|
713
|
+
})), G = /* @__PURE__ */ ee((/* @__PURE__ */ I(((e, t) => {
|
|
650
714
|
if (process.env.NODE_ENV !== "production") {
|
|
651
|
-
var n =
|
|
652
|
-
t.exports =
|
|
653
|
-
} else t.exports =
|
|
715
|
+
var n = H();
|
|
716
|
+
t.exports = Se()(n.isElement, !0);
|
|
717
|
+
} else t.exports = Ce()();
|
|
654
718
|
})))(), 1), K = function(e, t) {
|
|
655
719
|
let n = e, r = J[t], i = null, a = 0, o = null, s = [], c = {}, l = function(e, t) {
|
|
656
720
|
a = n * 4 + 17, i = function(e) {
|
|
@@ -734,7 +798,7 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
734
798
|
for (let e = 0; e < i; e += 1) for (let n = 0; n < t.length; n += 1) e < o[n].length && (c[l] = o[n][e], l += 1);
|
|
735
799
|
return c;
|
|
736
800
|
}, v = function(e, t, n) {
|
|
737
|
-
let r =
|
|
801
|
+
let r = we.getRSBlocks(e, t), i = Te();
|
|
738
802
|
for (let t = 0; t < n.length; t += 1) {
|
|
739
803
|
let r = n[t];
|
|
740
804
|
i.put(r.getMode(), 4), i.put(r.getLength(), X.getLengthInBits(r.getMode(), e)), r.write(i);
|
|
@@ -751,16 +815,16 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
751
815
|
let n = null;
|
|
752
816
|
switch (t) {
|
|
753
817
|
case "Numeric":
|
|
754
|
-
n =
|
|
818
|
+
n = Ee(e);
|
|
755
819
|
break;
|
|
756
820
|
case "Alphanumeric":
|
|
757
|
-
n =
|
|
821
|
+
n = De(e);
|
|
758
822
|
break;
|
|
759
823
|
case "Byte":
|
|
760
|
-
n =
|
|
824
|
+
n = Oe(e);
|
|
761
825
|
break;
|
|
762
826
|
case "Kanji":
|
|
763
|
-
n =
|
|
827
|
+
n = ke(e);
|
|
764
828
|
break;
|
|
765
829
|
default: throw "mode:" + t;
|
|
766
830
|
}
|
|
@@ -774,7 +838,7 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
774
838
|
if (n < 1) {
|
|
775
839
|
let e = 1;
|
|
776
840
|
for (; e < 40; e++) {
|
|
777
|
-
let t =
|
|
841
|
+
let t = we.getRSBlocks(e, r), n = Te();
|
|
778
842
|
for (let t = 0; t < s.length; t++) {
|
|
779
843
|
let r = s[t];
|
|
780
844
|
n.put(r.getMode(), 4), n.put(r.getLength(), X.getLengthInBits(r.getMode(), e)), r.write(n);
|
|
@@ -805,7 +869,7 @@ var O = Object.create, k = Object.defineProperty, A = Object.getOwnPropertyDescr
|
|
|
805
869
|
}, c.createDataURL = function(e, t) {
|
|
806
870
|
e ||= 2, t = t === void 0 ? e * 4 : t;
|
|
807
871
|
let n = c.getModuleCount() * e + t * 2, r = t, i = n - t;
|
|
808
|
-
return
|
|
872
|
+
return Pe(n, n, function(t, n) {
|
|
809
873
|
if (r <= t && t < i && r <= n && n < i) {
|
|
810
874
|
let i = Math.floor((t - r) / e), a = Math.floor((n - r) / e);
|
|
811
875
|
return +!c.isDark(a, i);
|
|
@@ -882,7 +946,7 @@ K.stringToBytes = function(e) {
|
|
|
882
946
|
return t;
|
|
883
947
|
}, K.createStringToBytes = function(e, t) {
|
|
884
948
|
let n = function() {
|
|
885
|
-
let n =
|
|
949
|
+
let n = Me(e), r = function() {
|
|
886
950
|
let e = n.read();
|
|
887
951
|
if (e == -1) throw "eof";
|
|
888
952
|
return e;
|
|
@@ -1298,7 +1362,7 @@ var q = {
|
|
|
1298
1362
|
for (let r = 0; r < e.getLength(); r += 1) n[r] ^= Z.gexp(Z.glog(e.getAt(r)) + t);
|
|
1299
1363
|
return Q(n, 0).mod(e);
|
|
1300
1364
|
}, r;
|
|
1301
|
-
},
|
|
1365
|
+
}, we = function() {
|
|
1302
1366
|
let e = [
|
|
1303
1367
|
[
|
|
1304
1368
|
1,
|
|
@@ -2506,7 +2570,7 @@ var q = {
|
|
|
2506
2570
|
}
|
|
2507
2571
|
return o;
|
|
2508
2572
|
}, n;
|
|
2509
|
-
}(),
|
|
2573
|
+
}(), Te = function() {
|
|
2510
2574
|
let e = [], t = 0, n = {};
|
|
2511
2575
|
return n.getBuffer = function() {
|
|
2512
2576
|
return e;
|
|
@@ -2520,7 +2584,7 @@ var q = {
|
|
|
2520
2584
|
let r = Math.floor(t / 8);
|
|
2521
2585
|
e.length <= r && e.push(0), n && (e[r] |= 128 >>> t % 8), t += 1;
|
|
2522
2586
|
}, n;
|
|
2523
|
-
},
|
|
2587
|
+
}, Ee = function(e) {
|
|
2524
2588
|
let t = q.MODE_NUMBER, n = e, r = {};
|
|
2525
2589
|
r.getMode = function() {
|
|
2526
2590
|
return t;
|
|
@@ -2540,7 +2604,7 @@ var q = {
|
|
|
2540
2604
|
throw "illegal char :" + e;
|
|
2541
2605
|
};
|
|
2542
2606
|
return r;
|
|
2543
|
-
},
|
|
2607
|
+
}, De = function(e) {
|
|
2544
2608
|
let t = q.MODE_ALPHA_NUM, n = e, r = {};
|
|
2545
2609
|
r.getMode = function() {
|
|
2546
2610
|
return t;
|
|
@@ -2568,7 +2632,7 @@ var q = {
|
|
|
2568
2632
|
}
|
|
2569
2633
|
};
|
|
2570
2634
|
return r;
|
|
2571
|
-
},
|
|
2635
|
+
}, Oe = function(e) {
|
|
2572
2636
|
let t = q.MODE_8BIT_BYTE, n = K.stringToBytes(e), r = {};
|
|
2573
2637
|
return r.getMode = function() {
|
|
2574
2638
|
return t;
|
|
@@ -2577,7 +2641,7 @@ var q = {
|
|
|
2577
2641
|
}, r.write = function(e) {
|
|
2578
2642
|
for (let t = 0; t < n.length; t += 1) e.put(n[t], 8);
|
|
2579
2643
|
}, r;
|
|
2580
|
-
},
|
|
2644
|
+
}, ke = function(e) {
|
|
2581
2645
|
let t = q.MODE_KANJI, n = K.stringToBytes;
|
|
2582
2646
|
(function(e, t) {
|
|
2583
2647
|
let r = n(e);
|
|
@@ -2599,7 +2663,7 @@ var q = {
|
|
|
2599
2663
|
}
|
|
2600
2664
|
if (n < t.length) throw "illegal char at " + (n + 1);
|
|
2601
2665
|
}, i;
|
|
2602
|
-
},
|
|
2666
|
+
}, Ae = function() {
|
|
2603
2667
|
let e = [], t = {};
|
|
2604
2668
|
return t.writeByte = function(t) {
|
|
2605
2669
|
e.push(t & 255);
|
|
@@ -2618,7 +2682,7 @@ var q = {
|
|
|
2618
2682
|
for (let n = 0; n < e.length; n += 1) n > 0 && (t += ","), t += e[n];
|
|
2619
2683
|
return t += "]", t;
|
|
2620
2684
|
}, t;
|
|
2621
|
-
},
|
|
2685
|
+
}, je = function() {
|
|
2622
2686
|
let e = 0, t = 0, n = 0, r = "", i = {}, a = function(e) {
|
|
2623
2687
|
r += String.fromCharCode(o(e & 63));
|
|
2624
2688
|
}, o = function(e) {
|
|
@@ -2640,7 +2704,7 @@ var q = {
|
|
|
2640
2704
|
}, i.toString = function() {
|
|
2641
2705
|
return r;
|
|
2642
2706
|
}, i;
|
|
2643
|
-
},
|
|
2707
|
+
}, Me = function(e) {
|
|
2644
2708
|
let t = e, n = 0, r = 0, i = 0, a = {};
|
|
2645
2709
|
a.read = function() {
|
|
2646
2710
|
for (; i < 8;) {
|
|
@@ -2664,7 +2728,7 @@ var q = {
|
|
|
2664
2728
|
throw "c:" + e;
|
|
2665
2729
|
};
|
|
2666
2730
|
return a;
|
|
2667
|
-
},
|
|
2731
|
+
}, Ne = function(e, t) {
|
|
2668
2732
|
let n = e, r = t, i = Array(e * t), a = {};
|
|
2669
2733
|
a.setPixel = function(e, t, r) {
|
|
2670
2734
|
i[t * n + e] = r;
|
|
@@ -2689,7 +2753,7 @@ var q = {
|
|
|
2689
2753
|
let t = 1 << e, n = (1 << e) + 1, r = e + 1, a = c();
|
|
2690
2754
|
for (let e = 0; e < t; e += 1) a.add(String.fromCharCode(e));
|
|
2691
2755
|
a.add(String.fromCharCode(t)), a.add(String.fromCharCode(n));
|
|
2692
|
-
let s =
|
|
2756
|
+
let s = Ae(), l = o(s);
|
|
2693
2757
|
l.write(t, r);
|
|
2694
2758
|
let u = 0, d = String.fromCharCode(i[u]);
|
|
2695
2759
|
for (u += 1; u < i.length;) {
|
|
@@ -2711,12 +2775,12 @@ var q = {
|
|
|
2711
2775
|
}, n;
|
|
2712
2776
|
};
|
|
2713
2777
|
return a;
|
|
2714
|
-
},
|
|
2715
|
-
let r =
|
|
2778
|
+
}, Pe = function(e, t, n) {
|
|
2779
|
+
let r = Ne(e, t);
|
|
2716
2780
|
for (let i = 0; i < t; i += 1) for (let t = 0; t < e; t += 1) r.setPixel(t, i, n(t, i));
|
|
2717
|
-
let i =
|
|
2781
|
+
let i = Ae();
|
|
2718
2782
|
r.write(i);
|
|
2719
|
-
let a =
|
|
2783
|
+
let a = je(), o = i.toByteArray();
|
|
2720
2784
|
for (let e = 0; e < o.length; e += 1) a.writeByte(o[e]);
|
|
2721
2785
|
return a.flush(), "data:image/gif;base64," + a;
|
|
2722
2786
|
};
|
|
@@ -2732,16 +2796,16 @@ function $() {
|
|
|
2732
2796
|
return e;
|
|
2733
2797
|
}, $.apply(null, arguments);
|
|
2734
2798
|
}
|
|
2735
|
-
function
|
|
2799
|
+
function Fe(e, t) {
|
|
2736
2800
|
if (e == null) return {};
|
|
2737
|
-
var n, r, i =
|
|
2801
|
+
var n, r, i = Ie(e, t);
|
|
2738
2802
|
if (Object.getOwnPropertySymbols) {
|
|
2739
2803
|
var a = Object.getOwnPropertySymbols(e);
|
|
2740
2804
|
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
2741
2805
|
}
|
|
2742
2806
|
return i;
|
|
2743
2807
|
}
|
|
2744
|
-
function
|
|
2808
|
+
function Ie(e, t) {
|
|
2745
2809
|
if (e == null) return {};
|
|
2746
2810
|
var n = {};
|
|
2747
2811
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -2750,7 +2814,7 @@ function Se(e, t) {
|
|
|
2750
2814
|
}
|
|
2751
2815
|
return n;
|
|
2752
2816
|
}
|
|
2753
|
-
var
|
|
2817
|
+
var Le = [
|
|
2754
2818
|
"bgColor",
|
|
2755
2819
|
"bgD",
|
|
2756
2820
|
"fgD",
|
|
@@ -2759,7 +2823,7 @@ var Ce = [
|
|
|
2759
2823
|
"title",
|
|
2760
2824
|
"viewBoxSize",
|
|
2761
2825
|
"xmlns"
|
|
2762
|
-
],
|
|
2826
|
+
], Re = {
|
|
2763
2827
|
bgColor: G.default.oneOfType([G.default.object, G.default.string]).isRequired,
|
|
2764
2828
|
bgD: G.default.string.isRequired,
|
|
2765
2829
|
fgColor: G.default.oneOfType([G.default.object, G.default.string]).isRequired,
|
|
@@ -2768,24 +2832,24 @@ var Ce = [
|
|
|
2768
2832
|
title: G.default.string,
|
|
2769
2833
|
viewBoxSize: G.default.number.isRequired,
|
|
2770
2834
|
xmlns: G.default.string
|
|
2771
|
-
},
|
|
2772
|
-
var n = e.bgColor,
|
|
2773
|
-
return /*#__PURE__*/
|
|
2835
|
+
}, ze = /*#__PURE__*/ o(function(e, t) {
|
|
2836
|
+
var n = e.bgColor, r = e.bgD, i = e.fgD, o = e.fgColor, s = e.size, c = e.title, l = e.viewBoxSize, u = e.xmlns, d = u === void 0 ? "http://www.w3.org/2000/svg" : u, f = Fe(e, Le);
|
|
2837
|
+
return /*#__PURE__*/ a.createElement("svg", $({}, f, {
|
|
2774
2838
|
height: s,
|
|
2775
2839
|
ref: t,
|
|
2776
2840
|
viewBox: `0 0 ${l} ${l}`,
|
|
2777
2841
|
width: s,
|
|
2778
2842
|
xmlns: d
|
|
2779
|
-
}), c ? /*#__PURE__*/
|
|
2780
|
-
d:
|
|
2843
|
+
}), c ? /*#__PURE__*/ a.createElement("title", null, c) : null, /*#__PURE__*/ a.createElement("path", {
|
|
2844
|
+
d: r,
|
|
2781
2845
|
fill: n
|
|
2782
|
-
}), /*#__PURE__*/
|
|
2783
|
-
d:
|
|
2846
|
+
}), /*#__PURE__*/ a.createElement("path", {
|
|
2847
|
+
d: i,
|
|
2784
2848
|
fill: o
|
|
2785
2849
|
}));
|
|
2786
2850
|
});
|
|
2787
|
-
|
|
2788
|
-
var
|
|
2851
|
+
ze.displayName = "QRCodeSvg", ze.propTypes = Re;
|
|
2852
|
+
var Be = [
|
|
2789
2853
|
"bgColor",
|
|
2790
2854
|
"fgColor",
|
|
2791
2855
|
"level",
|
|
@@ -2795,22 +2859,22 @@ var Ee = [
|
|
|
2795
2859
|
K.stringToBytes = function(e) {
|
|
2796
2860
|
return Array.from(new TextEncoder().encode(e));
|
|
2797
2861
|
};
|
|
2798
|
-
var
|
|
2862
|
+
var Ve = {
|
|
2799
2863
|
bgColor: G.default.oneOfType([G.default.object, G.default.string]),
|
|
2800
2864
|
fgColor: G.default.oneOfType([G.default.object, G.default.string]),
|
|
2801
2865
|
level: G.default.string,
|
|
2802
2866
|
size: G.default.number,
|
|
2803
2867
|
value: G.default.string.isRequired
|
|
2804
|
-
},
|
|
2805
|
-
var n = e.bgColor,
|
|
2868
|
+
}, He = /*#__PURE__*/ o(function(e, t) {
|
|
2869
|
+
var n = e.bgColor, r = n === void 0 ? "#FFFFFF" : n, i = e.fgColor, o = i === void 0 ? "#000000" : i, s = e.level, c = s === void 0 ? "L" : s, l = e.size, u = l === void 0 ? 256 : l, d = e.value, f = Fe(e, Be), p = K(0, c);
|
|
2806
2870
|
p.addData(d), p.make();
|
|
2807
2871
|
var m = p.getModuleCount(), h = Array.from({ length: m }, function(e, t) {
|
|
2808
2872
|
return Array.from({ length: m }, function(e, n) {
|
|
2809
2873
|
return p.isDark(t, n);
|
|
2810
2874
|
});
|
|
2811
2875
|
});
|
|
2812
|
-
return /*#__PURE__*/
|
|
2813
|
-
bgColor:
|
|
2876
|
+
return /*#__PURE__*/ a.createElement(ze, $({}, f, {
|
|
2877
|
+
bgColor: r,
|
|
2814
2878
|
bgD: h.map(function(e, t) {
|
|
2815
2879
|
return e.map(function(e, n) {
|
|
2816
2880
|
return e ? "" : `M ${n} ${t} l 1 0 0 1 -1 0 Z`;
|
|
@@ -2827,124 +2891,125 @@ var De = {
|
|
|
2827
2891
|
viewBoxSize: m
|
|
2828
2892
|
}));
|
|
2829
2893
|
});
|
|
2830
|
-
|
|
2831
|
-
var
|
|
2894
|
+
He.displayName = "QRCode", He.propTypes = Ve;
|
|
2895
|
+
var Ue = {
|
|
2832
2896
|
container: "_container_hzzl6_1",
|
|
2833
2897
|
qrColor: "_qrColor_hzzl6_6"
|
|
2834
|
-
},
|
|
2835
|
-
let { colors:
|
|
2836
|
-
"--qr-border":
|
|
2837
|
-
"--qr-bg":
|
|
2838
|
-
"--qr-color":
|
|
2898
|
+
}, We = He, Ge = ({ value: t, labels: r, styles: i, svgRef: a }) => {
|
|
2899
|
+
let { colors: o } = i ?? {}, s = e({
|
|
2900
|
+
"--qr-border": o?.borderColor,
|
|
2901
|
+
"--qr-bg": o?.backgroundColor,
|
|
2902
|
+
"--qr-color": o?.fillColor
|
|
2839
2903
|
});
|
|
2840
|
-
return /* @__PURE__ */
|
|
2904
|
+
return /* @__PURE__ */ O("div", {
|
|
2841
2905
|
role: "img",
|
|
2842
2906
|
"aria-label": r.ariaLabel,
|
|
2843
|
-
style:
|
|
2844
|
-
className:
|
|
2845
|
-
children: /* @__PURE__ */
|
|
2846
|
-
|
|
2907
|
+
style: s,
|
|
2908
|
+
className: n("flex size-40 items-center justify-center self-center rounded-lg border p-3", Ue.container),
|
|
2909
|
+
children: /* @__PURE__ */ O(We, {
|
|
2910
|
+
ref: a,
|
|
2911
|
+
value: t,
|
|
2847
2912
|
size: 128,
|
|
2848
2913
|
bgColor: "transparent",
|
|
2849
2914
|
fgColor: "currentColor",
|
|
2850
2915
|
"aria-hidden": !0,
|
|
2851
|
-
className:
|
|
2916
|
+
className: n("size-full", Ue.qrColor)
|
|
2852
2917
|
})
|
|
2853
2918
|
});
|
|
2854
|
-
},
|
|
2919
|
+
}, Ke = ({ ariaLabel: e, skeletonColor: t = B.skeletonColor }) => /* @__PURE__ */ k("div", {
|
|
2855
2920
|
role: "status",
|
|
2856
2921
|
"aria-label": e,
|
|
2857
2922
|
className: "flex flex-col gap-3",
|
|
2858
2923
|
children: [
|
|
2859
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ k("div", {
|
|
2860
2925
|
"aria-hidden": !0,
|
|
2861
2926
|
className: "flex items-center gap-2.5",
|
|
2862
2927
|
children: [
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
variant:
|
|
2928
|
+
/* @__PURE__ */ O(v, {
|
|
2929
|
+
variant: y.Circular,
|
|
2865
2930
|
width: 32,
|
|
2866
2931
|
height: 32,
|
|
2867
2932
|
color: t
|
|
2868
2933
|
}),
|
|
2869
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ k("div", {
|
|
2870
2935
|
className: "flex min-w-0 flex-1 flex-col gap-1.5",
|
|
2871
|
-
children: [/* @__PURE__ */
|
|
2872
|
-
variant:
|
|
2936
|
+
children: [/* @__PURE__ */ O(v, {
|
|
2937
|
+
variant: y.Text,
|
|
2873
2938
|
width: "70%",
|
|
2874
2939
|
height: 16,
|
|
2875
2940
|
color: t
|
|
2876
|
-
}), /* @__PURE__ */
|
|
2877
|
-
variant:
|
|
2941
|
+
}), /* @__PURE__ */ O(v, {
|
|
2942
|
+
variant: y.Text,
|
|
2878
2943
|
width: "45%",
|
|
2879
2944
|
height: 12,
|
|
2880
2945
|
color: t
|
|
2881
2946
|
})]
|
|
2882
2947
|
}),
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
variant:
|
|
2948
|
+
/* @__PURE__ */ O(v, {
|
|
2949
|
+
variant: y.Rectangular,
|
|
2885
2950
|
width: 92,
|
|
2886
2951
|
height: 30,
|
|
2887
2952
|
color: t
|
|
2888
2953
|
})
|
|
2889
2954
|
]
|
|
2890
2955
|
}),
|
|
2891
|
-
/* @__PURE__ */
|
|
2956
|
+
/* @__PURE__ */ k("div", {
|
|
2892
2957
|
"aria-hidden": !0,
|
|
2893
2958
|
className: "flex flex-col gap-1.5",
|
|
2894
|
-
children: [/* @__PURE__ */
|
|
2895
|
-
variant:
|
|
2959
|
+
children: [/* @__PURE__ */ O(v, {
|
|
2960
|
+
variant: y.Text,
|
|
2896
2961
|
width: "100%",
|
|
2897
2962
|
height: 12,
|
|
2898
2963
|
color: t
|
|
2899
|
-
}), /* @__PURE__ */
|
|
2900
|
-
variant:
|
|
2964
|
+
}), /* @__PURE__ */ O(v, {
|
|
2965
|
+
variant: y.Text,
|
|
2901
2966
|
width: "60%",
|
|
2902
2967
|
height: 12,
|
|
2903
2968
|
color: t
|
|
2904
2969
|
})]
|
|
2905
2970
|
}),
|
|
2906
|
-
/* @__PURE__ */
|
|
2971
|
+
/* @__PURE__ */ O(v, {
|
|
2907
2972
|
"aria-hidden": !0,
|
|
2908
|
-
variant:
|
|
2973
|
+
variant: y.Rectangular,
|
|
2909
2974
|
width: "100%",
|
|
2910
2975
|
height: 40,
|
|
2911
2976
|
color: t
|
|
2912
2977
|
}),
|
|
2913
|
-
/* @__PURE__ */
|
|
2978
|
+
/* @__PURE__ */ O(v, {
|
|
2914
2979
|
"aria-hidden": !0,
|
|
2915
|
-
variant:
|
|
2980
|
+
variant: y.Text,
|
|
2916
2981
|
width: "50%",
|
|
2917
2982
|
height: 12,
|
|
2918
2983
|
color: t
|
|
2919
2984
|
})
|
|
2920
2985
|
]
|
|
2921
|
-
}),
|
|
2986
|
+
}), qe = "share-popover-qr-button", Je = "share-popover-back-button", Ye = ({ title: e, view: t, qrButtonLabel: r, linkLabel: i, onViewChange: a, titleClassName: o = "dial-h3-text" }) => /* @__PURE__ */ k("div", {
|
|
2922
2987
|
className: "flex items-center gap-2",
|
|
2923
|
-
children: [/* @__PURE__ */
|
|
2924
|
-
className:
|
|
2988
|
+
children: [/* @__PURE__ */ O("span", {
|
|
2989
|
+
className: n(o, B.title),
|
|
2925
2990
|
children: e
|
|
2926
|
-
}),
|
|
2927
|
-
id:
|
|
2991
|
+
}), t === z.Link ? /* @__PURE__ */ O(m, {
|
|
2992
|
+
id: qe,
|
|
2928
2993
|
label: r,
|
|
2929
|
-
iconBefore: /* @__PURE__ */
|
|
2930
|
-
size:
|
|
2994
|
+
iconBefore: /* @__PURE__ */ O(T, {
|
|
2995
|
+
size: d.SM,
|
|
2931
2996
|
"aria-hidden": !0,
|
|
2932
|
-
stroke:
|
|
2997
|
+
stroke: f
|
|
2933
2998
|
}),
|
|
2934
2999
|
className: "ms-auto",
|
|
2935
|
-
onClick: () => a(
|
|
2936
|
-
}) : /* @__PURE__ */
|
|
2937
|
-
id:
|
|
3000
|
+
onClick: () => a(z.Qr)
|
|
3001
|
+
}) : /* @__PURE__ */ O(m, {
|
|
3002
|
+
id: Je,
|
|
2938
3003
|
label: i,
|
|
2939
|
-
iconBefore: /* @__PURE__ */
|
|
2940
|
-
size:
|
|
3004
|
+
iconBefore: /* @__PURE__ */ O(w, {
|
|
3005
|
+
size: d.SM,
|
|
2941
3006
|
"aria-hidden": !0,
|
|
2942
|
-
stroke:
|
|
3007
|
+
stroke: f
|
|
2943
3008
|
}),
|
|
2944
3009
|
className: "ms-auto",
|
|
2945
|
-
onClick: () => a(
|
|
3010
|
+
onClick: () => a(z.Link)
|
|
2946
3011
|
})]
|
|
2947
|
-
}),
|
|
3012
|
+
}), Xe = s(({ url: t, isLoading: r, error: a, access: o, canEditAccess: s, onAccessChange: d, onClose: f, labels: p, className: m, styles: h }) => {
|
|
2948
3013
|
let g = h?.colors, _ = h?.typography, v = e({
|
|
2949
3014
|
"--shp-access-trigger-bg": g?.accessTriggerBackground,
|
|
2950
3015
|
"--shp-access-trigger-border": g?.accessTriggerBorder,
|
|
@@ -2957,131 +3022,128 @@ var ke = {
|
|
|
2957
3022
|
"--shp-anyone-title": g?.anyoneTitle,
|
|
2958
3023
|
"--shp-anyone-subtitle": g?.anyoneSubtitle,
|
|
2959
3024
|
"--shp-access-chevron": g?.accessChevron,
|
|
2960
|
-
"--shp-menu-item-label": g?.menuItemLabel,
|
|
2961
3025
|
"--shp-link-row-bg": g?.linkRowBackground,
|
|
2962
3026
|
"--shp-link-text": g?.linkText,
|
|
2963
3027
|
"--shp-error-text": g?.errorText,
|
|
2964
3028
|
"--shp-note-text": g?.noteText,
|
|
2965
3029
|
"--shp-divider": g?.divider,
|
|
2966
3030
|
"--shp-skeleton-color": g?.skeletonColor
|
|
2967
|
-
}), { title:
|
|
2968
|
-
|
|
2969
|
-
};
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
}, [W]);
|
|
2973
|
-
let q = s(null);
|
|
2974
|
-
o(() => {
|
|
2975
|
-
re(q.current);
|
|
3031
|
+
}), y = e({ "--shp-menu-item-label": g?.menuItemLabel }), { title: b = "Share", qrButtonLabel: x = "QR", linkLabel: S = "Link", anyoneWithLinkTitle: C = "Anyone with the link", anyoneWithLinkSubtitle: w = "in your organization", accessAriaLabel: T = "Link access level", accessViewLabel: E = "Can view", accessEditLabel: A = "Can edit", visibilityNote: j = "This deployment and its updates will be visible to users with the link.", visibilityNoteEdit: M = "Anyone with the link will be able to view and edit this deployment.", copyButtonLabel: N = "Copy", copiedButtonLabel: P = "Copied", linkAriaLabel: F = "Share link", expiryNote: I, qrCodeAriaLabel: L = "QR code for the share link", qrCopyButtonLabel: ee = "Copy", qrCopiedButtonLabel: ne = "Copied", qrDownloadButtonLabel: se = "Download", qrDownloadFileName: ce = "share-qr-code.png", loadingLabel: le = "Creating share link…", errorTitle: ue = "Couldn’t create the share link. Please try again.", nestedItemsNote: de } = p ?? {}, [V, fe] = u(z.Link), { isCopied: pe, copy: me } = i(t ?? ""), he = l(null), [ge, ve] = u(!1), ye = l(null), H = (e) => {
|
|
3032
|
+
ve(e), e || ye.current?.focus();
|
|
3033
|
+
}, U = l(null);
|
|
3034
|
+
c(() => {
|
|
3035
|
+
ie(U.current);
|
|
2976
3036
|
let e = setTimeout(() => {
|
|
2977
|
-
|
|
3037
|
+
U.current?.contains(document.activeElement) || ie(U.current);
|
|
2978
3038
|
}, 0);
|
|
2979
3039
|
return () => clearTimeout(e);
|
|
2980
3040
|
}, []);
|
|
2981
|
-
let
|
|
2982
|
-
|
|
2983
|
-
if (
|
|
2984
|
-
|
|
3041
|
+
let W = l(!0);
|
|
3042
|
+
c(() => {
|
|
3043
|
+
if (W.current) {
|
|
3044
|
+
W.current = !1;
|
|
2985
3045
|
return;
|
|
2986
3046
|
}
|
|
2987
|
-
let e = V ===
|
|
3047
|
+
let e = V === z.Qr ? Je : qe;
|
|
2988
3048
|
document.getElementById(e)?.focus();
|
|
2989
3049
|
}, [V]);
|
|
2990
|
-
let
|
|
2991
|
-
let t =
|
|
2992
|
-
if (
|
|
3050
|
+
let be = (e) => {
|
|
3051
|
+
let t = e.target.closest("[role=\"menu\"]"), n = t ? Array.from(t.querySelectorAll("[role=\"menuitemradio\"]")) : re(U.current);
|
|
3052
|
+
if (n.length === 0) return;
|
|
2993
3053
|
e.preventDefault();
|
|
2994
|
-
let
|
|
2995
|
-
|
|
3054
|
+
let r = n.indexOf(document.activeElement), i = e.shiftKey ? -1 : 1;
|
|
3055
|
+
n[r === -1 ? 0 : (r + i + n.length) % n.length]?.focus();
|
|
2996
3056
|
};
|
|
2997
|
-
return /* @__PURE__ */
|
|
2998
|
-
ref:
|
|
3057
|
+
return /* @__PURE__ */ k("div", {
|
|
3058
|
+
ref: U,
|
|
2999
3059
|
role: "dialog",
|
|
3000
|
-
"aria-label":
|
|
3060
|
+
"aria-label": b,
|
|
3001
3061
|
tabIndex: -1,
|
|
3002
3062
|
style: v,
|
|
3003
|
-
className:
|
|
3063
|
+
className: n("flex w-96 flex-col gap-3 rounded-xl bg-layer-raised px-6 pb-6 pt-4 shadow-lg outline-none", m, te.popover),
|
|
3004
3064
|
onKeyDownCapture: (e) => {
|
|
3005
3065
|
if (e.key === "Tab") {
|
|
3006
|
-
|
|
3066
|
+
be(e);
|
|
3007
3067
|
return;
|
|
3008
3068
|
}
|
|
3009
3069
|
if (e.key === "Escape") {
|
|
3010
|
-
if (e.stopPropagation(),
|
|
3011
|
-
e.preventDefault(),
|
|
3070
|
+
if (e.stopPropagation(), ge) {
|
|
3071
|
+
e.preventDefault(), H(!1);
|
|
3012
3072
|
return;
|
|
3013
3073
|
}
|
|
3014
|
-
V ===
|
|
3074
|
+
V === z.Qr ? (e.preventDefault(), fe(z.Link)) : f();
|
|
3015
3075
|
}
|
|
3016
3076
|
},
|
|
3017
3077
|
children: [
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
title:
|
|
3078
|
+
/* @__PURE__ */ O(Ye, {
|
|
3079
|
+
title: b,
|
|
3020
3080
|
view: V,
|
|
3021
|
-
qrButtonLabel:
|
|
3022
|
-
linkLabel:
|
|
3023
|
-
onViewChange:
|
|
3081
|
+
qrButtonLabel: x,
|
|
3082
|
+
linkLabel: S,
|
|
3083
|
+
onViewChange: fe
|
|
3024
3084
|
}),
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
|
|
3027
|
-
ariaLabel:
|
|
3085
|
+
/* @__PURE__ */ O("div", { className: n("-mt-1.5 h-px w-full", B.divider) }),
|
|
3086
|
+
r && /* @__PURE__ */ O(Ke, {
|
|
3087
|
+
ariaLabel: le,
|
|
3028
3088
|
skeletonColor: g?.skeletonColor
|
|
3029
3089
|
}),
|
|
3030
|
-
!
|
|
3090
|
+
!r && a != null && /* @__PURE__ */ O("p", {
|
|
3031
3091
|
role: "alert",
|
|
3032
|
-
className:
|
|
3033
|
-
children:
|
|
3092
|
+
className: n(_?.errorClassName ?? "dial-tiny-text", "py-6 text-center", B.errorText),
|
|
3093
|
+
children: ue
|
|
3034
3094
|
}),
|
|
3035
|
-
!
|
|
3036
|
-
/* @__PURE__ */
|
|
3037
|
-
anyoneWithLinkTitle:
|
|
3038
|
-
anyoneWithLinkSubtitle:
|
|
3039
|
-
access:
|
|
3040
|
-
canEditAccess:
|
|
3041
|
-
accessViewLabel:
|
|
3042
|
-
accessEditLabel:
|
|
3043
|
-
accessAriaLabel:
|
|
3044
|
-
isOpen:
|
|
3045
|
-
onOpenChange:
|
|
3095
|
+
!r && a == null && t != null && /* @__PURE__ */ k(D, { children: [
|
|
3096
|
+
/* @__PURE__ */ O(ae, {
|
|
3097
|
+
anyoneWithLinkTitle: C,
|
|
3098
|
+
anyoneWithLinkSubtitle: w,
|
|
3099
|
+
access: o,
|
|
3100
|
+
canEditAccess: s,
|
|
3101
|
+
accessViewLabel: E,
|
|
3102
|
+
accessEditLabel: A,
|
|
3103
|
+
accessAriaLabel: T,
|
|
3104
|
+
isOpen: ge,
|
|
3105
|
+
onOpenChange: H,
|
|
3046
3106
|
onAccessChange: d,
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
e.preventDefault();
|
|
3050
|
-
let t = Array.from(G.current?.querySelectorAll("[role=\"menuitemradio\"]") ?? []);
|
|
3051
|
-
t.length !== 0 && t[(t.indexOf(document.activeElement) + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus();
|
|
3052
|
-
},
|
|
3053
|
-
triggerRef: le,
|
|
3054
|
-
menuRef: G,
|
|
3107
|
+
menuStyle: y,
|
|
3108
|
+
triggerRef: ye,
|
|
3055
3109
|
titleClassName: _?.anyoneTitleClassName,
|
|
3056
3110
|
subtitleClassName: _?.anyoneSubtitleClassName,
|
|
3057
3111
|
accessTriggerLabelClassName: _?.accessTriggerLabelClassName
|
|
3058
3112
|
}),
|
|
3059
|
-
/* @__PURE__ */
|
|
3060
|
-
className:
|
|
3061
|
-
children:
|
|
3113
|
+
/* @__PURE__ */ O("p", {
|
|
3114
|
+
className: n(_?.noteClassName ?? "dial-tiny-text", B.note),
|
|
3115
|
+
children: s && o.includes(R.Edit) ? M : j
|
|
3062
3116
|
}),
|
|
3063
|
-
|
|
3064
|
-
className:
|
|
3065
|
-
children:
|
|
3117
|
+
de != null && /* @__PURE__ */ O("p", {
|
|
3118
|
+
className: n(_?.nestedItemsNoteClassName ?? "dial-tiny-semi-text", B.note),
|
|
3119
|
+
children: de
|
|
3066
3120
|
}),
|
|
3067
|
-
V ===
|
|
3068
|
-
value:
|
|
3069
|
-
labels: { ariaLabel:
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3121
|
+
V === z.Qr ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(Ge, {
|
|
3122
|
+
value: t,
|
|
3123
|
+
labels: { ariaLabel: L },
|
|
3124
|
+
svgRef: he
|
|
3125
|
+
}), /* @__PURE__ */ O(_e, {
|
|
3126
|
+
url: t,
|
|
3127
|
+
getSvg: () => he.current,
|
|
3128
|
+
copyLabel: ee,
|
|
3129
|
+
copiedLabel: ne,
|
|
3130
|
+
downloadLabel: se,
|
|
3131
|
+
downloadFileName: ce
|
|
3132
|
+
})] }) : /* @__PURE__ */ O(oe, {
|
|
3133
|
+
url: t,
|
|
3134
|
+
linkAriaLabel: F,
|
|
3135
|
+
isCopied: pe,
|
|
3136
|
+
copyButtonLabel: N,
|
|
3137
|
+
copiedButtonLabel: P,
|
|
3138
|
+
onCopy: me
|
|
3077
3139
|
}),
|
|
3078
|
-
|
|
3079
|
-
className:
|
|
3080
|
-
children:
|
|
3140
|
+
I != null && /* @__PURE__ */ O("p", {
|
|
3141
|
+
className: n(_?.noteClassName ?? "dial-tiny-text", B.note),
|
|
3142
|
+
children: I
|
|
3081
3143
|
})
|
|
3082
3144
|
] })
|
|
3083
3145
|
]
|
|
3084
3146
|
});
|
|
3085
3147
|
});
|
|
3086
3148
|
//#endregion
|
|
3087
|
-
export {
|
|
3149
|
+
export { Ge as QrCode, te as SHARE_CLASS, R as ShareLinkAccess, Xe as SharePopover, z as SharePopoverView };
|