viewgate-wrapper 1.3.3 → 1.3.5
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/dist/cli.js +74 -0
- package/dist/plugin/next-loader.js +11 -0
- package/dist/plugin/transform-logic.js +20 -0
- package/dist/plugin/vite-plugin-viewgate.js +14 -0
- package/dist/viewgate-wrapper.js +568 -440
- package/dist/viewgate-wrapper.umd.cjs +5 -7
- package/package.json +1 -1
package/dist/viewgate-wrapper.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap";:root{--vg-primary: #2513ec;--vg-primary-gradient: linear-gradient(135deg, #2513ec 0%, #7e3ff2 100%);--vg-glass: rgba(255, 255, 255, .7);--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow: 0 8px 32px 0 rgba(31, 38, 135, .37);--vg-radius: 16px}body{font-family:Inter,system-ui,-apple-system,sans-serif!important;margin:0}.vg-glassmorphism{background:var(--vg-glass);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--vg-glass-border);box-shadow:var(--vg-shadow);border-radius:var(--vg-radius)}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:10px 24px;border-radius:12px;font-weight:600;cursor:pointer;transition:transform .2s,box-shadow .2s;box-shadow:0 4px 12px #2513ec4d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 16px #2513ec66}.vg-button-ghost{background:transparent;color:#444;border:1px solid #ddd;padding:10px 24px;border-radius:12px;cursor:pointer;transition:background .2s}.vg-button-ghost:hover{background:#0000000d}.vg-badge{background:#2513ec1a;color:var(--vg-primary);padding:4px 12px;border-radius:20px;font-size:12px;font-family:JetBrains Mono,monospace;font-weight:700;border:1px solid rgba(37,19,236,.2)}.vg-textarea{width:100%;border:1.5px solid #eee;border-radius:12px;padding:12px;font-family:inherit;color:#0f172a;resize:none;transition:border-color .2s,box-shadow .2s;outline:none}.vg-textarea:focus{border-color:var(--vg-primary);box-shadow:0 0 0 4px #2513ec1a}@keyframes vg-slide-in{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes vg-fade-in{0%{opacity:0}to{opacity:1}}.vg-animate-slide{animation:vg-slide-in .3s cubic-bezier(.16,1,.3,1)}.vg-animate-fade{animation:vg-fade-in .2s ease-out}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px;z-index:100000}.vg-toast{padding:16px 24px;display:flex;align-items:center;gap:12px;min-width:300px}.vg-toast.success{background:#ecfdf5;border:1px solid #10b981;color:#065f46}.vg-toast.error{background:#fef2f2;border:1px solid #ef4444;color:#991b1b}.vg-cursor-pointer *{cursor:pointer!important}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import Ae, { createContext as $e, useState as
|
|
3
|
-
var
|
|
2
|
+
import Ae, { createContext as $e, useState as C, useContext as Le, useCallback as oe, useEffect as Fe } from "react";
|
|
3
|
+
var D = { exports: {} }, V = {};
|
|
4
4
|
var ie;
|
|
5
|
-
function
|
|
6
|
-
if (ie) return
|
|
5
|
+
function Ve() {
|
|
6
|
+
if (ie) return V;
|
|
7
7
|
ie = 1;
|
|
8
8
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
|
-
function r(n,
|
|
9
|
+
function r(n, a, s) {
|
|
10
10
|
var i = null;
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
for (var c in
|
|
14
|
-
c !== "key" && (
|
|
15
|
-
} else
|
|
16
|
-
return
|
|
11
|
+
if (s !== void 0 && (i = "" + s), a.key !== void 0 && (i = "" + a.key), "key" in a) {
|
|
12
|
+
s = {};
|
|
13
|
+
for (var c in a)
|
|
14
|
+
c !== "key" && (s[c] = a[c]);
|
|
15
|
+
} else s = a;
|
|
16
|
+
return a = s.ref, {
|
|
17
17
|
$$typeof: e,
|
|
18
18
|
type: n,
|
|
19
19
|
key: i,
|
|
20
|
-
ref:
|
|
21
|
-
props:
|
|
20
|
+
ref: a !== void 0 ? a : null,
|
|
21
|
+
props: s
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return V.Fragment = t, V.jsx = r, V.jsxs = r, V;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var I = {};
|
|
27
27
|
var ce;
|
|
28
28
|
function Ie() {
|
|
29
29
|
return ce || (ce = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
30
|
function e(o) {
|
|
31
31
|
if (o == null) return null;
|
|
32
32
|
if (typeof o == "function")
|
|
33
|
-
return o.$$typeof ===
|
|
33
|
+
return o.$$typeof === _e ? null : o.displayName || o.name || null;
|
|
34
34
|
if (typeof o == "string") return o;
|
|
35
35
|
switch (o) {
|
|
36
36
|
case T:
|
|
37
37
|
return "Fragment";
|
|
38
|
-
case
|
|
38
|
+
case L:
|
|
39
39
|
return "Profiler";
|
|
40
40
|
case $:
|
|
41
41
|
return "StrictMode";
|
|
42
|
-
case
|
|
42
|
+
case g:
|
|
43
43
|
return "Suspense";
|
|
44
|
-
case
|
|
44
|
+
case P:
|
|
45
45
|
return "SuspenseList";
|
|
46
46
|
case ke:
|
|
47
47
|
return "Activity";
|
|
@@ -50,21 +50,21 @@ function Ie() {
|
|
|
50
50
|
switch (typeof o.tag == "number" && console.error(
|
|
51
51
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
52
|
), o.$$typeof) {
|
|
53
|
-
case
|
|
53
|
+
case G:
|
|
54
54
|
return "Portal";
|
|
55
|
-
case
|
|
55
|
+
case z:
|
|
56
56
|
return o.displayName || "Context";
|
|
57
57
|
case N:
|
|
58
58
|
return (o._context.displayName || "Context") + ".Consumer";
|
|
59
|
-
case
|
|
60
|
-
var
|
|
61
|
-
return o = o.displayName, o || (o =
|
|
62
|
-
case
|
|
63
|
-
return
|
|
64
|
-
case
|
|
65
|
-
|
|
59
|
+
case b:
|
|
60
|
+
var f = o.render;
|
|
61
|
+
return o = o.displayName, o || (o = f.displayName || f.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
62
|
+
case F:
|
|
63
|
+
return f = o.displayName || null, f !== null ? f : e(o.type) || "Memo";
|
|
64
|
+
case k:
|
|
65
|
+
f = o._payload, o = o._init;
|
|
66
66
|
try {
|
|
67
|
-
return e(o(
|
|
67
|
+
return e(o(f));
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -76,54 +76,54 @@ function Ie() {
|
|
|
76
76
|
function r(o) {
|
|
77
77
|
try {
|
|
78
78
|
t(o);
|
|
79
|
-
var
|
|
79
|
+
var f = !1;
|
|
80
80
|
} catch {
|
|
81
|
-
|
|
81
|
+
f = !0;
|
|
82
82
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
var
|
|
86
|
-
return
|
|
87
|
-
|
|
83
|
+
if (f) {
|
|
84
|
+
f = console;
|
|
85
|
+
var p = f.error, w = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
86
|
+
return p.call(
|
|
87
|
+
f,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
|
|
89
|
+
w
|
|
90
90
|
), t(o);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
function n(o) {
|
|
94
94
|
if (o === T) return "<>";
|
|
95
|
-
if (typeof o == "object" && o !== null && o.$$typeof ===
|
|
95
|
+
if (typeof o == "object" && o !== null && o.$$typeof === k)
|
|
96
96
|
return "<...>";
|
|
97
97
|
try {
|
|
98
|
-
var
|
|
99
|
-
return
|
|
98
|
+
var f = e(o);
|
|
99
|
+
return f ? "<" + f + ">" : "<...>";
|
|
100
100
|
} catch {
|
|
101
101
|
return "<...>";
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
var o =
|
|
104
|
+
function a() {
|
|
105
|
+
var o = Y.A;
|
|
106
106
|
return o === null ? null : o.getOwner();
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function s() {
|
|
109
109
|
return Error("react-stack-top-frame");
|
|
110
110
|
}
|
|
111
111
|
function i(o) {
|
|
112
112
|
if (ee.call(o, "key")) {
|
|
113
|
-
var
|
|
114
|
-
if (
|
|
113
|
+
var f = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
114
|
+
if (f && f.isReactWarning) return !1;
|
|
115
115
|
}
|
|
116
116
|
return o.key !== void 0;
|
|
117
117
|
}
|
|
118
|
-
function c(o,
|
|
119
|
-
function
|
|
118
|
+
function c(o, f) {
|
|
119
|
+
function p() {
|
|
120
120
|
te || (te = !0, console.error(
|
|
121
121
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
|
-
|
|
122
|
+
f
|
|
123
123
|
));
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
get:
|
|
125
|
+
p.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
126
|
+
get: p,
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
@@ -133,15 +133,15 @@ function Ie() {
|
|
|
133
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
134
|
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
var
|
|
136
|
+
function u(o, f, p, w, M, B) {
|
|
137
|
+
var y = p.ref;
|
|
138
138
|
return o = {
|
|
139
139
|
$$typeof: A,
|
|
140
140
|
type: o,
|
|
141
|
-
key:
|
|
142
|
-
props:
|
|
143
|
-
_owner:
|
|
144
|
-
}, (
|
|
141
|
+
key: f,
|
|
142
|
+
props: p,
|
|
143
|
+
_owner: w
|
|
144
|
+
}, (y !== void 0 ? y : null) !== null ? Object.defineProperty(o, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
146
|
get: l
|
|
147
147
|
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
@@ -166,100 +166,100 @@ function Ie() {
|
|
|
166
166
|
value: B
|
|
167
167
|
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
for (
|
|
175
|
-
|
|
176
|
-
Object.freeze && Object.freeze(
|
|
169
|
+
function m(o, f, p, w, M, B) {
|
|
170
|
+
var y = f.children;
|
|
171
|
+
if (y !== void 0)
|
|
172
|
+
if (w)
|
|
173
|
+
if (je(y)) {
|
|
174
|
+
for (w = 0; w < y.length; w++)
|
|
175
|
+
h(y[w]);
|
|
176
|
+
Object.freeze && Object.freeze(y);
|
|
177
177
|
} else
|
|
178
178
|
console.error(
|
|
179
179
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
180
|
);
|
|
181
|
-
else
|
|
182
|
-
if (ee.call(
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
return
|
|
181
|
+
else h(y);
|
|
182
|
+
if (ee.call(f, "key")) {
|
|
183
|
+
y = e(o);
|
|
184
|
+
var _ = Object.keys(f).filter(function(Oe) {
|
|
185
|
+
return Oe !== "key";
|
|
186
186
|
});
|
|
187
|
-
|
|
187
|
+
w = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", ae[y + w] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
189
|
let props = %s;
|
|
190
190
|
<%s {...props} />
|
|
191
191
|
React keys must be passed directly to JSX without using spread:
|
|
192
192
|
let props = %s;
|
|
193
193
|
<%s key={someKey} {...props} />`,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
), ae[
|
|
194
|
+
w,
|
|
195
|
+
y,
|
|
196
|
+
_,
|
|
197
|
+
y
|
|
198
|
+
), ae[y + w] = !0);
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
for (var J in
|
|
203
|
-
J !== "key" && (
|
|
204
|
-
} else
|
|
205
|
-
return
|
|
206
|
-
|
|
200
|
+
if (y = null, p !== void 0 && (r(p), y = "" + p), i(f) && (r(f.key), y = "" + f.key), "key" in f) {
|
|
201
|
+
p = {};
|
|
202
|
+
for (var J in f)
|
|
203
|
+
J !== "key" && (p[J] = f[J]);
|
|
204
|
+
} else p = f;
|
|
205
|
+
return y && c(
|
|
206
|
+
p,
|
|
207
207
|
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
208
|
-
),
|
|
208
|
+
), u(
|
|
209
209
|
o,
|
|
210
|
+
y,
|
|
210
211
|
p,
|
|
211
|
-
|
|
212
|
-
s(),
|
|
212
|
+
a(),
|
|
213
213
|
M,
|
|
214
214
|
B
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
217
|
+
function h(o) {
|
|
218
|
+
x(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === k && (o._payload.status === "fulfilled" ? x(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function x(o) {
|
|
221
221
|
return typeof o == "object" && o !== null && o.$$typeof === A;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var S = Ae, A = /* @__PURE__ */ Symbol.for("react.transitional.element"), G = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), $ = /* @__PURE__ */ Symbol.for("react.strict_mode"), L = /* @__PURE__ */ Symbol.for("react.profiler"), N = /* @__PURE__ */ Symbol.for("react.consumer"), z = /* @__PURE__ */ Symbol.for("react.context"), b = /* @__PURE__ */ Symbol.for("react.forward_ref"), g = /* @__PURE__ */ Symbol.for("react.suspense"), P = /* @__PURE__ */ Symbol.for("react.suspense_list"), F = /* @__PURE__ */ Symbol.for("react.memo"), k = /* @__PURE__ */ Symbol.for("react.lazy"), ke = /* @__PURE__ */ Symbol.for("react.activity"), _e = /* @__PURE__ */ Symbol.for("react.client.reference"), Y = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, je = Array.isArray, q = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
|
-
|
|
226
|
+
S = {
|
|
227
227
|
react_stack_bottom_frame: function(o) {
|
|
228
228
|
return o();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
var te, re = {}, ne =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
)(), se = q(n(
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
return
|
|
231
|
+
var te, re = {}, ne = S.react_stack_bottom_frame.bind(
|
|
232
|
+
S,
|
|
233
|
+
s
|
|
234
|
+
)(), se = q(n(s)), ae = {};
|
|
235
|
+
I.Fragment = T, I.jsx = function(o, f, p) {
|
|
236
|
+
var w = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
237
|
+
return m(
|
|
238
238
|
o,
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
f,
|
|
240
|
+
p,
|
|
241
241
|
!1,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
w ? Error("react-stack-top-frame") : ne,
|
|
243
|
+
w ? q(n(o)) : se
|
|
244
244
|
);
|
|
245
|
-
},
|
|
246
|
-
var
|
|
247
|
-
return
|
|
245
|
+
}, I.jsxs = function(o, f, p) {
|
|
246
|
+
var w = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return m(
|
|
248
248
|
o,
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
f,
|
|
250
|
+
p,
|
|
251
251
|
!0,
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
w ? Error("react-stack-top-frame") : ne,
|
|
253
|
+
w ? q(n(o)) : se
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
|
-
})()),
|
|
256
|
+
})()), I;
|
|
257
257
|
}
|
|
258
258
|
var le;
|
|
259
|
-
function
|
|
260
|
-
return le || (le = 1, process.env.NODE_ENV === "production" ?
|
|
259
|
+
function Ge() {
|
|
260
|
+
return le || (le = 1, process.env.NODE_ENV === "production" ? D.exports = Ve() : D.exports = Ie()), D.exports;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
262
|
+
var d = Ge();
|
|
263
263
|
const Me = {
|
|
264
264
|
en: {
|
|
265
265
|
enterMode: "🚀 Enter Feedback Mode",
|
|
@@ -293,19 +293,28 @@ const Me = {
|
|
|
293
293
|
errorHeader: "Error",
|
|
294
294
|
preview: "Vista previa"
|
|
295
295
|
}
|
|
296
|
-
},
|
|
297
|
-
const e =
|
|
298
|
-
if (!e)
|
|
299
|
-
throw new Error("useViewGate must be used within a ViewGateProvider");
|
|
296
|
+
}, we = $e(void 0), De = () => {
|
|
297
|
+
const e = Le(we);
|
|
298
|
+
if (!e) throw new Error("useViewGate must be used within a ViewGateProvider");
|
|
300
299
|
return e;
|
|
301
|
-
},
|
|
302
|
-
const [
|
|
300
|
+
}, Gt = ({ children: e, language: t = "es", apiKey: r, baseUrl: n = "https://view-gate.vercel.app" }) => {
|
|
301
|
+
const [a, s] = C([]), i = (l, u) => {
|
|
303
302
|
const m = Date.now();
|
|
304
|
-
s((
|
|
305
|
-
s((
|
|
303
|
+
s((h) => [...h, { id: m, message: l, type: u }]), setTimeout(() => {
|
|
304
|
+
s((h) => h.filter((x) => x.id !== m));
|
|
306
305
|
}, 4e3);
|
|
307
|
-
},
|
|
308
|
-
return
|
|
306
|
+
}, c = Me[t];
|
|
307
|
+
return /* @__PURE__ */ d.jsxs(we.Provider, { "data-source-path": "/src/components/ViewGateProvider.tsx:99", value: { addToast: i, language: t, t: c, apiKey: r, baseUrl: n }, children: [
|
|
308
|
+
e,
|
|
309
|
+
/* @__PURE__ */ d.jsx(Vt, { "data-source-path": "/src/components/ViewGateProvider.tsx:101" }),
|
|
310
|
+
/* @__PURE__ */ d.jsx("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:102", className: "vg-toasts", children: a.map((l) => /* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:104", className: `vg-toast vg-glassmorphism vg-animate-slide ${l.type}`, children: [
|
|
311
|
+
/* @__PURE__ */ d.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:105", style: { fontSize: "20px" }, children: l.type === "success" ? "✅" : "❌" }),
|
|
312
|
+
/* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:106", children: [
|
|
313
|
+
/* @__PURE__ */ d.jsx("strong", { "data-source-path": "/src/components/ViewGateProvider.tsx:107", style: { display: "block" }, children: l.type === "success" ? c.successHeader : c.errorHeader }),
|
|
314
|
+
/* @__PURE__ */ d.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:108", style: { fontSize: "14px" }, children: l.message })
|
|
315
|
+
] })
|
|
316
|
+
] }, l.id)) })
|
|
317
|
+
] });
|
|
309
318
|
};
|
|
310
319
|
function He(e, t) {
|
|
311
320
|
if (e.match(/^[a-z]+:\/\//i))
|
|
@@ -314,10 +323,10 @@ function He(e, t) {
|
|
|
314
323
|
return window.location.protocol + e;
|
|
315
324
|
if (e.match(/^[a-z]+:/i))
|
|
316
325
|
return e;
|
|
317
|
-
const r = document.implementation.createHTMLDocument(), n = r.createElement("base"),
|
|
318
|
-
return r.head.appendChild(n), r.body.appendChild(
|
|
326
|
+
const r = document.implementation.createHTMLDocument(), n = r.createElement("base"), a = r.createElement("a");
|
|
327
|
+
return r.head.appendChild(n), r.body.appendChild(a), t && (n.href = t), a.href = e, a.href;
|
|
319
328
|
}
|
|
320
|
-
const
|
|
329
|
+
const We = /* @__PURE__ */ (() => {
|
|
321
330
|
let e = 0;
|
|
322
331
|
const t = () => (
|
|
323
332
|
// eslint-disable-next-line no-bitwise
|
|
@@ -331,27 +340,27 @@ function R(e) {
|
|
|
331
340
|
t.push(e[r]);
|
|
332
341
|
return t;
|
|
333
342
|
}
|
|
334
|
-
let
|
|
335
|
-
function
|
|
336
|
-
return
|
|
343
|
+
let j = null;
|
|
344
|
+
function ye(e = {}) {
|
|
345
|
+
return j || (e.includeStyleProperties ? (j = e.includeStyleProperties, j) : (j = R(window.getComputedStyle(document.documentElement)), j));
|
|
337
346
|
}
|
|
338
347
|
function H(e, t) {
|
|
339
348
|
const n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
|
|
340
349
|
return n ? parseFloat(n.replace("px", "")) : 0;
|
|
341
350
|
}
|
|
342
|
-
function
|
|
351
|
+
function Ue(e) {
|
|
343
352
|
const t = H(e, "border-left-width"), r = H(e, "border-right-width");
|
|
344
353
|
return e.clientWidth + t + r;
|
|
345
354
|
}
|
|
346
|
-
function
|
|
355
|
+
function Ne(e) {
|
|
347
356
|
const t = H(e, "border-top-width"), r = H(e, "border-bottom-width");
|
|
348
357
|
return e.clientHeight + t + r;
|
|
349
358
|
}
|
|
350
359
|
function xe(e, t = {}) {
|
|
351
|
-
const r = t.width ||
|
|
360
|
+
const r = t.width || Ue(e), n = t.height || Ne(e);
|
|
352
361
|
return { width: r, height: n };
|
|
353
362
|
}
|
|
354
|
-
function
|
|
363
|
+
function ze() {
|
|
355
364
|
let e, t;
|
|
356
365
|
try {
|
|
357
366
|
t = process;
|
|
@@ -364,7 +373,7 @@ const E = 16384;
|
|
|
364
373
|
function Ye(e) {
|
|
365
374
|
(e.width > E || e.height > E) && (e.width > E && e.height > E ? e.width > e.height ? (e.height *= E / e.width, e.width = E) : (e.width *= E / e.height, e.height = E) : e.width > E ? (e.height *= E / e.width, e.width = E) : (e.width *= E / e.height, e.height = E));
|
|
366
375
|
}
|
|
367
|
-
function
|
|
376
|
+
function W(e) {
|
|
368
377
|
return new Promise((t, r) => {
|
|
369
378
|
const n = new Image();
|
|
370
379
|
n.onload = () => {
|
|
@@ -374,47 +383,47 @@ function z(e) {
|
|
|
374
383
|
}, n.onerror = r, n.crossOrigin = "anonymous", n.decoding = "async", n.src = e;
|
|
375
384
|
});
|
|
376
385
|
}
|
|
377
|
-
async function
|
|
386
|
+
async function qe(e) {
|
|
378
387
|
return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
|
|
379
388
|
}
|
|
380
|
-
async function
|
|
381
|
-
const n = "http://www.w3.org/2000/svg",
|
|
382
|
-
return
|
|
389
|
+
async function Be(e, t, r) {
|
|
390
|
+
const n = "http://www.w3.org/2000/svg", a = document.createElementNS(n, "svg"), s = document.createElementNS(n, "foreignObject");
|
|
391
|
+
return a.setAttribute("width", `${t}`), a.setAttribute("height", `${r}`), a.setAttribute("viewBox", `0 0 ${t} ${r}`), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("x", "0"), s.setAttribute("y", "0"), s.setAttribute("externalResourcesRequired", "true"), a.appendChild(s), s.appendChild(e), qe(a);
|
|
383
392
|
}
|
|
384
|
-
const
|
|
393
|
+
const v = (e, t) => {
|
|
385
394
|
if (e instanceof t)
|
|
386
395
|
return !0;
|
|
387
396
|
const r = Object.getPrototypeOf(e);
|
|
388
|
-
return r === null ? !1 : r.constructor.name === t.name ||
|
|
397
|
+
return r === null ? !1 : r.constructor.name === t.name || v(r, t);
|
|
389
398
|
};
|
|
390
|
-
function
|
|
399
|
+
function Je(e) {
|
|
391
400
|
const t = e.getPropertyValue("content");
|
|
392
401
|
return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
|
|
393
402
|
}
|
|
394
|
-
function
|
|
395
|
-
return
|
|
396
|
-
const n = e.getPropertyValue(r),
|
|
397
|
-
return `${r}: ${n}${
|
|
403
|
+
function Xe(e, t) {
|
|
404
|
+
return ye(t).map((r) => {
|
|
405
|
+
const n = e.getPropertyValue(r), a = e.getPropertyPriority(r);
|
|
406
|
+
return `${r}: ${n}${a ? " !important" : ""};`;
|
|
398
407
|
}).join(" ");
|
|
399
408
|
}
|
|
400
|
-
function
|
|
401
|
-
const
|
|
402
|
-
return document.createTextNode(`${
|
|
409
|
+
function Ze(e, t, r, n) {
|
|
410
|
+
const a = `.${e}:${t}`, s = r.cssText ? Je(r) : Xe(r, n);
|
|
411
|
+
return document.createTextNode(`${a}{${s}}`);
|
|
403
412
|
}
|
|
404
413
|
function ue(e, t, r, n) {
|
|
405
|
-
const
|
|
406
|
-
if (
|
|
414
|
+
const a = window.getComputedStyle(e, r), s = a.getPropertyValue("content");
|
|
415
|
+
if (s === "" || s === "none")
|
|
407
416
|
return;
|
|
408
|
-
const i =
|
|
417
|
+
const i = We();
|
|
409
418
|
try {
|
|
410
419
|
t.className = `${t.className} ${i}`;
|
|
411
420
|
} catch {
|
|
412
421
|
return;
|
|
413
422
|
}
|
|
414
423
|
const c = document.createElement("style");
|
|
415
|
-
c.appendChild(
|
|
424
|
+
c.appendChild(Ze(i, r, a, n)), t.appendChild(c);
|
|
416
425
|
}
|
|
417
|
-
function
|
|
426
|
+
function Ke(e, t, r) {
|
|
418
427
|
ue(e, t, ":before", r), ue(e, t, ":after", r);
|
|
419
428
|
}
|
|
420
429
|
const fe = "application/font-woff", de = "image/jpeg", Qe = {
|
|
@@ -430,170 +439,170 @@ const fe = "application/font-woff", de = "image/jpeg", Qe = {
|
|
|
430
439
|
svg: "image/svg+xml",
|
|
431
440
|
webp: "image/webp"
|
|
432
441
|
};
|
|
433
|
-
function
|
|
442
|
+
function et(e) {
|
|
434
443
|
const t = /\.([^./]*?)$/g.exec(e);
|
|
435
444
|
return t ? t[1] : "";
|
|
436
445
|
}
|
|
437
|
-
function
|
|
438
|
-
const t =
|
|
446
|
+
function K(e) {
|
|
447
|
+
const t = et(e).toLowerCase();
|
|
439
448
|
return Qe[t] || "";
|
|
440
449
|
}
|
|
441
|
-
function
|
|
450
|
+
function tt(e) {
|
|
442
451
|
return e.split(/,/)[1];
|
|
443
452
|
}
|
|
444
453
|
function Z(e) {
|
|
445
454
|
return e.search(/^(data:)/) !== -1;
|
|
446
455
|
}
|
|
447
|
-
function
|
|
456
|
+
function rt(e, t) {
|
|
448
457
|
return `data:${t};base64,${e}`;
|
|
449
458
|
}
|
|
450
459
|
async function be(e, t, r) {
|
|
451
460
|
const n = await fetch(e, t);
|
|
452
461
|
if (n.status === 404)
|
|
453
462
|
throw new Error(`Resource "${n.url}" not found`);
|
|
454
|
-
const
|
|
455
|
-
return new Promise((
|
|
463
|
+
const a = await n.blob();
|
|
464
|
+
return new Promise((s, i) => {
|
|
456
465
|
const c = new FileReader();
|
|
457
466
|
c.onerror = i, c.onloadend = () => {
|
|
458
467
|
try {
|
|
459
|
-
|
|
468
|
+
s(r({ res: n, result: c.result }));
|
|
460
469
|
} catch (l) {
|
|
461
470
|
i(l);
|
|
462
471
|
}
|
|
463
|
-
}, c.readAsDataURL(
|
|
472
|
+
}, c.readAsDataURL(a);
|
|
464
473
|
});
|
|
465
474
|
}
|
|
466
475
|
const X = {};
|
|
467
|
-
function
|
|
476
|
+
function nt(e, t, r) {
|
|
468
477
|
let n = e.replace(/\?.*/, "");
|
|
469
478
|
return r && (n = e), /ttf|otf|eot|woff2?/i.test(n) && (n = n.replace(/.*\//, "")), t ? `[${t}]${n}` : n;
|
|
470
479
|
}
|
|
471
|
-
async function
|
|
472
|
-
const n =
|
|
480
|
+
async function Q(e, t, r) {
|
|
481
|
+
const n = nt(e, t, r.includeQueryParams);
|
|
473
482
|
if (X[n] != null)
|
|
474
483
|
return X[n];
|
|
475
484
|
r.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
476
|
-
let
|
|
485
|
+
let a;
|
|
477
486
|
try {
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
} catch (
|
|
481
|
-
|
|
487
|
+
const s = await be(e, r.fetchRequestInit, ({ res: i, result: c }) => (t || (t = i.headers.get("Content-Type") || ""), tt(c)));
|
|
488
|
+
a = rt(s, t);
|
|
489
|
+
} catch (s) {
|
|
490
|
+
a = r.imagePlaceholder || "";
|
|
482
491
|
let i = `Failed to fetch resource: ${e}`;
|
|
483
|
-
|
|
492
|
+
s && (i = typeof s == "string" ? s : s.message), i && console.warn(i);
|
|
484
493
|
}
|
|
485
|
-
return X[n] =
|
|
494
|
+
return X[n] = a, a;
|
|
486
495
|
}
|
|
487
|
-
async function
|
|
496
|
+
async function st(e) {
|
|
488
497
|
const t = e.toDataURL();
|
|
489
|
-
return t === "data:," ? e.cloneNode(!1) :
|
|
498
|
+
return t === "data:," ? e.cloneNode(!1) : W(t);
|
|
490
499
|
}
|
|
491
|
-
async function
|
|
500
|
+
async function at(e, t) {
|
|
492
501
|
if (e.currentSrc) {
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
const c =
|
|
496
|
-
return
|
|
502
|
+
const s = document.createElement("canvas"), i = s.getContext("2d");
|
|
503
|
+
s.width = e.clientWidth, s.height = e.clientHeight, i?.drawImage(e, 0, 0, s.width, s.height);
|
|
504
|
+
const c = s.toDataURL();
|
|
505
|
+
return W(c);
|
|
497
506
|
}
|
|
498
|
-
const r = e.poster, n =
|
|
499
|
-
return
|
|
507
|
+
const r = e.poster, n = K(r), a = await Q(r, n, t);
|
|
508
|
+
return W(a);
|
|
500
509
|
}
|
|
501
|
-
async function
|
|
510
|
+
async function ot(e, t) {
|
|
502
511
|
var r;
|
|
503
512
|
try {
|
|
504
513
|
if (!((r = e?.contentDocument) === null || r === void 0) && r.body)
|
|
505
|
-
return await
|
|
514
|
+
return await U(e.contentDocument.body, t, !0);
|
|
506
515
|
} catch {
|
|
507
516
|
}
|
|
508
517
|
return e.cloneNode(!1);
|
|
509
518
|
}
|
|
510
|
-
async function
|
|
511
|
-
return
|
|
519
|
+
async function it(e, t) {
|
|
520
|
+
return v(e, HTMLCanvasElement) ? st(e) : v(e, HTMLVideoElement) ? at(e, t) : v(e, HTMLIFrameElement) ? ot(e, t) : e.cloneNode(ve(e));
|
|
512
521
|
}
|
|
513
|
-
const
|
|
514
|
-
async function
|
|
515
|
-
var n,
|
|
522
|
+
const ct = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", ve = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
523
|
+
async function lt(e, t, r) {
|
|
524
|
+
var n, a;
|
|
516
525
|
if (ve(t))
|
|
517
526
|
return t;
|
|
518
|
-
let
|
|
519
|
-
return
|
|
527
|
+
let s = [];
|
|
528
|
+
return ct(e) && e.assignedNodes ? s = R(e.assignedNodes()) : v(e, HTMLIFrameElement) && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? s = R(e.contentDocument.body.childNodes) : s = R(((a = e.shadowRoot) !== null && a !== void 0 ? a : e).childNodes), s.length === 0 || v(e, HTMLVideoElement) || await s.reduce((i, c) => i.then(() => U(c, r)).then((l) => {
|
|
520
529
|
l && t.appendChild(l);
|
|
521
530
|
}), Promise.resolve()), t;
|
|
522
531
|
}
|
|
523
|
-
function
|
|
532
|
+
function ut(e, t, r) {
|
|
524
533
|
const n = t.style;
|
|
525
534
|
if (!n)
|
|
526
535
|
return;
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
let i =
|
|
530
|
-
|
|
536
|
+
const a = window.getComputedStyle(e);
|
|
537
|
+
a.cssText ? (n.cssText = a.cssText, n.transformOrigin = a.transformOrigin) : ye(r).forEach((s) => {
|
|
538
|
+
let i = a.getPropertyValue(s);
|
|
539
|
+
s === "font-size" && i.endsWith("px") && (i = `${Math.floor(parseFloat(i.substring(0, i.length - 2))) - 0.1}px`), v(e, HTMLIFrameElement) && s === "display" && i === "inline" && (i = "block"), s === "d" && t.getAttribute("d") && (i = `path(${t.getAttribute("d")})`), n.setProperty(s, i, a.getPropertyPriority(s));
|
|
531
540
|
});
|
|
532
541
|
}
|
|
533
|
-
function ut(e, t) {
|
|
534
|
-
b(e, HTMLTextAreaElement) && (t.innerHTML = e.value), b(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
535
|
-
}
|
|
536
542
|
function ft(e, t) {
|
|
537
|
-
|
|
538
|
-
|
|
543
|
+
v(e, HTMLTextAreaElement) && (t.innerHTML = e.value), v(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
544
|
+
}
|
|
545
|
+
function dt(e, t) {
|
|
546
|
+
if (v(e, HTMLSelectElement)) {
|
|
547
|
+
const n = Array.from(t.children).find((a) => e.value === a.getAttribute("value"));
|
|
539
548
|
n && n.setAttribute("selected", "");
|
|
540
549
|
}
|
|
541
550
|
}
|
|
542
|
-
function
|
|
543
|
-
return
|
|
551
|
+
function mt(e, t, r) {
|
|
552
|
+
return v(t, Element) && (ut(e, t, r), Ke(e, t, r), ft(e, t), dt(e, t)), t;
|
|
544
553
|
}
|
|
545
|
-
async function
|
|
554
|
+
async function ht(e, t) {
|
|
546
555
|
const r = e.querySelectorAll ? e.querySelectorAll("use") : [];
|
|
547
556
|
if (r.length === 0)
|
|
548
557
|
return e;
|
|
549
558
|
const n = {};
|
|
550
|
-
for (let
|
|
551
|
-
const c = r[
|
|
559
|
+
for (let s = 0; s < r.length; s++) {
|
|
560
|
+
const c = r[s].getAttribute("xlink:href");
|
|
552
561
|
if (c) {
|
|
553
|
-
const l = e.querySelector(c),
|
|
554
|
-
!l &&
|
|
562
|
+
const l = e.querySelector(c), u = document.querySelector(c);
|
|
563
|
+
!l && u && !n[c] && (n[c] = await U(u, t, !0));
|
|
555
564
|
}
|
|
556
565
|
}
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
i.setAttribute("xmlns",
|
|
561
|
-
const c = document.createElementNS(
|
|
566
|
+
const a = Object.values(n);
|
|
567
|
+
if (a.length) {
|
|
568
|
+
const s = "http://www.w3.org/1999/xhtml", i = document.createElementNS(s, "svg");
|
|
569
|
+
i.setAttribute("xmlns", s), i.style.position = "absolute", i.style.width = "0", i.style.height = "0", i.style.overflow = "hidden", i.style.display = "none";
|
|
570
|
+
const c = document.createElementNS(s, "defs");
|
|
562
571
|
i.appendChild(c);
|
|
563
|
-
for (let l = 0; l <
|
|
564
|
-
c.appendChild(
|
|
572
|
+
for (let l = 0; l < a.length; l++)
|
|
573
|
+
c.appendChild(a[l]);
|
|
565
574
|
e.appendChild(i);
|
|
566
575
|
}
|
|
567
576
|
return e;
|
|
568
577
|
}
|
|
569
|
-
async function
|
|
570
|
-
return !r && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((n) =>
|
|
578
|
+
async function U(e, t, r) {
|
|
579
|
+
return !r && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((n) => it(n, t)).then((n) => lt(e, n, t)).then((n) => mt(e, n, t)).then((n) => ht(n, t));
|
|
571
580
|
}
|
|
572
|
-
const Ee = /url\((['"]?)([^'"]+?)\1\)/g,
|
|
573
|
-
function
|
|
581
|
+
const Ee = /url\((['"]?)([^'"]+?)\1\)/g, pt = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, gt = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
582
|
+
function wt(e) {
|
|
574
583
|
const t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
575
584
|
return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
|
|
576
585
|
}
|
|
577
586
|
function yt(e) {
|
|
578
587
|
const t = [];
|
|
579
|
-
return e.replace(Ee, (r, n,
|
|
588
|
+
return e.replace(Ee, (r, n, a) => (t.push(a), r)), t.filter((r) => !Z(r));
|
|
580
589
|
}
|
|
581
|
-
async function
|
|
590
|
+
async function xt(e, t, r, n, a) {
|
|
582
591
|
try {
|
|
583
|
-
const
|
|
592
|
+
const s = r ? He(t, r) : t, i = K(t);
|
|
584
593
|
let c;
|
|
585
|
-
return
|
|
594
|
+
return a || (c = await Q(s, i, n)), e.replace(wt(t), `$1${c}$3`);
|
|
586
595
|
} catch {
|
|
587
596
|
}
|
|
588
597
|
return e;
|
|
589
598
|
}
|
|
590
|
-
function
|
|
599
|
+
function bt(e, { preferredFontFormat: t }) {
|
|
591
600
|
return t ? e.replace(gt, (r) => {
|
|
592
601
|
for (; ; ) {
|
|
593
|
-
const [n, ,
|
|
594
|
-
if (!
|
|
602
|
+
const [n, , a] = pt.exec(r) || [];
|
|
603
|
+
if (!a)
|
|
595
604
|
return "";
|
|
596
|
-
if (
|
|
605
|
+
if (a === t)
|
|
597
606
|
return `src: ${n};`;
|
|
598
607
|
}
|
|
599
608
|
}) : e;
|
|
@@ -604,51 +613,51 @@ function Se(e) {
|
|
|
604
613
|
async function Re(e, t, r) {
|
|
605
614
|
if (!Se(e))
|
|
606
615
|
return e;
|
|
607
|
-
const n =
|
|
608
|
-
return yt(n).reduce((
|
|
616
|
+
const n = bt(e, r);
|
|
617
|
+
return yt(n).reduce((s, i) => s.then((c) => xt(c, i, t, r)), Promise.resolve(n));
|
|
609
618
|
}
|
|
610
|
-
async function
|
|
619
|
+
async function O(e, t, r) {
|
|
611
620
|
var n;
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
614
|
-
const
|
|
615
|
-
return t.style.setProperty(e,
|
|
621
|
+
const a = (n = t.style) === null || n === void 0 ? void 0 : n.getPropertyValue(e);
|
|
622
|
+
if (a) {
|
|
623
|
+
const s = await Re(a, null, r);
|
|
624
|
+
return t.style.setProperty(e, s, t.style.getPropertyPriority(e)), !0;
|
|
616
625
|
}
|
|
617
626
|
return !1;
|
|
618
627
|
}
|
|
619
|
-
async function bt(e, t) {
|
|
620
|
-
await j("background", e, t) || await j("background-image", e, t), await j("mask", e, t) || await j("-webkit-mask", e, t) || await j("mask-image", e, t) || await j("-webkit-mask-image", e, t);
|
|
621
|
-
}
|
|
622
628
|
async function vt(e, t) {
|
|
623
|
-
|
|
624
|
-
|
|
629
|
+
await O("background", e, t) || await O("background-image", e, t), await O("mask", e, t) || await O("-webkit-mask", e, t) || await O("mask-image", e, t) || await O("-webkit-mask-image", e, t);
|
|
630
|
+
}
|
|
631
|
+
async function Et(e, t) {
|
|
632
|
+
const r = v(e, HTMLImageElement);
|
|
633
|
+
if (!(r && !Z(e.src)) && !(v(e, SVGImageElement) && !Z(e.href.baseVal)))
|
|
625
634
|
return;
|
|
626
|
-
const n = r ? e.src : e.href.baseVal,
|
|
627
|
-
await new Promise((
|
|
628
|
-
e.onload =
|
|
635
|
+
const n = r ? e.src : e.href.baseVal, a = await Q(n, K(n), t);
|
|
636
|
+
await new Promise((s, i) => {
|
|
637
|
+
e.onload = s, e.onerror = t.onImageErrorHandler ? (...l) => {
|
|
629
638
|
try {
|
|
630
|
-
|
|
631
|
-
} catch (
|
|
632
|
-
i(
|
|
639
|
+
s(t.onImageErrorHandler(...l));
|
|
640
|
+
} catch (u) {
|
|
641
|
+
i(u);
|
|
633
642
|
}
|
|
634
643
|
} : i;
|
|
635
644
|
const c = e;
|
|
636
|
-
c.decode && (c.decode =
|
|
645
|
+
c.decode && (c.decode = s), c.loading === "lazy" && (c.loading = "eager"), r ? (e.srcset = "", e.src = a) : e.href.baseVal = a;
|
|
637
646
|
});
|
|
638
647
|
}
|
|
639
|
-
async function
|
|
640
|
-
const n = R(e.childNodes).map((
|
|
648
|
+
async function St(e, t) {
|
|
649
|
+
const n = R(e.childNodes).map((a) => Ce(a, t));
|
|
641
650
|
await Promise.all(n).then(() => e);
|
|
642
651
|
}
|
|
643
652
|
async function Ce(e, t) {
|
|
644
|
-
|
|
653
|
+
v(e, Element) && (await vt(e, t), await Et(e, t), await St(e, t));
|
|
645
654
|
}
|
|
646
|
-
function
|
|
655
|
+
function Rt(e, t) {
|
|
647
656
|
const { style: r } = e;
|
|
648
657
|
t.backgroundColor && (r.backgroundColor = t.backgroundColor), t.width && (r.width = `${t.width}px`), t.height && (r.height = `${t.height}px`);
|
|
649
658
|
const n = t.style;
|
|
650
|
-
return n != null && Object.keys(n).forEach((
|
|
651
|
-
r[
|
|
659
|
+
return n != null && Object.keys(n).forEach((a) => {
|
|
660
|
+
r[a] = n[a];
|
|
652
661
|
}), e;
|
|
653
662
|
}
|
|
654
663
|
const me = {};
|
|
@@ -659,90 +668,90 @@ async function he(e) {
|
|
|
659
668
|
const n = await (await fetch(e)).text();
|
|
660
669
|
return t = { url: e, cssText: n }, me[e] = t, t;
|
|
661
670
|
}
|
|
662
|
-
async function
|
|
671
|
+
async function pe(e, t) {
|
|
663
672
|
let r = e.cssText;
|
|
664
|
-
const n = /url\(["']?([^"')]+)["']?\)/g,
|
|
673
|
+
const n = /url\(["']?([^"')]+)["']?\)/g, s = (r.match(/url\([^)]+\)/g) || []).map(async (i) => {
|
|
665
674
|
let c = i.replace(n, "$1");
|
|
666
675
|
return c.startsWith("https://") || (c = new URL(c, e.url).href), be(c, t.fetchRequestInit, ({ result: l }) => (r = r.replace(i, `url(${l})`), [i, l]));
|
|
667
676
|
});
|
|
668
|
-
return Promise.all(
|
|
677
|
+
return Promise.all(s).then(() => r);
|
|
669
678
|
}
|
|
670
|
-
function
|
|
679
|
+
function ge(e) {
|
|
671
680
|
if (e == null)
|
|
672
681
|
return [];
|
|
673
682
|
const t = [], r = /(\/\*[\s\S]*?\*\/)/gi;
|
|
674
683
|
let n = e.replace(r, "");
|
|
675
|
-
const
|
|
684
|
+
const a = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
|
|
676
685
|
for (; ; ) {
|
|
677
|
-
const l =
|
|
686
|
+
const l = a.exec(n);
|
|
678
687
|
if (l === null)
|
|
679
688
|
break;
|
|
680
689
|
t.push(l[0]);
|
|
681
690
|
}
|
|
682
|
-
n = n.replace(
|
|
683
|
-
const
|
|
691
|
+
n = n.replace(a, "");
|
|
692
|
+
const s = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, i = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", c = new RegExp(i, "gi");
|
|
684
693
|
for (; ; ) {
|
|
685
|
-
let l =
|
|
694
|
+
let l = s.exec(n);
|
|
686
695
|
if (l === null) {
|
|
687
696
|
if (l = c.exec(n), l === null)
|
|
688
697
|
break;
|
|
689
|
-
|
|
698
|
+
s.lastIndex = c.lastIndex;
|
|
690
699
|
} else
|
|
691
|
-
c.lastIndex =
|
|
700
|
+
c.lastIndex = s.lastIndex;
|
|
692
701
|
t.push(l[0]);
|
|
693
702
|
}
|
|
694
703
|
return t;
|
|
695
704
|
}
|
|
696
|
-
async function
|
|
705
|
+
async function Ct(e, t) {
|
|
697
706
|
const r = [], n = [];
|
|
698
|
-
return e.forEach((
|
|
699
|
-
if ("cssRules" in
|
|
707
|
+
return e.forEach((a) => {
|
|
708
|
+
if ("cssRules" in a)
|
|
700
709
|
try {
|
|
701
|
-
R(
|
|
702
|
-
if (
|
|
710
|
+
R(a.cssRules || []).forEach((s, i) => {
|
|
711
|
+
if (s.type === CSSRule.IMPORT_RULE) {
|
|
703
712
|
let c = i + 1;
|
|
704
|
-
const l =
|
|
713
|
+
const l = s.href, u = he(l).then((m) => pe(m, t)).then((m) => ge(m).forEach((h) => {
|
|
705
714
|
try {
|
|
706
|
-
|
|
707
|
-
} catch (
|
|
715
|
+
a.insertRule(h, h.startsWith("@import") ? c += 1 : a.cssRules.length);
|
|
716
|
+
} catch (x) {
|
|
708
717
|
console.error("Error inserting rule from remote css", {
|
|
709
|
-
rule:
|
|
710
|
-
error:
|
|
718
|
+
rule: h,
|
|
719
|
+
error: x
|
|
711
720
|
});
|
|
712
721
|
}
|
|
713
|
-
})).catch((
|
|
714
|
-
console.error("Error loading remote css",
|
|
722
|
+
})).catch((m) => {
|
|
723
|
+
console.error("Error loading remote css", m.toString());
|
|
715
724
|
});
|
|
716
|
-
n.push(
|
|
725
|
+
n.push(u);
|
|
717
726
|
}
|
|
718
727
|
});
|
|
719
|
-
} catch (
|
|
728
|
+
} catch (s) {
|
|
720
729
|
const i = e.find((c) => c.href == null) || document.styleSheets[0];
|
|
721
|
-
|
|
730
|
+
a.href != null && n.push(he(a.href).then((c) => pe(c, t)).then((c) => ge(c).forEach((l) => {
|
|
722
731
|
i.insertRule(l, i.cssRules.length);
|
|
723
732
|
})).catch((c) => {
|
|
724
733
|
console.error("Error loading remote stylesheet", c);
|
|
725
|
-
})), console.error("Error inlining remote css file",
|
|
734
|
+
})), console.error("Error inlining remote css file", s);
|
|
726
735
|
}
|
|
727
|
-
}), Promise.all(n).then(() => (e.forEach((
|
|
728
|
-
if ("cssRules" in
|
|
736
|
+
}), Promise.all(n).then(() => (e.forEach((a) => {
|
|
737
|
+
if ("cssRules" in a)
|
|
729
738
|
try {
|
|
730
|
-
R(
|
|
731
|
-
r.push(
|
|
739
|
+
R(a.cssRules || []).forEach((s) => {
|
|
740
|
+
r.push(s);
|
|
732
741
|
});
|
|
733
|
-
} catch (
|
|
734
|
-
console.error(`Error while reading CSS rules from ${
|
|
742
|
+
} catch (s) {
|
|
743
|
+
console.error(`Error while reading CSS rules from ${a.href}`, s);
|
|
735
744
|
}
|
|
736
745
|
}), r));
|
|
737
746
|
}
|
|
738
|
-
function
|
|
747
|
+
function Tt(e) {
|
|
739
748
|
return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Se(t.style.getPropertyValue("src")));
|
|
740
749
|
}
|
|
741
|
-
async function
|
|
750
|
+
async function Pt(e, t) {
|
|
742
751
|
if (e.ownerDocument == null)
|
|
743
752
|
throw new Error("Provided element is not within a Document");
|
|
744
|
-
const r = R(e.ownerDocument.styleSheets), n = await
|
|
745
|
-
return
|
|
753
|
+
const r = R(e.ownerDocument.styleSheets), n = await Ct(r, t);
|
|
754
|
+
return Tt(n);
|
|
746
755
|
}
|
|
747
756
|
function Te(e) {
|
|
748
757
|
return e.trim().replace(/["']/g, "");
|
|
@@ -750,64 +759,108 @@ function Te(e) {
|
|
|
750
759
|
function kt(e) {
|
|
751
760
|
const t = /* @__PURE__ */ new Set();
|
|
752
761
|
function r(n) {
|
|
753
|
-
(n.style.fontFamily || getComputedStyle(n).fontFamily).split(",").forEach((
|
|
754
|
-
t.add(Te(
|
|
755
|
-
}), Array.from(n.children).forEach((
|
|
756
|
-
|
|
762
|
+
(n.style.fontFamily || getComputedStyle(n).fontFamily).split(",").forEach((s) => {
|
|
763
|
+
t.add(Te(s));
|
|
764
|
+
}), Array.from(n.children).forEach((s) => {
|
|
765
|
+
s instanceof HTMLElement && r(s);
|
|
757
766
|
});
|
|
758
767
|
}
|
|
759
768
|
return r(e), t;
|
|
760
769
|
}
|
|
761
|
-
async function
|
|
762
|
-
const r = await
|
|
763
|
-
return (await Promise.all(r.filter((
|
|
764
|
-
const i =
|
|
765
|
-
return Re(
|
|
770
|
+
async function _t(e, t) {
|
|
771
|
+
const r = await Pt(e, t), n = kt(e);
|
|
772
|
+
return (await Promise.all(r.filter((s) => n.has(Te(s.style.fontFamily))).map((s) => {
|
|
773
|
+
const i = s.parentStyleSheet ? s.parentStyleSheet.href : null;
|
|
774
|
+
return Re(s.cssText, i, t);
|
|
766
775
|
}))).join(`
|
|
767
776
|
`);
|
|
768
777
|
}
|
|
769
|
-
async function
|
|
770
|
-
const r = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await
|
|
778
|
+
async function jt(e, t) {
|
|
779
|
+
const r = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await _t(e, t);
|
|
771
780
|
if (r) {
|
|
772
|
-
const n = document.createElement("style"),
|
|
773
|
-
n.appendChild(
|
|
781
|
+
const n = document.createElement("style"), a = document.createTextNode(r);
|
|
782
|
+
n.appendChild(a), e.firstChild ? e.insertBefore(n, e.firstChild) : e.appendChild(n);
|
|
774
783
|
}
|
|
775
784
|
}
|
|
776
|
-
async function
|
|
777
|
-
const { width: r, height: n } = xe(e, t),
|
|
778
|
-
return await
|
|
785
|
+
async function Ot(e, t = {}) {
|
|
786
|
+
const { width: r, height: n } = xe(e, t), a = await U(e, t, !0);
|
|
787
|
+
return await jt(a, t), await Ce(a, t), Rt(a, t), await Be(a, r, n);
|
|
779
788
|
}
|
|
780
789
|
async function At(e, t = {}) {
|
|
781
|
-
const { width: r, height: n } = xe(e, t),
|
|
782
|
-
return i.width =
|
|
790
|
+
const { width: r, height: n } = xe(e, t), a = await Ot(e, t), s = await W(a), i = document.createElement("canvas"), c = i.getContext("2d"), l = t.pixelRatio || ze(), u = t.canvasWidth || r, m = t.canvasHeight || n;
|
|
791
|
+
return i.width = u * l, i.height = m * l, t.skipAutoScale || Ye(i), i.style.width = `${u}`, i.style.height = `${m}`, t.backgroundColor && (c.fillStyle = t.backgroundColor, c.fillRect(0, 0, i.width, i.height)), c.drawImage(s, 0, 0, i.width, i.height), i;
|
|
783
792
|
}
|
|
784
793
|
async function $t(e, t = {}) {
|
|
785
794
|
return (await At(e, t)).toDataURL();
|
|
786
795
|
}
|
|
787
|
-
const
|
|
788
|
-
const
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
796
|
+
const Lt = (e) => {
|
|
797
|
+
const r = Object.keys(e).find((s) => s.startsWith("__reactFiber$") || s.startsWith("__reactInternalInstance$"));
|
|
798
|
+
if (!r) return "";
|
|
799
|
+
const n = [];
|
|
800
|
+
let a = e[r];
|
|
801
|
+
for (; a; ) {
|
|
802
|
+
const s = a.type;
|
|
803
|
+
if (typeof s == "function") {
|
|
804
|
+
const i = s.displayName || s.name;
|
|
805
|
+
i && !i.includes("ViewGate") && !n.includes(i) && n.unshift(i);
|
|
806
|
+
}
|
|
807
|
+
a = a.return;
|
|
808
|
+
}
|
|
809
|
+
return n.join(" > ") || "Generic Component";
|
|
810
|
+
}, Ft = (e) => {
|
|
811
|
+
const t = e.getAttribute("data-source-path") || "unknown:0", r = Lt(e), a = ((c) => {
|
|
812
|
+
const l = [];
|
|
813
|
+
let u = c;
|
|
814
|
+
for (; u && u.nodeType === Node.ELEMENT_NODE; ) {
|
|
815
|
+
let m = u.nodeName.toLowerCase();
|
|
816
|
+
if (u.id) {
|
|
817
|
+
m += "#" + u.id, l.unshift(m);
|
|
818
|
+
break;
|
|
819
|
+
} else {
|
|
820
|
+
let h = u, x = 1;
|
|
821
|
+
for (; h.previousElementSibling; )
|
|
822
|
+
h = h.previousElementSibling, h.nodeName.toLowerCase() === m && x++;
|
|
823
|
+
x > 1 && (m += `:nth-of-type(${x})`);
|
|
824
|
+
}
|
|
825
|
+
l.unshift(m), u = u.parentElement;
|
|
826
|
+
}
|
|
827
|
+
return l.join(" > ");
|
|
828
|
+
})(e), s = (e.innerText || "").slice(0, 50).trim(), i = `${e.tagName.toLowerCase()}-${s.replace(/\s+/g, "_")}-${a.split(" > ").slice(-2).join("_")}`;
|
|
829
|
+
return {
|
|
830
|
+
tag: e.tagName.toLowerCase(),
|
|
831
|
+
id: e.id || "",
|
|
832
|
+
classes: e.className || "",
|
|
833
|
+
text: (e.innerText || "").slice(0, 100).trim(),
|
|
834
|
+
selector: a,
|
|
835
|
+
outerHtml: (e.outerHTML || "").slice(0, 500),
|
|
836
|
+
parentContext: (e.parentElement?.innerText || "").slice(0, 100).trim(),
|
|
837
|
+
componentPath: r,
|
|
838
|
+
signature: i,
|
|
839
|
+
source: t
|
|
840
|
+
};
|
|
841
|
+
}, Vt = () => {
|
|
842
|
+
const { addToast: e, language: t, t: r, apiKey: n, baseUrl: a } = De(), [s, i] = C(!1), [c, l] = C(null), [u, m] = C(null), [h, x] = C(""), [S, A] = C(!1), [G, T] = C(!1), $ = oe((b) => {
|
|
843
|
+
if (!s || u) return;
|
|
844
|
+
const g = document.elementFromPoint(b.clientX, b.clientY);
|
|
845
|
+
if (!g || g.id === "viewgate-overlay" || g.closest("#viewgate-ui")) {
|
|
846
|
+
l(null);
|
|
794
847
|
return;
|
|
795
848
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
849
|
+
g.getAttribute("data-source-path"), l({
|
|
850
|
+
tag: g.tagName.toLowerCase(),
|
|
851
|
+
source: g.getAttribute("data-source-path") || "unknown:0",
|
|
852
|
+
rect: g.getBoundingClientRect(),
|
|
853
|
+
element: g,
|
|
854
|
+
previewText: (g.innerText || "").slice(0, 100) || (g.getAttribute("placeholder") || "").slice(0, 100) || g.tagName.toLowerCase(),
|
|
855
|
+
semanticReference: Ft(g)
|
|
803
856
|
});
|
|
804
|
-
}, [s,
|
|
805
|
-
if (!(!s ||
|
|
806
|
-
|
|
857
|
+
}, [s, u]), L = oe(async (b) => {
|
|
858
|
+
if (!(!s || u) && c) {
|
|
859
|
+
b.preventDefault(), b.stopPropagation(), T(!0);
|
|
807
860
|
try {
|
|
808
|
-
const
|
|
809
|
-
|
|
810
|
-
const F = await $t(
|
|
861
|
+
const g = c.element.style.display, P = window.getComputedStyle(c.element).display === "inline";
|
|
862
|
+
P && (c.element.style.display = "inline-block");
|
|
863
|
+
const F = await $t(c.element, {
|
|
811
864
|
backgroundColor: "#ffffff",
|
|
812
865
|
pixelRatio: 2,
|
|
813
866
|
skipFonts: !0,
|
|
@@ -817,147 +870,222 @@ const Ft = () => {
|
|
|
817
870
|
// Extra padding for better look
|
|
818
871
|
}
|
|
819
872
|
});
|
|
820
|
-
|
|
821
|
-
} catch (
|
|
822
|
-
console.error("Failed to capture preview:",
|
|
873
|
+
P && (c.element.style.display = g), m({ ...c, visualPreview: F });
|
|
874
|
+
} catch (g) {
|
|
875
|
+
console.error("Failed to capture preview:", g), m(c);
|
|
823
876
|
} finally {
|
|
824
|
-
|
|
877
|
+
T(!1), l(null);
|
|
825
878
|
}
|
|
826
879
|
}
|
|
827
|
-
}, [s,
|
|
828
|
-
|
|
829
|
-
document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove",
|
|
830
|
-
}), [s,
|
|
831
|
-
const
|
|
832
|
-
if (!
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
const v = l.source || "unknown:0", [y, S] = v.split(":"), F = S || "0";
|
|
880
|
+
}, [s, c, u]);
|
|
881
|
+
Fe(() => (s && !u ? document.body.classList.add("vg-cursor-pointer") : document.body.classList.remove("vg-cursor-pointer"), window.addEventListener("mousemove", $), window.addEventListener("click", L, !0), () => {
|
|
882
|
+
document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove", $), window.removeEventListener("click", L, !0);
|
|
883
|
+
}), [s, u, $, L]);
|
|
884
|
+
const N = async () => {
|
|
885
|
+
if (!u || !h.trim()) return;
|
|
886
|
+
A(!0);
|
|
887
|
+
const { semanticReference: b } = u, [g, P] = b.source.split(":"), F = P || "0";
|
|
836
888
|
try {
|
|
837
|
-
if (!(await fetch(
|
|
889
|
+
if (!(await fetch(`${a}/api/annotations`, {
|
|
838
890
|
method: "POST",
|
|
839
891
|
headers: {
|
|
840
892
|
"Content-Type": "application/json",
|
|
841
893
|
"x-api-key": n
|
|
842
894
|
},
|
|
843
895
|
body: JSON.stringify({
|
|
844
|
-
filePath:
|
|
896
|
+
filePath: g,
|
|
845
897
|
line: parseInt(F),
|
|
846
898
|
url: window.location.href,
|
|
847
|
-
message:
|
|
848
|
-
componentName:
|
|
899
|
+
message: h,
|
|
900
|
+
componentName: b.componentPath || u.tag,
|
|
901
|
+
reference: b
|
|
849
902
|
})
|
|
850
|
-
})).ok)
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
console.error(D), e(r.error, "error");
|
|
903
|
+
})).ok) throw new Error("Backend failed");
|
|
904
|
+
e(r.success, "success"), m(null), x(""), i(!1);
|
|
905
|
+
} catch (k) {
|
|
906
|
+
console.error(k), e(r.error, "error");
|
|
855
907
|
} finally {
|
|
856
|
-
|
|
908
|
+
A(!1);
|
|
857
909
|
}
|
|
858
|
-
},
|
|
859
|
-
return
|
|
860
|
-
position: "fixed",
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
910
|
+
}, z = (b) => b.split("/").pop()?.split("\\").pop() || "unknown";
|
|
911
|
+
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
912
|
+
/* @__PURE__ */ d.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:230", style: { position: "fixed", bottom: "30px", right: "30px", zIndex: 99999 }, id: "viewgate-ui", children: /* @__PURE__ */ d.jsx(
|
|
913
|
+
"button",
|
|
914
|
+
{
|
|
915
|
+
onClick: () => i(!s),
|
|
916
|
+
className: "vg-button-primary",
|
|
917
|
+
style: { padding: "12px 24px", fontSize: "15px" },
|
|
918
|
+
children: s ? r.exitMode : r.enterMode
|
|
919
|
+
}
|
|
920
|
+
) }),
|
|
921
|
+
G && /* @__PURE__ */ d.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:242", style: {
|
|
922
|
+
position: "fixed",
|
|
923
|
+
top: 0,
|
|
924
|
+
left: 0,
|
|
925
|
+
width: "100%",
|
|
926
|
+
height: "100%",
|
|
927
|
+
backgroundColor: "rgba(255,255,255,0.5)",
|
|
928
|
+
display: "flex",
|
|
929
|
+
alignItems: "center",
|
|
930
|
+
justifyContent: "center",
|
|
931
|
+
zIndex: 1e5,
|
|
932
|
+
cursor: "wait"
|
|
933
|
+
}, children: /* @__PURE__ */ d.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:255", className: "vg-glassmorphism", style: { padding: "20px 40px", fontWeight: 700 }, children: "Capturing..." }) }),
|
|
934
|
+
s && c && !u && !G && /* @__PURE__ */ d.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:263", style: {
|
|
935
|
+
position: "fixed",
|
|
936
|
+
top: c.rect.top,
|
|
937
|
+
left: c.rect.left,
|
|
938
|
+
width: c.rect.width,
|
|
939
|
+
height: c.rect.height,
|
|
940
|
+
border: "2px solid var(--vg-primary)",
|
|
941
|
+
backgroundColor: "rgba(37, 19, 236, 0.05)",
|
|
942
|
+
pointerEvents: "none",
|
|
943
|
+
zIndex: 99998,
|
|
944
|
+
borderRadius: "4px",
|
|
945
|
+
boxShadow: "0 0 15px rgba(37, 19, 236, 0.2)",
|
|
946
|
+
transition: "all 0.1s ease-out"
|
|
947
|
+
} }),
|
|
948
|
+
u && /* @__PURE__ */ d.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:281", className: "vg-animate-fade", style: {
|
|
949
|
+
position: "fixed",
|
|
950
|
+
top: 0,
|
|
951
|
+
left: 0,
|
|
952
|
+
width: "100%",
|
|
953
|
+
height: "100%",
|
|
954
|
+
backgroundColor: "rgba(0,0,0,0.6)",
|
|
955
|
+
backdropFilter: "blur(4px)",
|
|
956
|
+
display: "flex",
|
|
957
|
+
alignItems: "center",
|
|
958
|
+
justifyContent: "center",
|
|
959
|
+
zIndex: 99999
|
|
960
|
+
}, children: /* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:294", className: "vg-glassmorphism vg-animate-slide", style: {
|
|
961
|
+
padding: "32px",
|
|
962
|
+
width: "460px",
|
|
963
|
+
background: "white",
|
|
964
|
+
color: "#0f172a"
|
|
965
|
+
}, children: [
|
|
966
|
+
/* @__PURE__ */ d.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:300", style: { margin: "0 0 10px 0", fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
|
|
967
|
+
/* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:302", style: { marginBottom: "20px" }, children: [
|
|
968
|
+
/* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:303", style: { display: "flex", flexWrap: "wrap", gap: "8px", alignItems: "center" }, children: [
|
|
969
|
+
u.semanticReference.componentPath ? /* @__PURE__ */ d.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:305", className: "vg-badge", style: { backgroundColor: "#f5f3ff", color: "#7c3aed", borderColor: "#ddd6fe" }, children: [
|
|
970
|
+
"📦 ",
|
|
971
|
+
u.semanticReference.componentPath
|
|
972
|
+
] }) : /* @__PURE__ */ d.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:309", className: "vg-badge", children: u.tag }),
|
|
973
|
+
u.semanticReference.source && !u.semanticReference.source.startsWith("unknown") ? /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:314", className: "vg-badge", style: { backgroundColor: "#fdf2f8", color: "#db2777", borderColor: "#fbcfe8" }, children: [
|
|
974
|
+
"📄 ",
|
|
975
|
+
z(u.semanticReference.source.split(":")[0] || "unknown")
|
|
976
|
+
] }) }) : /* @__PURE__ */ d.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:319", className: "vg-badge", style: { backgroundColor: "#f0f9ff", color: "#0369a1", borderColor: "#bae6fd", maxWidth: "300px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
|
|
977
|
+
"🆔 ",
|
|
978
|
+
u.semanticReference.signature
|
|
979
|
+
] })
|
|
980
|
+
] }),
|
|
981
|
+
/* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:324", style: { marginTop: "8px", fontSize: "11px", color: "#94a3b8" }, children: [
|
|
982
|
+
"🎯 ",
|
|
983
|
+
u.semanticReference.selector
|
|
984
|
+
] })
|
|
985
|
+
] }),
|
|
986
|
+
/* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:330", style: {
|
|
987
|
+
backgroundColor: "#f8fafc",
|
|
988
|
+
borderRadius: "8px",
|
|
989
|
+
border: "1px solid #e2e8f0",
|
|
990
|
+
marginBottom: "20px",
|
|
991
|
+
overflow: "hidden",
|
|
992
|
+
display: "flex",
|
|
993
|
+
flexDirection: "column"
|
|
994
|
+
}, children: [
|
|
995
|
+
/* @__PURE__ */ d.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:339", style: { padding: "8px 12px", fontSize: "10px", color: "#94a3b8", textTransform: "uppercase", fontWeight: 700, borderBottom: "1px solid #f1f5f9" }, children: r.preview }),
|
|
996
|
+
/* @__PURE__ */ d.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:342", style: {
|
|
997
|
+
padding: "12px",
|
|
998
|
+
display: "flex",
|
|
999
|
+
justifyContent: "center",
|
|
1000
|
+
alignItems: "center",
|
|
1001
|
+
minHeight: "60px",
|
|
1002
|
+
maxHeight: "150px",
|
|
1003
|
+
overflow: "hidden",
|
|
1004
|
+
backgroundColor: "white"
|
|
1005
|
+
}, children: u.visualPreview ? /* @__PURE__ */ d.jsx(
|
|
1006
|
+
"img",
|
|
1007
|
+
{
|
|
1008
|
+
src: u.visualPreview,
|
|
1009
|
+
alt: "Element Preview",
|
|
1010
|
+
style: {
|
|
1011
|
+
maxWidth: "100%",
|
|
1012
|
+
maxHeight: "120px",
|
|
1013
|
+
objectFit: "contain",
|
|
1014
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
1015
|
+
borderRadius: "4px"
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
) : /* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:365", style: { fontSize: "13px", color: "#64748b", fontStyle: "italic" }, children: [
|
|
1019
|
+
'"',
|
|
1020
|
+
u.previewText,
|
|
1021
|
+
'"'
|
|
1022
|
+
] }) })
|
|
1023
|
+
] }),
|
|
1024
|
+
/* @__PURE__ */ d.jsx(
|
|
1025
|
+
"textarea",
|
|
1026
|
+
{
|
|
1027
|
+
className: "vg-textarea",
|
|
1028
|
+
value: h,
|
|
1029
|
+
onChange: (b) => x(b.target.value),
|
|
1030
|
+
rows: 4,
|
|
1031
|
+
placeholder: r.placeholder,
|
|
1032
|
+
autoFocus: !0
|
|
1033
|
+
}
|
|
1034
|
+
),
|
|
1035
|
+
/* @__PURE__ */ d.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:381", style: { display: "flex", justifyContent: "flex-end", gap: "12px", marginTop: "24px" }, children: [
|
|
1036
|
+
/* @__PURE__ */ d.jsx(
|
|
1037
|
+
"button",
|
|
1038
|
+
{
|
|
1039
|
+
onClick: () => m(null),
|
|
1040
|
+
className: "vg-button-ghost",
|
|
1041
|
+
children: r.cancel
|
|
1042
|
+
}
|
|
1043
|
+
),
|
|
1044
|
+
/* @__PURE__ */ d.jsx(
|
|
1045
|
+
"button",
|
|
1046
|
+
{
|
|
1047
|
+
onClick: N,
|
|
1048
|
+
className: "vg-button-primary",
|
|
1049
|
+
disabled: S || !h.trim(),
|
|
1050
|
+
style: { opacity: S || !h.trim() ? 0.6 : 1 },
|
|
1051
|
+
children: S ? r.submitting : r.send
|
|
1052
|
+
}
|
|
1053
|
+
)
|
|
1054
|
+
] })
|
|
1055
|
+
] }) })
|
|
1056
|
+
] });
|
|
924
1057
|
};
|
|
925
|
-
function
|
|
1058
|
+
function Pe(e, t, r) {
|
|
1059
|
+
if (!t.endsWith(".tsx") && !t.endsWith(".jsx") || t.includes("node_modules")) return e;
|
|
1060
|
+
const n = (c) => c.replace(/\\/g, "/"), a = n(t).replace(n(r), "");
|
|
1061
|
+
return e.split(`
|
|
1062
|
+
`).map((c, l) => {
|
|
1063
|
+
const u = l + 1;
|
|
1064
|
+
return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g, (m, h, x) => m.includes("data-source-path") || x === "Fragment" || x === "React.Fragment" ? m : `${h}<${x} data-source-path="${a}:${u}"`);
|
|
1065
|
+
}).join(`
|
|
1066
|
+
`);
|
|
1067
|
+
}
|
|
1068
|
+
function Mt() {
|
|
926
1069
|
return {
|
|
927
1070
|
name: "vite-plugin-viewgate",
|
|
928
1071
|
enforce: "pre",
|
|
929
1072
|
transform(e, t) {
|
|
930
|
-
return
|
|
931
|
-
code: e.
|
|
932
|
-
`).map((s, a) => {
|
|
933
|
-
const i = a + 1, c = (d) => d.replace(/\\/g, "/"), l = c(t).replace(c(process.cwd()), "");
|
|
934
|
-
return s.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n>])/g, (d, x, w) => d.includes("data-source-path") || w === "Fragment" || w === "React.Fragment" ? d : `${x}<${w} data-source-path="${l}:${i}"`);
|
|
935
|
-
}).join(`
|
|
936
|
-
`),
|
|
1073
|
+
return {
|
|
1074
|
+
code: Pe(e, t, process.cwd()),
|
|
937
1075
|
map: null
|
|
938
1076
|
};
|
|
939
1077
|
}
|
|
940
1078
|
};
|
|
941
1079
|
}
|
|
942
|
-
function
|
|
943
|
-
if (!t.endsWith(".tsx") && !t.endsWith(".jsx") || t.includes("node_modules")) return e;
|
|
944
|
-
const n = (c) => c.replace(/\\/g, "/"), s = n(t).replace(n(r), "");
|
|
945
|
-
return e.split(`
|
|
946
|
-
`).map((c, l) => {
|
|
947
|
-
const m = l + 1;
|
|
948
|
-
return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g, (d, x, w) => d.includes("data-source-path") || w === "Fragment" || w === "React.Fragment" ? d : `${x}<${w} data-source-path="${s}:${m}"`);
|
|
949
|
-
}).join(`
|
|
950
|
-
`);
|
|
951
|
-
}
|
|
952
|
-
function Mt(e) {
|
|
1080
|
+
function Dt(e) {
|
|
953
1081
|
const t = this.resourcePath;
|
|
954
|
-
return t ? (process.env.NODE_ENV,
|
|
1082
|
+
return t ? (process.env.NODE_ENV, Pe(e, t, process.cwd())) : e;
|
|
955
1083
|
}
|
|
956
1084
|
export {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1085
|
+
Gt as ViewGate,
|
|
1086
|
+
Vt as ViewGateOverlay,
|
|
1087
|
+
Pe as transformSourcePaths,
|
|
1088
|
+
De as useViewGate,
|
|
1089
|
+
Dt as viewgateNextLoader,
|
|
1090
|
+
Mt as viewgatePlugin
|
|
963
1091
|
};
|