viewgate-wrapper 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ViewGateOverlay.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin/next-loader.d.ts +2 -0
- package/dist/plugin/next-loader.d.ts.map +1 -0
- package/dist/plugin/next-loader.js +7 -0
- package/dist/plugin/transform-logic.d.ts +2 -0
- package/dist/plugin/transform-logic.d.ts.map +1 -0
- package/dist/plugin/transform-logic.js +20 -0
- package/dist/plugin/vite-plugin-viewgate.d.ts +8 -2
- package/dist/plugin/vite-plugin-viewgate.d.ts.map +1 -1
- package/dist/plugin/vite-plugin-viewgate.js +14 -0
- package/dist/viewgate-wrapper.js +220 -204
- package/dist/viewgate-wrapper.umd.cjs +8 -6
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,wBAAwB,CAAC;AAWhC,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,wBAAwB,CAAC;AAWhC,eAAO,MAAM,eAAe,EAAE,EAiS7B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './components/ViewGateOverlay.js';
|
|
2
2
|
export * from './components/ViewGateProvider.js';
|
|
3
3
|
export { default as viewgatePlugin } from './plugin/vite-plugin-viewgate.js';
|
|
4
|
+
export { default as viewgateNextLoader } from './plugin/next-loader.js';
|
|
5
|
+
export * from './plugin/transform-logic.js';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-loader.d.ts","sourceRoot":"","sources":["../../src/plugin/next-loader.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,UAInE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-logic.d.ts","sourceRoot":"","sources":["../../src/plugin/transform-logic.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAoBzE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function transformSourcePaths(code, id, cwd) {
|
|
2
|
+
if (!id.endsWith('.tsx') && !id.endsWith('.jsx'))
|
|
3
|
+
return code;
|
|
4
|
+
if (id.includes('node_modules'))
|
|
5
|
+
return code;
|
|
6
|
+
const normalizePath = (p) => p.replace(/\\/g, '/');
|
|
7
|
+
const relativePath = normalizePath(id).replace(normalizePath(cwd), '');
|
|
8
|
+
const lines = code.split('\n');
|
|
9
|
+
const transformedLines = lines.map((line, index) => {
|
|
10
|
+
const lineNumber = index + 1;
|
|
11
|
+
// Regex to find JSX tags and inject data-source-path
|
|
12
|
+
return line.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n>])/g, (match, prefix, tagName) => {
|
|
13
|
+
if (match.includes('data-source-path') || tagName === 'Fragment' || tagName === 'React.Fragment') {
|
|
14
|
+
return match;
|
|
15
|
+
}
|
|
16
|
+
return `${prefix}<${tagName} data-source-path="${relativePath}:${lineNumber}"`;
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
return transformedLines.join('\n');
|
|
20
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export default function viewgatePlugin(): {
|
|
2
|
+
name: string;
|
|
3
|
+
enforce: "pre";
|
|
4
|
+
transform(code: string, id: string): {
|
|
5
|
+
code: string;
|
|
6
|
+
map: null;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
3
9
|
//# sourceMappingURL=vite-plugin-viewgate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin-viewgate.d.ts","sourceRoot":"","sources":["../../src/plugin/vite-plugin-viewgate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vite-plugin-viewgate.d.ts","sourceRoot":"","sources":["../../src/plugin/vite-plugin-viewgate.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,cAAc;;;oBAId,MAAM,MAAM,MAAM;;;;EAQzC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { transformSourcePaths } from './transform-logic.js';
|
|
2
|
+
export default function viewgatePlugin() {
|
|
3
|
+
return {
|
|
4
|
+
name: 'vite-plugin-viewgate',
|
|
5
|
+
enforce: 'pre',
|
|
6
|
+
transform(code, id) {
|
|
7
|
+
const transformedCode = transformSourcePaths(code, id, process.cwd());
|
|
8
|
+
return {
|
|
9
|
+
code: transformedCode,
|
|
10
|
+
map: null
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
package/dist/viewgate-wrapper.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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;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
|
|
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 k, useContext as Fe, useCallback as ie, useEffect as Le } from "react";
|
|
3
3
|
var H = { exports: {} }, L = {};
|
|
4
|
-
var
|
|
4
|
+
var oe;
|
|
5
5
|
function Oe() {
|
|
6
|
-
if (
|
|
7
|
-
|
|
6
|
+
if (oe) return L;
|
|
7
|
+
oe = 1;
|
|
8
8
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
9
|
function r(n, s, a) {
|
|
10
|
-
var
|
|
11
|
-
if (a !== void 0 && (
|
|
10
|
+
var o = null;
|
|
11
|
+
if (a !== void 0 && (o = "" + a), s.key !== void 0 && (o = "" + s.key), "key" in s) {
|
|
12
12
|
a = {};
|
|
13
13
|
for (var c in s)
|
|
14
14
|
c !== "key" && (a[c] = s[c]);
|
|
@@ -16,7 +16,7 @@ function Oe() {
|
|
|
16
16
|
return s = a.ref, {
|
|
17
17
|
$$typeof: e,
|
|
18
18
|
type: n,
|
|
19
|
-
key:
|
|
19
|
+
key: o,
|
|
20
20
|
ref: s !== void 0 ? s : null,
|
|
21
21
|
props: a
|
|
22
22
|
};
|
|
@@ -27,160 +27,160 @@ var O = {};
|
|
|
27
27
|
var ce;
|
|
28
28
|
function Ie() {
|
|
29
29
|
return ce || (ce = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
|
-
function e(
|
|
31
|
-
if (
|
|
32
|
-
if (typeof
|
|
33
|
-
return
|
|
34
|
-
if (typeof
|
|
35
|
-
switch (
|
|
30
|
+
function e(i) {
|
|
31
|
+
if (i == null) return null;
|
|
32
|
+
if (typeof i == "function")
|
|
33
|
+
return i.$$typeof === Pe ? null : i.displayName || i.name || null;
|
|
34
|
+
if (typeof i == "string") return i;
|
|
35
|
+
switch (i) {
|
|
36
36
|
case T:
|
|
37
37
|
return "Fragment";
|
|
38
|
-
case
|
|
38
|
+
case U:
|
|
39
39
|
return "Profiler";
|
|
40
|
-
case
|
|
40
|
+
case $:
|
|
41
41
|
return "StrictMode";
|
|
42
42
|
case S:
|
|
43
43
|
return "Suspense";
|
|
44
|
-
case
|
|
44
|
+
case F:
|
|
45
45
|
return "SuspenseList";
|
|
46
46
|
case ke:
|
|
47
47
|
return "Activity";
|
|
48
48
|
}
|
|
49
|
-
if (typeof
|
|
50
|
-
switch (typeof
|
|
49
|
+
if (typeof i == "object")
|
|
50
|
+
switch (typeof i.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
|
+
), i.$$typeof) {
|
|
53
53
|
case I:
|
|
54
54
|
return "Portal";
|
|
55
|
-
case
|
|
56
|
-
return
|
|
55
|
+
case v:
|
|
56
|
+
return i.displayName || "Context";
|
|
57
57
|
case Y:
|
|
58
|
-
return (
|
|
58
|
+
return (i._context.displayName || "Context") + ".Consumer";
|
|
59
59
|
case y:
|
|
60
|
-
var u =
|
|
61
|
-
return
|
|
60
|
+
var u = i.render;
|
|
61
|
+
return i = i.displayName, i || (i = u.displayName || u.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i;
|
|
62
62
|
case D:
|
|
63
|
-
return u =
|
|
63
|
+
return u = i.displayName || null, u !== null ? u : e(i.type) || "Memo";
|
|
64
64
|
case G:
|
|
65
|
-
u =
|
|
65
|
+
u = i._payload, i = i._init;
|
|
66
66
|
try {
|
|
67
|
-
return e(
|
|
67
|
+
return e(i(u));
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
73
|
-
function t(
|
|
74
|
-
return "" +
|
|
73
|
+
function t(i) {
|
|
74
|
+
return "" + i;
|
|
75
75
|
}
|
|
76
|
-
function r(
|
|
76
|
+
function r(i) {
|
|
77
77
|
try {
|
|
78
|
-
t(
|
|
78
|
+
t(i);
|
|
79
79
|
var u = !1;
|
|
80
80
|
} catch {
|
|
81
81
|
u = !0;
|
|
82
82
|
}
|
|
83
83
|
if (u) {
|
|
84
84
|
u = console;
|
|
85
|
-
var
|
|
86
|
-
return
|
|
85
|
+
var h = u.error, g = typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
|
86
|
+
return h.call(
|
|
87
87
|
u,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
89
|
g
|
|
90
|
-
), t(
|
|
90
|
+
), t(i);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function n(
|
|
94
|
-
if (
|
|
95
|
-
if (typeof
|
|
93
|
+
function n(i) {
|
|
94
|
+
if (i === T) return "<>";
|
|
95
|
+
if (typeof i == "object" && i !== null && i.$$typeof === G)
|
|
96
96
|
return "<...>";
|
|
97
97
|
try {
|
|
98
|
-
var u = e(
|
|
98
|
+
var u = e(i);
|
|
99
99
|
return u ? "<" + u + ">" : "<...>";
|
|
100
100
|
} catch {
|
|
101
101
|
return "<...>";
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
function s() {
|
|
105
|
-
var
|
|
106
|
-
return
|
|
105
|
+
var i = N.A;
|
|
106
|
+
return i === null ? null : i.getOwner();
|
|
107
107
|
}
|
|
108
108
|
function a() {
|
|
109
109
|
return Error("react-stack-top-frame");
|
|
110
110
|
}
|
|
111
|
-
function i
|
|
112
|
-
if (ee.call(
|
|
113
|
-
var u = Object.getOwnPropertyDescriptor(
|
|
111
|
+
function o(i) {
|
|
112
|
+
if (ee.call(i, "key")) {
|
|
113
|
+
var u = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
114
114
|
if (u && u.isReactWarning) return !1;
|
|
115
115
|
}
|
|
116
|
-
return
|
|
116
|
+
return i.key !== void 0;
|
|
117
117
|
}
|
|
118
|
-
function c(
|
|
119
|
-
function
|
|
118
|
+
function c(i, u) {
|
|
119
|
+
function h() {
|
|
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
|
u
|
|
123
123
|
));
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
get:
|
|
125
|
+
h.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
126
|
+
get: h,
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
function l() {
|
|
131
|
-
var
|
|
132
|
-
return re[
|
|
131
|
+
var i = e(this.type);
|
|
132
|
+
return re[i] || (re[i] = !0, console.error(
|
|
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
|
+
)), i = this.props.ref, i !== void 0 ? i : null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
var p =
|
|
138
|
-
return
|
|
136
|
+
function m(i, u, h, g, M, B) {
|
|
137
|
+
var p = h.ref;
|
|
138
|
+
return i = {
|
|
139
139
|
$$typeof: A,
|
|
140
|
-
type:
|
|
140
|
+
type: i,
|
|
141
141
|
key: u,
|
|
142
|
-
props:
|
|
142
|
+
props: h,
|
|
143
143
|
_owner: g
|
|
144
|
-
}, (p !== void 0 ? p : null) !== null ? Object.defineProperty(
|
|
144
|
+
}, (p !== void 0 ? p : null) !== null ? Object.defineProperty(i, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
146
|
get: l
|
|
147
|
-
}) : Object.defineProperty(
|
|
147
|
+
}) : Object.defineProperty(i, "ref", { enumerable: !1, value: null }), i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
148
148
|
configurable: !1,
|
|
149
149
|
enumerable: !1,
|
|
150
150
|
writable: !0,
|
|
151
151
|
value: 0
|
|
152
|
-
}), Object.defineProperty(
|
|
152
|
+
}), Object.defineProperty(i, "_debugInfo", {
|
|
153
153
|
configurable: !1,
|
|
154
154
|
enumerable: !1,
|
|
155
155
|
writable: !0,
|
|
156
156
|
value: null
|
|
157
|
-
}), Object.defineProperty(
|
|
157
|
+
}), Object.defineProperty(i, "_debugStack", {
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
160
160
|
writable: !0,
|
|
161
161
|
value: M
|
|
162
|
-
}), Object.defineProperty(
|
|
162
|
+
}), Object.defineProperty(i, "_debugTask", {
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
166
|
value: B
|
|
167
|
-
}), Object.freeze && (Object.freeze(
|
|
167
|
+
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
168
168
|
}
|
|
169
|
-
function d(
|
|
169
|
+
function d(i, u, h, g, M, B) {
|
|
170
170
|
var p = u.children;
|
|
171
171
|
if (p !== void 0)
|
|
172
172
|
if (g)
|
|
173
173
|
if (_e(p)) {
|
|
174
174
|
for (g = 0; g < p.length; g++)
|
|
175
|
-
|
|
175
|
+
x(p[g]);
|
|
176
176
|
Object.freeze && Object.freeze(p);
|
|
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
|
|
181
|
+
else x(p);
|
|
182
182
|
if (ee.call(u, "key")) {
|
|
183
|
-
p = e(
|
|
183
|
+
p = e(i);
|
|
184
184
|
var P = Object.keys(u).filter(function(je) {
|
|
185
185
|
return je !== "key";
|
|
186
186
|
});
|
|
@@ -197,60 +197,60 @@ React keys must be passed directly to JSX without using spread:
|
|
|
197
197
|
p
|
|
198
198
|
), ae[p + g] = !0);
|
|
199
199
|
}
|
|
200
|
-
if (p = null,
|
|
201
|
-
|
|
200
|
+
if (p = null, h !== void 0 && (r(h), p = "" + h), o(u) && (r(u.key), p = "" + u.key), "key" in u) {
|
|
201
|
+
h = {};
|
|
202
202
|
for (var J in u)
|
|
203
|
-
J !== "key" && (
|
|
204
|
-
} else
|
|
203
|
+
J !== "key" && (h[J] = u[J]);
|
|
204
|
+
} else h = u;
|
|
205
205
|
return p && c(
|
|
206
|
-
|
|
207
|
-
typeof
|
|
208
|
-
),
|
|
209
|
-
|
|
206
|
+
h,
|
|
207
|
+
typeof i == "function" ? i.displayName || i.name || "Unknown" : i
|
|
208
|
+
), m(
|
|
209
|
+
i,
|
|
210
210
|
p,
|
|
211
|
-
|
|
211
|
+
h,
|
|
212
212
|
s(),
|
|
213
213
|
M,
|
|
214
214
|
B
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
217
|
+
function x(i) {
|
|
218
|
+
w(i) ? i._store && (i._store.validated = 1) : typeof i == "object" && i !== null && i.$$typeof === G && (i._payload.status === "fulfilled" ? w(i._payload.value) && i._payload.value._store && (i._payload.value._store.validated = 1) : i._store && (i._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return typeof
|
|
220
|
+
function w(i) {
|
|
221
|
+
return typeof i == "object" && i !== null && i.$$typeof === A;
|
|
222
222
|
}
|
|
223
|
-
var C = Ae, A = /* @__PURE__ */ Symbol.for("react.transitional.element"), I = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"),
|
|
223
|
+
var C = Ae, A = /* @__PURE__ */ Symbol.for("react.transitional.element"), I = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), $ = /* @__PURE__ */ Symbol.for("react.strict_mode"), U = /* @__PURE__ */ Symbol.for("react.profiler"), Y = /* @__PURE__ */ Symbol.for("react.consumer"), v = /* @__PURE__ */ Symbol.for("react.context"), y = /* @__PURE__ */ Symbol.for("react.forward_ref"), S = /* @__PURE__ */ Symbol.for("react.suspense"), F = /* @__PURE__ */ Symbol.for("react.suspense_list"), D = /* @__PURE__ */ Symbol.for("react.memo"), G = /* @__PURE__ */ Symbol.for("react.lazy"), ke = /* @__PURE__ */ Symbol.for("react.activity"), Pe = /* @__PURE__ */ Symbol.for("react.client.reference"), N = C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, _e = Array.isArray, q = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
226
|
C = {
|
|
227
|
-
react_stack_bottom_frame: function(
|
|
228
|
-
return
|
|
227
|
+
react_stack_bottom_frame: function(i) {
|
|
228
|
+
return i();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
var te, re = {}, ne = C.react_stack_bottom_frame.bind(
|
|
232
232
|
C,
|
|
233
233
|
a
|
|
234
234
|
)(), se = q(n(a)), ae = {};
|
|
235
|
-
O.Fragment = T, O.jsx = function(
|
|
235
|
+
O.Fragment = T, O.jsx = function(i, u, h) {
|
|
236
236
|
var g = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
237
237
|
return d(
|
|
238
|
-
|
|
238
|
+
i,
|
|
239
239
|
u,
|
|
240
|
-
|
|
240
|
+
h,
|
|
241
241
|
!1,
|
|
242
242
|
g ? Error("react-stack-top-frame") : ne,
|
|
243
|
-
g ? q(n(
|
|
243
|
+
g ? q(n(i)) : se
|
|
244
244
|
);
|
|
245
|
-
}, O.jsxs = function(
|
|
245
|
+
}, O.jsxs = function(i, u, h) {
|
|
246
246
|
var g = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
247
247
|
return d(
|
|
248
|
-
|
|
248
|
+
i,
|
|
249
249
|
u,
|
|
250
|
-
|
|
250
|
+
h,
|
|
251
251
|
!0,
|
|
252
252
|
g ? Error("react-stack-top-frame") : ne,
|
|
253
|
-
g ? q(n(
|
|
253
|
+
g ? q(n(i)) : se
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
256
|
})()), O;
|
|
@@ -293,19 +293,19 @@ const Me = {
|
|
|
293
293
|
errorHeader: "Error",
|
|
294
294
|
preview: "Vista previa"
|
|
295
295
|
}
|
|
296
|
-
}, ye =
|
|
297
|
-
const e =
|
|
296
|
+
}, ye = $e(void 0), He = () => {
|
|
297
|
+
const e = Fe(ye);
|
|
298
298
|
if (!e)
|
|
299
299
|
throw new Error("useViewGate must be used within a ViewGateProvider");
|
|
300
300
|
return e;
|
|
301
|
-
},
|
|
301
|
+
}, It = ({ children: e, language: t = "es", apiKey: r }) => {
|
|
302
302
|
const [n, s] = k([]), a = (c, l) => {
|
|
303
|
-
const
|
|
304
|
-
s((d) => [...d, { id:
|
|
305
|
-
s((d) => d.filter((
|
|
303
|
+
const m = Date.now();
|
|
304
|
+
s((d) => [...d, { id: m, message: c, type: l }]), setTimeout(() => {
|
|
305
|
+
s((d) => d.filter((x) => x.id !== m));
|
|
306
306
|
}, 4e3);
|
|
307
|
-
},
|
|
308
|
-
return f.jsxs(ye.Provider, { value: { addToast: a, language: t, t:
|
|
307
|
+
}, o = Me[t];
|
|
308
|
+
return f.jsxs(ye.Provider, { value: { addToast: a, language: t, t: o, apiKey: r }, children: [e, f.jsx(Ft, {}), f.jsx("div", { className: "vg-toasts", children: n.map((c) => f.jsxs("div", { className: `vg-toast vg-glassmorphism vg-animate-slide ${c.type}`, children: [f.jsx("span", { style: { fontSize: "20px" }, children: c.type === "success" ? "✅" : "❌" }), f.jsxs("div", { children: [f.jsx("strong", { style: { display: "block" }, children: c.type === "success" ? o.successHeader : o.errorHeader }), f.jsx("span", { style: { fontSize: "14px" }, children: c.message })] })] }, c.id)) })] });
|
|
309
309
|
};
|
|
310
310
|
function Ve(e, t) {
|
|
311
311
|
if (e.match(/^[a-z]+:\/\//i))
|
|
@@ -317,7 +317,7 @@ function Ve(e, t) {
|
|
|
317
317
|
const r = document.implementation.createHTMLDocument(), n = r.createElement("base"), s = r.createElement("a");
|
|
318
318
|
return r.head.appendChild(n), r.body.appendChild(s), t && (n.href = t), s.href = e, s.href;
|
|
319
319
|
}
|
|
320
|
-
const
|
|
320
|
+
const ze = /* @__PURE__ */ (() => {
|
|
321
321
|
let e = 0;
|
|
322
322
|
const t = () => (
|
|
323
323
|
// eslint-disable-next-line no-bitwise
|
|
@@ -343,12 +343,12 @@ function We(e) {
|
|
|
343
343
|
const t = V(e, "border-left-width"), r = V(e, "border-right-width");
|
|
344
344
|
return e.clientWidth + t + r;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Ue(e) {
|
|
347
347
|
const t = V(e, "border-top-width"), r = V(e, "border-bottom-width");
|
|
348
348
|
return e.clientHeight + t + r;
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
const r = t.width || We(e), n = t.height ||
|
|
350
|
+
function xe(e, t = {}) {
|
|
351
|
+
const r = t.width || We(e), n = t.height || Ue(e);
|
|
352
352
|
return { width: r, height: n };
|
|
353
353
|
}
|
|
354
354
|
function Ye() {
|
|
@@ -360,11 +360,11 @@ function Ye() {
|
|
|
360
360
|
const r = t && t.env ? t.env.devicePixelRatio : null;
|
|
361
361
|
return r && (e = parseInt(r, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
|
|
362
362
|
}
|
|
363
|
-
const
|
|
363
|
+
const E = 16384;
|
|
364
364
|
function Ge(e) {
|
|
365
|
-
(e.width >
|
|
365
|
+
(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
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function z(e) {
|
|
368
368
|
return new Promise((t, r) => {
|
|
369
369
|
const n = new Image();
|
|
370
370
|
n.onload = () => {
|
|
@@ -381,11 +381,11 @@ async function qe(e, t, r) {
|
|
|
381
381
|
const n = "http://www.w3.org/2000/svg", s = document.createElementNS(n, "svg"), a = document.createElementNS(n, "foreignObject");
|
|
382
382
|
return s.setAttribute("width", `${t}`), s.setAttribute("height", `${r}`), s.setAttribute("viewBox", `0 0 ${t} ${r}`), a.setAttribute("width", "100%"), a.setAttribute("height", "100%"), a.setAttribute("x", "0"), a.setAttribute("y", "0"), a.setAttribute("externalResourcesRequired", "true"), s.appendChild(a), a.appendChild(e), Ne(s);
|
|
383
383
|
}
|
|
384
|
-
const
|
|
384
|
+
const b = (e, t) => {
|
|
385
385
|
if (e instanceof t)
|
|
386
386
|
return !0;
|
|
387
387
|
const r = Object.getPrototypeOf(e);
|
|
388
|
-
return r === null ? !1 : r.constructor.name === t.name ||
|
|
388
|
+
return r === null ? !1 : r.constructor.name === t.name || b(r, t);
|
|
389
389
|
};
|
|
390
390
|
function Be(e) {
|
|
391
391
|
const t = e.getPropertyValue("content");
|
|
@@ -405,14 +405,14 @@ function ue(e, t, r, n) {
|
|
|
405
405
|
const s = window.getComputedStyle(e, r), a = s.getPropertyValue("content");
|
|
406
406
|
if (a === "" || a === "none")
|
|
407
407
|
return;
|
|
408
|
-
const
|
|
408
|
+
const o = ze();
|
|
409
409
|
try {
|
|
410
|
-
t.className = `${t.className} ${
|
|
410
|
+
t.className = `${t.className} ${o}`;
|
|
411
411
|
} catch {
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
414
|
const c = document.createElement("style");
|
|
415
|
-
c.appendChild(Xe(
|
|
415
|
+
c.appendChild(Xe(o, r, s, n)), t.appendChild(c);
|
|
416
416
|
}
|
|
417
417
|
function Ze(e, t, r) {
|
|
418
418
|
ue(e, t, ":before", r), ue(e, t, ":after", r);
|
|
@@ -447,18 +447,18 @@ function Z(e) {
|
|
|
447
447
|
function tt(e, t) {
|
|
448
448
|
return `data:${t};base64,${e}`;
|
|
449
449
|
}
|
|
450
|
-
async function
|
|
450
|
+
async function be(e, t, r) {
|
|
451
451
|
const n = await fetch(e, t);
|
|
452
452
|
if (n.status === 404)
|
|
453
453
|
throw new Error(`Resource "${n.url}" not found`);
|
|
454
454
|
const s = await n.blob();
|
|
455
|
-
return new Promise((a,
|
|
455
|
+
return new Promise((a, o) => {
|
|
456
456
|
const c = new FileReader();
|
|
457
|
-
c.onerror =
|
|
457
|
+
c.onerror = o, c.onloadend = () => {
|
|
458
458
|
try {
|
|
459
459
|
a(r({ res: n, result: c.result }));
|
|
460
460
|
} catch (l) {
|
|
461
|
-
|
|
461
|
+
o(l);
|
|
462
462
|
}
|
|
463
463
|
}, c.readAsDataURL(s);
|
|
464
464
|
});
|
|
@@ -475,28 +475,28 @@ async function K(e, t, r) {
|
|
|
475
475
|
r.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
476
476
|
let s;
|
|
477
477
|
try {
|
|
478
|
-
const a = await
|
|
478
|
+
const a = await be(e, r.fetchRequestInit, ({ res: o, result: c }) => (t || (t = o.headers.get("Content-Type") || ""), et(c)));
|
|
479
479
|
s = tt(a, t);
|
|
480
480
|
} catch (a) {
|
|
481
481
|
s = r.imagePlaceholder || "";
|
|
482
|
-
let
|
|
483
|
-
a && (
|
|
482
|
+
let o = `Failed to fetch resource: ${e}`;
|
|
483
|
+
a && (o = typeof a == "string" ? a : a.message), o && console.warn(o);
|
|
484
484
|
}
|
|
485
485
|
return X[n] = s, s;
|
|
486
486
|
}
|
|
487
487
|
async function nt(e) {
|
|
488
488
|
const t = e.toDataURL();
|
|
489
|
-
return t === "data:," ? e.cloneNode(!1) :
|
|
489
|
+
return t === "data:," ? e.cloneNode(!1) : z(t);
|
|
490
490
|
}
|
|
491
491
|
async function st(e, t) {
|
|
492
492
|
if (e.currentSrc) {
|
|
493
|
-
const a = document.createElement("canvas"),
|
|
494
|
-
a.width = e.clientWidth, a.height = e.clientHeight,
|
|
493
|
+
const a = document.createElement("canvas"), o = a.getContext("2d");
|
|
494
|
+
a.width = e.clientWidth, a.height = e.clientHeight, o?.drawImage(e, 0, 0, a.width, a.height);
|
|
495
495
|
const c = a.toDataURL();
|
|
496
|
-
return
|
|
496
|
+
return z(c);
|
|
497
497
|
}
|
|
498
498
|
const r = e.poster, n = Q(r), s = await K(r, n, t);
|
|
499
|
-
return
|
|
499
|
+
return z(s);
|
|
500
500
|
}
|
|
501
501
|
async function at(e, t) {
|
|
502
502
|
var r;
|
|
@@ -507,16 +507,16 @@ async function at(e, t) {
|
|
|
507
507
|
}
|
|
508
508
|
return e.cloneNode(!1);
|
|
509
509
|
}
|
|
510
|
-
async function
|
|
511
|
-
return
|
|
510
|
+
async function it(e, t) {
|
|
511
|
+
return b(e, HTMLCanvasElement) ? nt(e) : b(e, HTMLVideoElement) ? st(e, t) : b(e, HTMLIFrameElement) ? at(e, t) : e.cloneNode(ve(e));
|
|
512
512
|
}
|
|
513
|
-
const
|
|
513
|
+
const ot = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", ve = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
514
514
|
async function ct(e, t, r) {
|
|
515
515
|
var n, s;
|
|
516
516
|
if (ve(t))
|
|
517
517
|
return t;
|
|
518
518
|
let a = [];
|
|
519
|
-
return
|
|
519
|
+
return ot(e) && e.assignedNodes ? a = R(e.assignedNodes()) : b(e, HTMLIFrameElement) && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? a = R(e.contentDocument.body.childNodes) : a = R(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), a.length === 0 || b(e, HTMLVideoElement) || await a.reduce((o, c) => o.then(() => W(c, r)).then((l) => {
|
|
520
520
|
l && t.appendChild(l);
|
|
521
521
|
}), Promise.resolve()), t;
|
|
522
522
|
}
|
|
@@ -526,21 +526,21 @@ function lt(e, t, r) {
|
|
|
526
526
|
return;
|
|
527
527
|
const s = window.getComputedStyle(e);
|
|
528
528
|
s.cssText ? (n.cssText = s.cssText, n.transformOrigin = s.transformOrigin) : we(r).forEach((a) => {
|
|
529
|
-
let
|
|
530
|
-
a === "font-size" &&
|
|
529
|
+
let o = s.getPropertyValue(a);
|
|
530
|
+
a === "font-size" && o.endsWith("px") && (o = `${Math.floor(parseFloat(o.substring(0, o.length - 2))) - 0.1}px`), b(e, HTMLIFrameElement) && a === "display" && o === "inline" && (o = "block"), a === "d" && t.getAttribute("d") && (o = `path(${t.getAttribute("d")})`), n.setProperty(a, o, s.getPropertyPriority(a));
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
533
|
function ut(e, t) {
|
|
534
|
-
|
|
534
|
+
b(e, HTMLTextAreaElement) && (t.innerHTML = e.value), b(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
535
535
|
}
|
|
536
536
|
function ft(e, t) {
|
|
537
|
-
if (
|
|
537
|
+
if (b(e, HTMLSelectElement)) {
|
|
538
538
|
const n = Array.from(t.children).find((s) => e.value === s.getAttribute("value"));
|
|
539
539
|
n && n.setAttribute("selected", "");
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
function dt(e, t, r) {
|
|
543
|
-
return
|
|
543
|
+
return b(t, Element) && (lt(e, t, r), Ze(e, t, r), ut(e, t), ft(e, t)), t;
|
|
544
544
|
}
|
|
545
545
|
async function mt(e, t) {
|
|
546
546
|
const r = e.querySelectorAll ? e.querySelectorAll("use") : [];
|
|
@@ -550,24 +550,24 @@ async function mt(e, t) {
|
|
|
550
550
|
for (let a = 0; a < r.length; a++) {
|
|
551
551
|
const c = r[a].getAttribute("xlink:href");
|
|
552
552
|
if (c) {
|
|
553
|
-
const l = e.querySelector(c),
|
|
554
|
-
!l &&
|
|
553
|
+
const l = e.querySelector(c), m = document.querySelector(c);
|
|
554
|
+
!l && m && !n[c] && (n[c] = await W(m, t, !0));
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
const s = Object.values(n);
|
|
558
558
|
if (s.length) {
|
|
559
|
-
const a = "http://www.w3.org/1999/xhtml",
|
|
560
|
-
|
|
559
|
+
const a = "http://www.w3.org/1999/xhtml", o = document.createElementNS(a, "svg");
|
|
560
|
+
o.setAttribute("xmlns", a), o.style.position = "absolute", o.style.width = "0", o.style.height = "0", o.style.overflow = "hidden", o.style.display = "none";
|
|
561
561
|
const c = document.createElementNS(a, "defs");
|
|
562
|
-
|
|
562
|
+
o.appendChild(c);
|
|
563
563
|
for (let l = 0; l < s.length; l++)
|
|
564
564
|
c.appendChild(s[l]);
|
|
565
|
-
e.appendChild(
|
|
565
|
+
e.appendChild(o);
|
|
566
566
|
}
|
|
567
567
|
return e;
|
|
568
568
|
}
|
|
569
569
|
async function W(e, t, r) {
|
|
570
|
-
return !r && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((n) =>
|
|
570
|
+
return !r && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((n) => it(n, t)).then((n) => ct(e, n, t)).then((n) => dt(e, n, t)).then((n) => mt(n, t));
|
|
571
571
|
}
|
|
572
572
|
const Ee = /url\((['"]?)([^'"]+?)\1\)/g, ht = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, gt = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
573
573
|
function pt(e) {
|
|
@@ -580,14 +580,14 @@ function yt(e) {
|
|
|
580
580
|
}
|
|
581
581
|
async function wt(e, t, r, n, s) {
|
|
582
582
|
try {
|
|
583
|
-
const a = r ? Ve(t, r) : t,
|
|
583
|
+
const a = r ? Ve(t, r) : t, o = Q(t);
|
|
584
584
|
let c;
|
|
585
|
-
return s || (c = await K(a,
|
|
585
|
+
return s || (c = await K(a, o, n)), e.replace(pt(t), `$1${c}$3`);
|
|
586
586
|
} catch {
|
|
587
587
|
}
|
|
588
588
|
return e;
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function xt(e, { preferredFontFormat: t }) {
|
|
591
591
|
return t ? e.replace(gt, (r) => {
|
|
592
592
|
for (; ; ) {
|
|
593
593
|
const [n, , s] = ht.exec(r) || [];
|
|
@@ -604,8 +604,8 @@ function Se(e) {
|
|
|
604
604
|
async function Re(e, t, r) {
|
|
605
605
|
if (!Se(e))
|
|
606
606
|
return e;
|
|
607
|
-
const n =
|
|
608
|
-
return yt(n).reduce((a,
|
|
607
|
+
const n = xt(e, r);
|
|
608
|
+
return yt(n).reduce((a, o) => a.then((c) => wt(c, o, t, r)), Promise.resolve(n));
|
|
609
609
|
}
|
|
610
610
|
async function j(e, t, r) {
|
|
611
611
|
var n;
|
|
@@ -616,22 +616,22 @@ async function j(e, t, r) {
|
|
|
616
616
|
}
|
|
617
617
|
return !1;
|
|
618
618
|
}
|
|
619
|
-
async function
|
|
619
|
+
async function bt(e, t) {
|
|
620
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
621
|
}
|
|
622
622
|
async function vt(e, t) {
|
|
623
|
-
const r =
|
|
624
|
-
if (!(r && !Z(e.src)) && !(
|
|
623
|
+
const r = b(e, HTMLImageElement);
|
|
624
|
+
if (!(r && !Z(e.src)) && !(b(e, SVGImageElement) && !Z(e.href.baseVal)))
|
|
625
625
|
return;
|
|
626
626
|
const n = r ? e.src : e.href.baseVal, s = await K(n, Q(n), t);
|
|
627
|
-
await new Promise((a,
|
|
627
|
+
await new Promise((a, o) => {
|
|
628
628
|
e.onload = a, e.onerror = t.onImageErrorHandler ? (...l) => {
|
|
629
629
|
try {
|
|
630
630
|
a(t.onImageErrorHandler(...l));
|
|
631
|
-
} catch (
|
|
632
|
-
|
|
631
|
+
} catch (m) {
|
|
632
|
+
o(m);
|
|
633
633
|
}
|
|
634
|
-
} :
|
|
634
|
+
} : o;
|
|
635
635
|
const c = e;
|
|
636
636
|
c.decode && (c.decode = a), c.loading === "lazy" && (c.loading = "eager"), r ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
|
|
637
637
|
});
|
|
@@ -641,7 +641,7 @@ async function Et(e, t) {
|
|
|
641
641
|
await Promise.all(n).then(() => e);
|
|
642
642
|
}
|
|
643
643
|
async function Ce(e, t) {
|
|
644
|
-
|
|
644
|
+
b(e, Element) && (await bt(e, t), await vt(e, t), await Et(e, t));
|
|
645
645
|
}
|
|
646
646
|
function St(e, t) {
|
|
647
647
|
const { style: r } = e;
|
|
@@ -661,9 +661,9 @@ async function he(e) {
|
|
|
661
661
|
}
|
|
662
662
|
async function ge(e, t) {
|
|
663
663
|
let r = e.cssText;
|
|
664
|
-
const n = /url\(["']?([^"')]+)["']?\)/g, a = (r.match(/url\([^)]+\)/g) || []).map(async (
|
|
665
|
-
let c =
|
|
666
|
-
return c.startsWith("https://") || (c = new URL(c, e.url).href),
|
|
664
|
+
const n = /url\(["']?([^"')]+)["']?\)/g, a = (r.match(/url\([^)]+\)/g) || []).map(async (o) => {
|
|
665
|
+
let c = o.replace(n, "$1");
|
|
666
|
+
return c.startsWith("https://") || (c = new URL(c, e.url).href), be(c, t.fetchRequestInit, ({ result: l }) => (r = r.replace(o, `url(${l})`), [o, l]));
|
|
667
667
|
});
|
|
668
668
|
return Promise.all(a).then(() => r);
|
|
669
669
|
}
|
|
@@ -680,7 +680,7 @@ function pe(e) {
|
|
|
680
680
|
t.push(l[0]);
|
|
681
681
|
}
|
|
682
682
|
n = n.replace(s, "");
|
|
683
|
-
const a = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,
|
|
683
|
+
const a = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, o = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", c = new RegExp(o, "gi");
|
|
684
684
|
for (; ; ) {
|
|
685
685
|
let l = a.exec(n);
|
|
686
686
|
if (l === null) {
|
|
@@ -698,28 +698,28 @@ async function Rt(e, t) {
|
|
|
698
698
|
return e.forEach((s) => {
|
|
699
699
|
if ("cssRules" in s)
|
|
700
700
|
try {
|
|
701
|
-
R(s.cssRules || []).forEach((a,
|
|
701
|
+
R(s.cssRules || []).forEach((a, o) => {
|
|
702
702
|
if (a.type === CSSRule.IMPORT_RULE) {
|
|
703
|
-
let c =
|
|
704
|
-
const l = a.href,
|
|
703
|
+
let c = o + 1;
|
|
704
|
+
const l = a.href, m = he(l).then((d) => ge(d, t)).then((d) => pe(d).forEach((x) => {
|
|
705
705
|
try {
|
|
706
|
-
s.insertRule(
|
|
707
|
-
} catch (
|
|
706
|
+
s.insertRule(x, x.startsWith("@import") ? c += 1 : s.cssRules.length);
|
|
707
|
+
} catch (w) {
|
|
708
708
|
console.error("Error inserting rule from remote css", {
|
|
709
|
-
rule:
|
|
710
|
-
error:
|
|
709
|
+
rule: x,
|
|
710
|
+
error: w
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
713
|
})).catch((d) => {
|
|
714
714
|
console.error("Error loading remote css", d.toString());
|
|
715
715
|
});
|
|
716
|
-
n.push(
|
|
716
|
+
n.push(m);
|
|
717
717
|
}
|
|
718
718
|
});
|
|
719
719
|
} catch (a) {
|
|
720
|
-
const
|
|
720
|
+
const o = e.find((c) => c.href == null) || document.styleSheets[0];
|
|
721
721
|
s.href != null && n.push(he(s.href).then((c) => ge(c, t)).then((c) => pe(c).forEach((l) => {
|
|
722
|
-
|
|
722
|
+
o.insertRule(l, o.cssRules.length);
|
|
723
723
|
})).catch((c) => {
|
|
724
724
|
console.error("Error loading remote stylesheet", c);
|
|
725
725
|
})), console.error("Error inlining remote css file", a);
|
|
@@ -761,8 +761,8 @@ function kt(e) {
|
|
|
761
761
|
async function Pt(e, t) {
|
|
762
762
|
const r = await Tt(e, t), n = kt(e);
|
|
763
763
|
return (await Promise.all(r.filter((a) => n.has(Te(a.style.fontFamily))).map((a) => {
|
|
764
|
-
const
|
|
765
|
-
return Re(a.cssText,
|
|
764
|
+
const o = a.parentStyleSheet ? a.parentStyleSheet.href : null;
|
|
765
|
+
return Re(a.cssText, o, t);
|
|
766
766
|
}))).join(`
|
|
767
767
|
`);
|
|
768
768
|
}
|
|
@@ -774,21 +774,21 @@ async function _t(e, t) {
|
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
async function jt(e, t = {}) {
|
|
777
|
-
const { width: r, height: n } =
|
|
777
|
+
const { width: r, height: n } = xe(e, t), s = await W(e, t, !0);
|
|
778
778
|
return await _t(s, t), await Ce(s, t), St(s, t), await qe(s, r, n);
|
|
779
779
|
}
|
|
780
780
|
async function At(e, t = {}) {
|
|
781
|
-
const { width: r, height: n } =
|
|
782
|
-
return
|
|
781
|
+
const { width: r, height: n } = xe(e, t), s = await jt(e, t), a = await z(s), o = document.createElement("canvas"), c = o.getContext("2d"), l = t.pixelRatio || Ye(), m = t.canvasWidth || r, d = t.canvasHeight || n;
|
|
782
|
+
return o.width = m * l, o.height = d * l, t.skipAutoScale || Ge(o), o.style.width = `${m}`, o.style.height = `${d}`, t.backgroundColor && (c.fillStyle = t.backgroundColor, c.fillRect(0, 0, o.width, o.height)), c.drawImage(a, 0, 0, o.width, o.height), o;
|
|
783
783
|
}
|
|
784
|
-
async function
|
|
784
|
+
async function $t(e, t = {}) {
|
|
785
785
|
return (await At(e, t)).toDataURL();
|
|
786
786
|
}
|
|
787
|
-
const
|
|
788
|
-
const { addToast: e, language: t, t: r, apiKey: n } = He(), [s, a] = k(!1), [
|
|
787
|
+
const Ft = () => {
|
|
788
|
+
const { addToast: e, language: t, t: r, apiKey: n } = He(), [s, a] = k(!1), [o, c] = k(null), [l, m] = k(null), [d, x] = k(""), [w, C] = k(!1), [A, I] = k(!1), T = ie((v) => {
|
|
789
789
|
if (!s || l)
|
|
790
790
|
return;
|
|
791
|
-
const y = document.elementFromPoint(
|
|
791
|
+
const y = document.elementFromPoint(v.clientX, v.clientY);
|
|
792
792
|
if (!y || y.id === "viewgate-overlay" || y.closest("#viewgate-ui")) {
|
|
793
793
|
c(null);
|
|
794
794
|
return;
|
|
@@ -801,13 +801,13 @@ const $t = () => {
|
|
|
801
801
|
element: y,
|
|
802
802
|
previewText: y.innerText.slice(0, 100) || y.getAttribute("placeholder")?.slice(0, 100) || y.tagName.toLowerCase()
|
|
803
803
|
});
|
|
804
|
-
}, [s, l]),
|
|
805
|
-
if (!(!s || l) &&
|
|
806
|
-
|
|
804
|
+
}, [s, l]), $ = ie(async (v) => {
|
|
805
|
+
if (!(!s || l) && o) {
|
|
806
|
+
v.preventDefault(), v.stopPropagation(), I(!0);
|
|
807
807
|
try {
|
|
808
|
-
const y =
|
|
809
|
-
S && (
|
|
810
|
-
const
|
|
808
|
+
const y = o.element.style.display, S = window.getComputedStyle(o.element).display === "inline";
|
|
809
|
+
S && (o.element.style.display = "inline-block");
|
|
810
|
+
const F = await $t(o.element, {
|
|
811
811
|
backgroundColor: "#ffffff",
|
|
812
812
|
pixelRatio: 2,
|
|
813
813
|
skipFonts: !0,
|
|
@@ -817,22 +817,22 @@ const $t = () => {
|
|
|
817
817
|
// Extra padding for better look
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
|
-
S && (
|
|
820
|
+
S && (o.element.style.display = y), m({ ...o, visualPreview: F });
|
|
821
821
|
} catch (y) {
|
|
822
|
-
console.error("Failed to capture preview:", y),
|
|
822
|
+
console.error("Failed to capture preview:", y), m(o);
|
|
823
823
|
} finally {
|
|
824
824
|
I(!1), c(null);
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
|
-
}, [s,
|
|
828
|
-
Le(() => (s && !l ? document.body.classList.add("vg-cursor-pointer") : document.body.classList.remove("vg-cursor-pointer"), window.addEventListener("mousemove", T), window.addEventListener("click",
|
|
829
|
-
document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove", T), window.removeEventListener("click",
|
|
830
|
-
}), [s, l, T,
|
|
831
|
-
const
|
|
827
|
+
}, [s, o, l]);
|
|
828
|
+
Le(() => (s && !l ? document.body.classList.add("vg-cursor-pointer") : document.body.classList.remove("vg-cursor-pointer"), window.addEventListener("mousemove", T), window.addEventListener("click", $, !0), () => {
|
|
829
|
+
document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove", T), window.removeEventListener("click", $, !0);
|
|
830
|
+
}), [s, l, T, $]);
|
|
831
|
+
const U = async () => {
|
|
832
832
|
if (!l || !d.trim())
|
|
833
833
|
return;
|
|
834
834
|
C(!0);
|
|
835
|
-
const
|
|
835
|
+
const v = l.source || "unknown:0", [y, S] = v.split(":"), F = S || "0";
|
|
836
836
|
try {
|
|
837
837
|
if (!(await fetch("https://view-gate.vercel.app/api/annotations", {
|
|
838
838
|
method: "POST",
|
|
@@ -842,20 +842,20 @@ const $t = () => {
|
|
|
842
842
|
},
|
|
843
843
|
body: JSON.stringify({
|
|
844
844
|
filePath: y,
|
|
845
|
-
line: parseInt(
|
|
845
|
+
line: parseInt(F),
|
|
846
846
|
url: window.location.href,
|
|
847
847
|
message: d,
|
|
848
848
|
componentName: l.tag
|
|
849
849
|
})
|
|
850
850
|
})).ok)
|
|
851
851
|
throw new Error("Backend failed");
|
|
852
|
-
e(r.success, "success"),
|
|
852
|
+
e(r.success, "success"), m(null), x(""), a(!1);
|
|
853
853
|
} catch (D) {
|
|
854
854
|
console.error(D), e(r.error, "error");
|
|
855
855
|
} finally {
|
|
856
856
|
C(!1);
|
|
857
857
|
}
|
|
858
|
-
}, Y = (
|
|
858
|
+
}, Y = (v) => v.split("/").pop()?.split("\\").pop() || "unknown";
|
|
859
859
|
return f.jsxs(f.Fragment, { children: [f.jsx("div", { style: { position: "fixed", bottom: "30px", right: "30px", zIndex: 99999 }, id: "viewgate-ui", children: f.jsx("button", { onClick: () => a(!s), className: "vg-button-primary", style: { padding: "12px 24px", fontSize: "15px" }, children: s ? r.exitMode : r.enterMode }) }), A && f.jsx("div", { style: {
|
|
860
860
|
position: "fixed",
|
|
861
861
|
top: 0,
|
|
@@ -868,12 +868,12 @@ const $t = () => {
|
|
|
868
868
|
justifyContent: "center",
|
|
869
869
|
zIndex: 1e5,
|
|
870
870
|
cursor: "wait"
|
|
871
|
-
}, children: f.jsx("div", { className: "vg-glassmorphism", style: { padding: "20px 40px", fontWeight: 700 }, children: "Capturing..." }) }), s &&
|
|
871
|
+
}, children: f.jsx("div", { className: "vg-glassmorphism", style: { padding: "20px 40px", fontWeight: 700 }, children: "Capturing..." }) }), s && o && !l && !A && f.jsx("div", { style: {
|
|
872
872
|
position: "fixed",
|
|
873
|
-
top:
|
|
874
|
-
left:
|
|
875
|
-
width:
|
|
876
|
-
height:
|
|
873
|
+
top: o.rect.top,
|
|
874
|
+
left: o.rect.left,
|
|
875
|
+
width: o.rect.width,
|
|
876
|
+
height: o.rect.height,
|
|
877
877
|
border: "2px solid var(--vg-primary)",
|
|
878
878
|
backgroundColor: "rgba(37, 19, 236, 0.05)",
|
|
879
879
|
pointerEvents: "none",
|
|
@@ -920,9 +920,9 @@ const $t = () => {
|
|
|
920
920
|
objectFit: "contain",
|
|
921
921
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
922
922
|
borderRadius: "4px"
|
|
923
|
-
} }) : f.jsxs("div", { style: { fontSize: "13px", color: "#64748b", fontStyle: "italic" }, children: ['"', l.previewText, '"'] }) })] }), f.jsx("textarea", { className: "vg-textarea", value: d, onChange: (
|
|
923
|
+
} }) : f.jsxs("div", { style: { fontSize: "13px", color: "#64748b", fontStyle: "italic" }, children: ['"', l.previewText, '"'] }) })] }), f.jsx("textarea", { className: "vg-textarea", value: d, onChange: (v) => x(v.target.value), rows: 4, placeholder: r.placeholder, autoFocus: !0 }), f.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "12px", marginTop: "24px" }, children: [f.jsx("button", { onClick: () => m(null), className: "vg-button-ghost", children: r.cancel }), f.jsx("button", { onClick: U, className: "vg-button-primary", disabled: w || !d.trim(), style: { opacity: w || !d.trim() ? 0.6 : 1 }, children: w ? r.submitting : r.send })] })] }) })] });
|
|
924
924
|
};
|
|
925
|
-
function
|
|
925
|
+
function Dt() {
|
|
926
926
|
return {
|
|
927
927
|
name: "vite-plugin-viewgate",
|
|
928
928
|
enforce: "pre",
|
|
@@ -930,8 +930,8 @@ function It() {
|
|
|
930
930
|
return !t.endsWith(".tsx") && !t.endsWith(".jsx") || t.includes("node_modules") ? void 0 : {
|
|
931
931
|
code: e.split(`
|
|
932
932
|
`).map((s, a) => {
|
|
933
|
-
const
|
|
934
|
-
return s.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n>])/g, (d,
|
|
933
|
+
const o = 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}:${o}"`);
|
|
935
935
|
}).join(`
|
|
936
936
|
`),
|
|
937
937
|
map: null
|
|
@@ -939,9 +939,25 @@ function It() {
|
|
|
939
939
|
}
|
|
940
940
|
};
|
|
941
941
|
}
|
|
942
|
+
function Lt(e, t, r) {
|
|
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) {
|
|
953
|
+
const t = this.resourcePath;
|
|
954
|
+
return t ? Lt(e, t, process.cwd()) : e;
|
|
955
|
+
}
|
|
942
956
|
export {
|
|
943
|
-
|
|
944
|
-
|
|
957
|
+
It as ViewGate,
|
|
958
|
+
Ft as ViewGateOverlay,
|
|
959
|
+
Lt as transformSourcePaths,
|
|
945
960
|
He as useViewGate,
|
|
946
|
-
|
|
961
|
+
Mt as viewgateNextLoader,
|
|
962
|
+
Dt as viewgatePlugin
|
|
947
963
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
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;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
|
-
(function(R,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],w):(R=typeof globalThis<"u"?globalThis:R||self,w(R.ViewGateWrapper={},R.React))})(this,(function(R,w){"use strict";var M={exports:{}},F={};var te;function
|
|
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
|
+
(function(R,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],w):(R=typeof globalThis<"u"?globalThis:R||self,w(R.ViewGateWrapper={},R.React))})(this,(function(R,w){"use strict";var M={exports:{}},F={};var te;function je(){if(te)return F;te=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var o=null;if(a!==void 0&&(o=""+a),s.key!==void 0&&(o=""+s.key),"key"in s){a={};for(var c in s)c!=="key"&&(a[c]=s[c])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:o,ref:s!==void 0?s:null,props:a}}return F.Fragment=t,F.jsx=r,F.jsxs=r,F}var L={};var re;function Ae(){return re||(re=1,process.env.NODE_ENV!=="production"&&(function(){function e(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===At?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case P:return"Fragment";case J:return"Profiler";case I:return"StrictMode";case T:return"Suspense";case D:return"SuspenseList";case jt:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case W:return"Portal";case S:return i.displayName||"Context";case X:return(i._context.displayName||"Context")+".Consumer";case y:var u=i.render;return i=i.displayName,i||(i=u.displayName||u.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case z:return u=i.displayName||null,u!==null?u:e(i.type)||"Memo";case Z:u=i._payload,i=i._init;try{return e(i(u))}catch{}}return null}function t(i){return""+i}function r(i){try{t(i);var u=!1}catch{u=!0}if(u){u=console;var h=u.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return h.call(u,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),t(i)}}function n(i){if(i===P)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===Z)return"<...>";try{var u=e(i);return u?"<"+u+">":"<...>"}catch{return"<...>"}}function s(){var i=q.A;return i===null?null:i.getOwner()}function a(){return Error("react-stack-top-frame")}function o(i){if(Re.call(i,"key")){var u=Object.getOwnPropertyDescriptor(i,"key").get;if(u&&u.isReactWarning)return!1}return i.key!==void 0}function c(i,u){function h(){Ce||(Ce=!0,console.error("%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)",u))}h.isReactWarning=!0,Object.defineProperty(i,"key",{get:h,configurable:!0})}function l(){var i=e(this.type);return Te[i]||(Te[i]=!0,console.error("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.")),i=this.props.ref,i!==void 0?i:null}function m(i,u,h,g,U,K){var p=h.ref;return i={$$typeof:O,type:i,key:u,props:h,_owner:g},(p!==void 0?p:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:l}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function d(i,u,h,g,U,K){var p=u.children;if(p!==void 0)if(g)if(Ft(p)){for(g=0;g<p.length;g++)x(p[g]);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x(p);if(Re.call(u,"key")){p=e(i);var A=Object.keys(u).filter(function(Lt){return Lt!=="key"});g=0<A.length?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}",_e[p+g]||(A=0<A.length?"{"+A.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
3
3
|
let props = %s;
|
|
4
4
|
<%s {...props} />
|
|
5
5
|
React keys must be passed directly to JSX without using spread:
|
|
6
6
|
let props = %s;
|
|
7
|
-
<%s key={someKey} {...props} />`,g,p,A,p),Pe[p+g]=!0)}if(p=null,m!==void 0&&(r(m),p=""+m),o(u)&&(r(u.key),p=""+u.key),"key"in u){m={};for(var ee in u)ee!=="key"&&(m[ee]=u[ee])}else m=u;return p&&c(m,typeof i=="function"?i.displayName||i.name||"Unknown":i),h(i,p,m,s(),z,K)}function v(i){S(i)?i._store&&(i._store.validated=1):typeof i=="object"&&i!==null&&i.$$typeof===q&&(i._payload.status==="fulfilled"?S(i._payload.value)&&i._payload.value._store&&(i._payload.value._store.validated=1):i._store&&(i._store.validated=1))}function S(i){return typeof i=="object"&&i!==null&&i.$$typeof===L}var k=w,L=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),E=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Pt=Symbol.for("react.activity"),_t=Symbol.for("react.client.reference"),Z=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se=Object.prototype.hasOwnProperty,jt=Array.isArray,Q=console.createTask?console.createTask:function(){return null};k={react_stack_bottom_frame:function(i){return i()}};var Re,Ce={},Te=k.react_stack_bottom_frame.bind(k,a)(),ke=Q(n(a)),Pe={};O.Fragment=P,O.jsx=function(i,u,m){var g=1e4>Z.recentlyCreatedOwnerStacks++;return d(i,u,m,!1,g?Error("react-stack-top-frame"):Te,g?Q(n(i)):ke)},O.jsxs=function(i,u,m){var g=1e4>Z.recentlyCreatedOwnerStacks++;return d(i,u,m,!0,g?Error("react-stack-top-frame"):Te,g?Q(n(i)):ke)}})()),O}var ne;function Ae(){return ne||(ne=1,process.env.NODE_ENV==="production"?M.exports=_e():M.exports=je()),M.exports}var f=Ae();const Fe={en:{enterMode:"🚀 Enter Feedback Mode",exitMode:"✨ Exit Mode",feedbackHeader:"Feedback",selectedElement:"Selected element:",line:"Line",placeholder:"Tell us what you'd like to change...",cancel:"Cancel",send:"Send Feedback",submitting:"Submitting...",success:"Your feedback has been submitted successfully!",error:"Failed to submit feedback. Check backend connection.",successHeader:"Success",errorHeader:"Error",preview:"Preview"},es:{enterMode:"🚀 Activar Modo Comentarios",exitMode:"✨ Salir del Modo",feedbackHeader:"Comentarios",selectedElement:"Elemento seleccionado:",line:"Línea",placeholder:"Cuéntanos qué te gustaría cambiar...",cancel:"Cancelar",send:"Enviar Comentarios",submitting:"Enviando...",success:"¡Tus comentarios se han enviado con éxito!",error:"Error al enviar comentarios. Revisa la conexión con el servidor.",successHeader:"Éxito",errorHeader:"Error",preview:"Vista previa"}},se=w.createContext(void 0),ae=()=>{const e=w.useContext(se);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Oe=({children:e,language:t="es",apiKey:r})=>{const[n,s]=w.useState([]),a=(c,l)=>{const h=Date.now();s(d=>[...d,{id:h,message:c,type:l}]),setTimeout(()=>{s(d=>d.filter(v=>v.id!==h))},4e3)},o=Fe[t];return f.jsxs(se.Provider,{value:{addToast:a,language:t,t:o,apiKey:r},children:[e,f.jsx(Ee,{}),f.jsx("div",{className:"vg-toasts",children:n.map(c=>f.jsxs("div",{className:`vg-toast vg-glassmorphism vg-animate-slide ${c.type}`,children:[f.jsx("span",{style:{fontSize:"20px"},children:c.type==="success"?"✅":"❌"}),f.jsxs("div",{children:[f.jsx("strong",{style:{display:"block"},children:c.type==="success"?o.successHeader:o.errorHeader}),f.jsx("span",{style:{fontSize:"14px"},children:c.message})]})]},c.id))})]})};function Le(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),s=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(s),t&&(n.href=t),s.href=e,s.href}const Ie=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function C(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let _=null;function ie(e={}){return _||(e.includeStyleProperties?(_=e.includeStyleProperties,_):(_=C(window.getComputedStyle(document.documentElement)),_))}function V(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function De(e){const t=V(e,"border-left-width"),r=V(e,"border-right-width");return e.clientWidth+t+r}function Me(e){const t=V(e,"border-top-width"),r=V(e,"border-bottom-width");return e.clientHeight+t+r}function oe(e,t={}){const r=t.width||De(e),n=t.height||Me(e);return{width:r,height:n}}function Ve(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const x=16384;function $e(e){(e.width>x||e.height>x)&&(e.width>x&&e.height>x?e.width>e.height?(e.height*=x/e.width,e.width=x):(e.width*=x/e.height,e.height=x):e.width>x?(e.height*=x/e.width,e.width=x):(e.width*=x/e.height,e.height=x))}function $(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function He(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ue(e,t,r){const n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${r}`),s.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),s.appendChild(a),a.appendChild(e),He(s)}const b=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||b(r,t)};function We(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ze(e,t){return ie(t).map(r=>{const n=e.getPropertyValue(r),s=e.getPropertyPriority(r);return`${r}: ${n}${s?" !important":""};`}).join(" ")}function Ge(e,t,r,n){const s=`.${e}:${t}`,a=r.cssText?We(r):ze(r,n);return document.createTextNode(`${s}{${a}}`)}function ce(e,t,r,n){const s=window.getComputedStyle(e,r),a=s.getPropertyValue("content");if(a===""||a==="none")return;const o=Ie();try{t.className=`${t.className} ${o}`}catch{return}const c=document.createElement("style");c.appendChild(Ge(o,r,s,n)),t.appendChild(c)}function Ye(e,t,r){ce(e,t,":before",r),ce(e,t,":after",r)}const le="application/font-woff",ue="image/jpeg",Ne={woff:le,woff2:le,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ue,jpeg:ue,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Be(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function G(e){const t=Be(e).toLowerCase();return Ne[t]||""}function Je(e){return e.split(/,/)[1]}function Y(e){return e.search(/^(data:)/)!==-1}function Xe(e,t){return`data:${t};base64,${e}`}async function fe(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const s=await n.blob();return new Promise((a,o)=>{const c=new FileReader;c.onerror=o,c.onloadend=()=>{try{a(r({res:n,result:c.result}))}catch(l){o(l)}},c.readAsDataURL(s)})}const N={};function qe(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function B(e,t,r){const n=qe(e,t,r.includeQueryParams);if(N[n]!=null)return N[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await fe(e,r.fetchRequestInit,({res:o,result:c})=>(t||(t=o.headers.get("Content-Type")||""),Je(c)));s=Xe(a,t)}catch(a){s=r.imagePlaceholder||"";let o=`Failed to fetch resource: ${e}`;a&&(o=typeof a=="string"?a:a.message),o&&console.warn(o)}return N[n]=s,s}async function Ze(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):$(t)}async function Qe(e,t){if(e.currentSrc){const a=document.createElement("canvas"),o=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,o?.drawImage(e,0,0,a.width,a.height);const c=a.toDataURL();return $(c)}const r=e.poster,n=G(r),s=await B(r,n,t);return $(s)}async function Ke(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await H(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function et(e,t){return b(e,HTMLCanvasElement)?Ze(e):b(e,HTMLVideoElement)?Qe(e,t):b(e,HTMLIFrameElement)?Ke(e,t):e.cloneNode(de(e))}const tt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",de=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function rt(e,t,r){var n,s;if(de(t))return t;let a=[];return tt(e)&&e.assignedNodes?a=C(e.assignedNodes()):b(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=C(e.contentDocument.body.childNodes):a=C(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||b(e,HTMLVideoElement)||await a.reduce((o,c)=>o.then(()=>H(c,r)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function nt(e,t,r){const n=t.style;if(!n)return;const s=window.getComputedStyle(e);s.cssText?(n.cssText=s.cssText,n.transformOrigin=s.transformOrigin):ie(r).forEach(a=>{let o=s.getPropertyValue(a);a==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),b(e,HTMLIFrameElement)&&a==="display"&&o==="inline"&&(o="block"),a==="d"&&t.getAttribute("d")&&(o=`path(${t.getAttribute("d")})`),n.setProperty(a,o,s.getPropertyPriority(a))})}function st(e,t){b(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),b(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function at(e,t){if(b(e,HTMLSelectElement)){const n=Array.from(t.children).find(s=>e.value===s.getAttribute("value"));n&&n.setAttribute("selected","")}}function it(e,t,r){return b(t,Element)&&(nt(e,t,r),Ye(e,t,r),st(e,t),at(e,t)),t}async function ot(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let a=0;a<r.length;a++){const c=r[a].getAttribute("xlink:href");if(c){const l=e.querySelector(c),h=document.querySelector(c);!l&&h&&!n[c]&&(n[c]=await H(h,t,!0))}}const s=Object.values(n);if(s.length){const a="http://www.w3.org/1999/xhtml",o=document.createElementNS(a,"svg");o.setAttribute("xmlns",a),o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.overflow="hidden",o.style.display="none";const c=document.createElementNS(a,"defs");o.appendChild(c);for(let l=0;l<s.length;l++)c.appendChild(s[l]);e.appendChild(o)}return e}async function H(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>et(n,t)).then(n=>rt(e,n,t)).then(n=>it(e,n,t)).then(n=>ot(n,t))}const me=/url\((['"]?)([^'"]+?)\1\)/g,ct=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ut(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function ft(e){const t=[];return e.replace(me,(r,n,s)=>(t.push(s),r)),t.filter(r=>!Y(r))}async function dt(e,t,r,n,s){try{const a=r?Le(t,r):t,o=G(t);let c;return s||(c=await B(a,o,n)),e.replace(ut(t),`$1${c}$3`)}catch{}return e}function mt(e,{preferredFontFormat:t}){return t?e.replace(lt,r=>{for(;;){const[n,,s]=ct.exec(r)||[];if(!s)return"";if(s===t)return`src: ${n};`}}):e}function he(e){return e.search(me)!==-1}async function ge(e,t,r){if(!he(e))return e;const n=mt(e,r);return ft(n).reduce((a,o)=>a.then(c=>dt(c,o,t,r)),Promise.resolve(n))}async function j(e,t,r){var n;const s=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(s){const a=await ge(s,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function ht(e,t){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)}async function gt(e,t){const r=b(e,HTMLImageElement);if(!(r&&!Y(e.src))&&!(b(e,SVGImageElement)&&!Y(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,s=await B(n,G(n),t);await new Promise((a,o)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...l)=>{try{a(t.onImageErrorHandler(...l))}catch(h){o(h)}}:o;const c=e;c.decode&&(c.decode=a),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=s):e.href.baseVal=s})}async function pt(e,t){const n=C(e.childNodes).map(s=>pe(s,t));await Promise.all(n).then(()=>e)}async function pe(e,t){b(e,Element)&&(await ht(e,t),await gt(e,t),await pt(e,t))}function yt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(s=>{r[s]=n[s]}),e}const ye={};async function we(e){let t=ye[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ye[e]=t,t}async function be(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async o=>{let c=o.replace(n,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),fe(c,t.fetchRequestInit,({result:l})=>(r=r.replace(o,`url(${l})`),[o,l]))});return Promise.all(a).then(()=>r)}function xe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=s.exec(n);if(l===null)break;t.push(l[0])}n=n.replace(s,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(o,"gi");for(;;){let l=a.exec(n);if(l===null){if(l=c.exec(n),l===null)break;a.lastIndex=c.lastIndex}else c.lastIndex=a.lastIndex;t.push(l[0])}return t}async function wt(e,t){const r=[],n=[];return e.forEach(s=>{if("cssRules"in s)try{C(s.cssRules||[]).forEach((a,o)=>{if(a.type===CSSRule.IMPORT_RULE){let c=o+1;const l=a.href,h=we(l).then(d=>be(d,t)).then(d=>xe(d).forEach(v=>{try{s.insertRule(v,v.startsWith("@import")?c+=1:s.cssRules.length)}catch(S){console.error("Error inserting rule from remote css",{rule:v,error:S})}})).catch(d=>{console.error("Error loading remote css",d.toString())});n.push(h)}})}catch(a){const o=e.find(c=>c.href==null)||document.styleSheets[0];s.href!=null&&n.push(we(s.href).then(c=>be(c,t)).then(c=>xe(c).forEach(l=>{o.insertRule(l,o.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(s=>{if("cssRules"in s)try{C(s.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),r))}function bt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>he(t.style.getPropertyValue("src")))}async function xt(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=C(e.ownerDocument.styleSheets),n=await wt(r,t);return bt(n)}function ve(e){return e.trim().replace(/["']/g,"")}function vt(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(ve(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function Et(e,t){const r=await xt(e,t),n=vt(e);return(await Promise.all(r.filter(a=>n.has(ve(a.style.fontFamily))).map(a=>{const o=a.parentStyleSheet?a.parentStyleSheet.href:null;return ge(a.cssText,o,t)}))).join(`
|
|
8
|
-
`)}async function
|
|
9
|
-
`).map((s,a)=>{const o=a+1,c=d=>d.replace(/\\/g,"/"),l=c(t).replace(c(process.cwd()),"");return s.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n>])/g,(d,
|
|
10
|
-
`),map:null}}}}
|
|
7
|
+
<%s key={someKey} {...props} />`,g,p,A,p),_e[p+g]=!0)}if(p=null,h!==void 0&&(r(h),p=""+h),o(u)&&(r(u.key),p=""+u.key),"key"in u){h={};for(var ee in u)ee!=="key"&&(h[ee]=u[ee])}else h=u;return p&&c(h,typeof i=="function"?i.displayName||i.name||"Unknown":i),m(i,p,h,s(),U,K)}function x(i){b(i)?i._store&&(i._store.validated=1):typeof i=="object"&&i!==null&&i.$$typeof===Z&&(i._payload.status==="fulfilled"?b(i._payload.value)&&i._payload.value._store&&(i._payload.value._store.validated=1):i._store&&(i._store.validated=1))}function b(i){return typeof i=="object"&&i!==null&&i.$$typeof===O}var k=w,O=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),S=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),jt=Symbol.for("react.activity"),At=Symbol.for("react.client.reference"),q=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Re=Object.prototype.hasOwnProperty,Ft=Array.isArray,Q=console.createTask?console.createTask:function(){return null};k={react_stack_bottom_frame:function(i){return i()}};var Ce,Te={},ke=k.react_stack_bottom_frame.bind(k,a)(),Pe=Q(n(a)),_e={};L.Fragment=P,L.jsx=function(i,u,h){var g=1e4>q.recentlyCreatedOwnerStacks++;return d(i,u,h,!1,g?Error("react-stack-top-frame"):ke,g?Q(n(i)):Pe)},L.jsxs=function(i,u,h){var g=1e4>q.recentlyCreatedOwnerStacks++;return d(i,u,h,!0,g?Error("react-stack-top-frame"):ke,g?Q(n(i)):Pe)}})()),L}var ne;function Fe(){return ne||(ne=1,process.env.NODE_ENV==="production"?M.exports=je():M.exports=Ae()),M.exports}var f=Fe();const Le={en:{enterMode:"🚀 Enter Feedback Mode",exitMode:"✨ Exit Mode",feedbackHeader:"Feedback",selectedElement:"Selected element:",line:"Line",placeholder:"Tell us what you'd like to change...",cancel:"Cancel",send:"Send Feedback",submitting:"Submitting...",success:"Your feedback has been submitted successfully!",error:"Failed to submit feedback. Check backend connection.",successHeader:"Success",errorHeader:"Error",preview:"Preview"},es:{enterMode:"🚀 Activar Modo Comentarios",exitMode:"✨ Salir del Modo",feedbackHeader:"Comentarios",selectedElement:"Elemento seleccionado:",line:"Línea",placeholder:"Cuéntanos qué te gustaría cambiar...",cancel:"Cancelar",send:"Enviar Comentarios",submitting:"Enviando...",success:"¡Tus comentarios se han enviado con éxito!",error:"Error al enviar comentarios. Revisa la conexión con el servidor.",successHeader:"Éxito",errorHeader:"Error",preview:"Vista previa"}},se=w.createContext(void 0),ae=()=>{const e=w.useContext(se);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Oe=({children:e,language:t="es",apiKey:r})=>{const[n,s]=w.useState([]),a=(c,l)=>{const m=Date.now();s(d=>[...d,{id:m,message:c,type:l}]),setTimeout(()=>{s(d=>d.filter(x=>x.id!==m))},4e3)},o=Le[t];return f.jsxs(se.Provider,{value:{addToast:a,language:t,t:o,apiKey:r},children:[e,f.jsx(Ee,{}),f.jsx("div",{className:"vg-toasts",children:n.map(c=>f.jsxs("div",{className:`vg-toast vg-glassmorphism vg-animate-slide ${c.type}`,children:[f.jsx("span",{style:{fontSize:"20px"},children:c.type==="success"?"✅":"❌"}),f.jsxs("div",{children:[f.jsx("strong",{style:{display:"block"},children:c.type==="success"?o.successHeader:o.errorHeader}),f.jsx("span",{style:{fontSize:"14px"},children:c.message})]})]},c.id))})]})};function Ie(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),s=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(s),t&&(n.href=t),s.href=e,s.href}const De=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function C(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let _=null;function ie(e={}){return _||(e.includeStyleProperties?(_=e.includeStyleProperties,_):(_=C(window.getComputedStyle(document.documentElement)),_))}function $(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function Me(e){const t=$(e,"border-left-width"),r=$(e,"border-right-width");return e.clientWidth+t+r}function $e(e){const t=$(e,"border-top-width"),r=$(e,"border-bottom-width");return e.clientHeight+t+r}function oe(e,t={}){const r=t.width||Me(e),n=t.height||$e(e);return{width:r,height:n}}function Ve(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const E=16384;function He(e){(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))}function V(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function We(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ze(e,t,r){const n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${r}`),s.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),s.appendChild(a),a.appendChild(e),We(s)}const v=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||v(r,t)};function Ue(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ge(e,t){return ie(t).map(r=>{const n=e.getPropertyValue(r),s=e.getPropertyPriority(r);return`${r}: ${n}${s?" !important":""};`}).join(" ")}function Ye(e,t,r,n){const s=`.${e}:${t}`,a=r.cssText?Ue(r):Ge(r,n);return document.createTextNode(`${s}{${a}}`)}function ce(e,t,r,n){const s=window.getComputedStyle(e,r),a=s.getPropertyValue("content");if(a===""||a==="none")return;const o=De();try{t.className=`${t.className} ${o}`}catch{return}const c=document.createElement("style");c.appendChild(Ye(o,r,s,n)),t.appendChild(c)}function Ne(e,t,r){ce(e,t,":before",r),ce(e,t,":after",r)}const le="application/font-woff",ue="image/jpeg",Be={woff:le,woff2:le,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ue,jpeg:ue,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Je(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function G(e){const t=Je(e).toLowerCase();return Be[t]||""}function Xe(e){return e.split(/,/)[1]}function Y(e){return e.search(/^(data:)/)!==-1}function Ze(e,t){return`data:${t};base64,${e}`}async function fe(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const s=await n.blob();return new Promise((a,o)=>{const c=new FileReader;c.onerror=o,c.onloadend=()=>{try{a(r({res:n,result:c.result}))}catch(l){o(l)}},c.readAsDataURL(s)})}const N={};function qe(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function B(e,t,r){const n=qe(e,t,r.includeQueryParams);if(N[n]!=null)return N[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await fe(e,r.fetchRequestInit,({res:o,result:c})=>(t||(t=o.headers.get("Content-Type")||""),Xe(c)));s=Ze(a,t)}catch(a){s=r.imagePlaceholder||"";let o=`Failed to fetch resource: ${e}`;a&&(o=typeof a=="string"?a:a.message),o&&console.warn(o)}return N[n]=s,s}async function Qe(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):V(t)}async function Ke(e,t){if(e.currentSrc){const a=document.createElement("canvas"),o=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,o?.drawImage(e,0,0,a.width,a.height);const c=a.toDataURL();return V(c)}const r=e.poster,n=G(r),s=await B(r,n,t);return V(s)}async function et(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await H(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function tt(e,t){return v(e,HTMLCanvasElement)?Qe(e):v(e,HTMLVideoElement)?Ke(e,t):v(e,HTMLIFrameElement)?et(e,t):e.cloneNode(de(e))}const rt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",de=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nt(e,t,r){var n,s;if(de(t))return t;let a=[];return rt(e)&&e.assignedNodes?a=C(e.assignedNodes()):v(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=C(e.contentDocument.body.childNodes):a=C(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||v(e,HTMLVideoElement)||await a.reduce((o,c)=>o.then(()=>H(c,r)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function st(e,t,r){const n=t.style;if(!n)return;const s=window.getComputedStyle(e);s.cssText?(n.cssText=s.cssText,n.transformOrigin=s.transformOrigin):ie(r).forEach(a=>{let o=s.getPropertyValue(a);a==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),v(e,HTMLIFrameElement)&&a==="display"&&o==="inline"&&(o="block"),a==="d"&&t.getAttribute("d")&&(o=`path(${t.getAttribute("d")})`),n.setProperty(a,o,s.getPropertyPriority(a))})}function at(e,t){v(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),v(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function it(e,t){if(v(e,HTMLSelectElement)){const n=Array.from(t.children).find(s=>e.value===s.getAttribute("value"));n&&n.setAttribute("selected","")}}function ot(e,t,r){return v(t,Element)&&(st(e,t,r),Ne(e,t,r),at(e,t),it(e,t)),t}async function ct(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let a=0;a<r.length;a++){const c=r[a].getAttribute("xlink:href");if(c){const l=e.querySelector(c),m=document.querySelector(c);!l&&m&&!n[c]&&(n[c]=await H(m,t,!0))}}const s=Object.values(n);if(s.length){const a="http://www.w3.org/1999/xhtml",o=document.createElementNS(a,"svg");o.setAttribute("xmlns",a),o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.overflow="hidden",o.style.display="none";const c=document.createElementNS(a,"defs");o.appendChild(c);for(let l=0;l<s.length;l++)c.appendChild(s[l]);e.appendChild(o)}return e}async function H(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>tt(n,t)).then(n=>nt(e,n,t)).then(n=>ot(e,n,t)).then(n=>ct(n,t))}const me=/url\((['"]?)([^'"]+?)\1\)/g,lt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ut=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ft(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function dt(e){const t=[];return e.replace(me,(r,n,s)=>(t.push(s),r)),t.filter(r=>!Y(r))}async function mt(e,t,r,n,s){try{const a=r?Ie(t,r):t,o=G(t);let c;return s||(c=await B(a,o,n)),e.replace(ft(t),`$1${c}$3`)}catch{}return e}function ht(e,{preferredFontFormat:t}){return t?e.replace(ut,r=>{for(;;){const[n,,s]=lt.exec(r)||[];if(!s)return"";if(s===t)return`src: ${n};`}}):e}function he(e){return e.search(me)!==-1}async function ge(e,t,r){if(!he(e))return e;const n=ht(e,r);return dt(n).reduce((a,o)=>a.then(c=>mt(c,o,t,r)),Promise.resolve(n))}async function j(e,t,r){var n;const s=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(s){const a=await ge(s,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function gt(e,t){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)}async function pt(e,t){const r=v(e,HTMLImageElement);if(!(r&&!Y(e.src))&&!(v(e,SVGImageElement)&&!Y(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,s=await B(n,G(n),t);await new Promise((a,o)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...l)=>{try{a(t.onImageErrorHandler(...l))}catch(m){o(m)}}:o;const c=e;c.decode&&(c.decode=a),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=s):e.href.baseVal=s})}async function yt(e,t){const n=C(e.childNodes).map(s=>pe(s,t));await Promise.all(n).then(()=>e)}async function pe(e,t){v(e,Element)&&(await gt(e,t),await pt(e,t),await yt(e,t))}function wt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(s=>{r[s]=n[s]}),e}const ye={};async function we(e){let t=ye[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ye[e]=t,t}async function be(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async o=>{let c=o.replace(n,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),fe(c,t.fetchRequestInit,({result:l})=>(r=r.replace(o,`url(${l})`),[o,l]))});return Promise.all(a).then(()=>r)}function xe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=s.exec(n);if(l===null)break;t.push(l[0])}n=n.replace(s,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(o,"gi");for(;;){let l=a.exec(n);if(l===null){if(l=c.exec(n),l===null)break;a.lastIndex=c.lastIndex}else c.lastIndex=a.lastIndex;t.push(l[0])}return t}async function bt(e,t){const r=[],n=[];return e.forEach(s=>{if("cssRules"in s)try{C(s.cssRules||[]).forEach((a,o)=>{if(a.type===CSSRule.IMPORT_RULE){let c=o+1;const l=a.href,m=we(l).then(d=>be(d,t)).then(d=>xe(d).forEach(x=>{try{s.insertRule(x,x.startsWith("@import")?c+=1:s.cssRules.length)}catch(b){console.error("Error inserting rule from remote css",{rule:x,error:b})}})).catch(d=>{console.error("Error loading remote css",d.toString())});n.push(m)}})}catch(a){const o=e.find(c=>c.href==null)||document.styleSheets[0];s.href!=null&&n.push(we(s.href).then(c=>be(c,t)).then(c=>xe(c).forEach(l=>{o.insertRule(l,o.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(s=>{if("cssRules"in s)try{C(s.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),r))}function xt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>he(t.style.getPropertyValue("src")))}async function vt(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=C(e.ownerDocument.styleSheets),n=await bt(r,t);return xt(n)}function ve(e){return e.trim().replace(/["']/g,"")}function Et(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(ve(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function St(e,t){const r=await vt(e,t),n=Et(e);return(await Promise.all(r.filter(a=>n.has(ve(a.style.fontFamily))).map(a=>{const o=a.parentStyleSheet?a.parentStyleSheet.href:null;return ge(a.cssText,o,t)}))).join(`
|
|
8
|
+
`)}async function Rt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await St(e,t);if(r){const n=document.createElement("style"),s=document.createTextNode(r);n.appendChild(s),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function Ct(e,t={}){const{width:r,height:n}=oe(e,t),s=await H(e,t,!0);return await Rt(s,t),await pe(s,t),wt(s,t),await ze(s,r,n)}async function Tt(e,t={}){const{width:r,height:n}=oe(e,t),s=await Ct(e,t),a=await V(s),o=document.createElement("canvas"),c=o.getContext("2d"),l=t.pixelRatio||Ve(),m=t.canvasWidth||r,d=t.canvasHeight||n;return o.width=m*l,o.height=d*l,t.skipAutoScale||He(o),o.style.width=`${m}`,o.style.height=`${d}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,o.width,o.height)),c.drawImage(a,0,0,o.width,o.height),o}async function kt(e,t={}){return(await Tt(e,t)).toDataURL()}const Ee=()=>{const{addToast:e,language:t,t:r,apiKey:n}=ae(),[s,a]=w.useState(!1),[o,c]=w.useState(null),[l,m]=w.useState(null),[d,x]=w.useState(""),[b,k]=w.useState(!1),[O,W]=w.useState(!1),P=w.useCallback(S=>{if(!s||l)return;const y=document.elementFromPoint(S.clientX,S.clientY);if(!y||y.id==="viewgate-overlay"||y.closest("#viewgate-ui")){c(null);return}const T=y.getAttribute("data-source-path")||"unknown:0";c({tag:y.tagName.toLowerCase(),source:T,rect:y.getBoundingClientRect(),element:y,previewText:y.innerText.slice(0,100)||y.getAttribute("placeholder")?.slice(0,100)||y.tagName.toLowerCase()})},[s,l]),I=w.useCallback(async S=>{if(!(!s||l)&&o){S.preventDefault(),S.stopPropagation(),W(!0);try{const y=o.element.style.display,T=window.getComputedStyle(o.element).display==="inline";T&&(o.element.style.display="inline-block");const D=await kt(o.element,{backgroundColor:"#ffffff",pixelRatio:2,skipFonts:!0,style:{margin:"0",padding:"4px"}});T&&(o.element.style.display=y),m({...o,visualPreview:D})}catch(y){console.error("Failed to capture preview:",y),m(o)}finally{W(!1),c(null)}}},[s,o,l]);w.useEffect(()=>(s&&!l?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("mousemove",P),window.addEventListener("click",I,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("mousemove",P),window.removeEventListener("click",I,!0)}),[s,l,P,I]);const J=async()=>{if(!l||!d.trim())return;k(!0);const S=l.source||"unknown:0",[y,T]=S.split(":"),D=T||"0";try{if(!(await fetch("https://view-gate.vercel.app/api/annotations",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({filePath:y,line:parseInt(D),url:window.location.href,message:d,componentName:l.tag})})).ok)throw new Error("Backend failed");e(r.success,"success"),m(null),x(""),a(!1)}catch(z){console.error(z),e(r.error,"error")}finally{k(!1)}},X=S=>S.split("/").pop()?.split("\\").pop()||"unknown";return f.jsxs(f.Fragment,{children:[f.jsx("div",{style:{position:"fixed",bottom:"30px",right:"30px",zIndex:99999},id:"viewgate-ui",children:f.jsx("button",{onClick:()=>a(!s),className:"vg-button-primary",style:{padding:"12px 24px",fontSize:"15px"},children:s?r.exitMode:r.enterMode})}),O&&f.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e5,cursor:"wait"},children:f.jsx("div",{className:"vg-glassmorphism",style:{padding:"20px 40px",fontWeight:700},children:"Capturing..."})}),s&&o&&!l&&!O&&f.jsx("div",{style:{position:"fixed",top:o.rect.top,left:o.rect.left,width:o.rect.width,height:o.rect.height,border:"2px solid var(--vg-primary)",backgroundColor:"rgba(37, 19, 236, 0.05)",pointerEvents:"none",zIndex:99998,borderRadius:"4px",boxShadow:"0 0 15px rgba(37, 19, 236, 0.2)",transition:"all 0.1s ease-out"}}),l&&f.jsx("div",{className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999},children:f.jsxs("div",{className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"460px",background:"white"},children:[f.jsx("h2",{style:{margin:"0 0 10px 0",fontSize:"24px",fontWeight:800},children:r.feedbackHeader}),f.jsxs("div",{style:{marginBottom:"20px"},children:[f.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"},children:[f.jsx("span",{className:"vg-badge",children:l.tag}),f.jsxs("span",{className:"vg-badge",style:{backgroundColor:"#fdf2f8",color:"#db2777",borderColor:"#fbcfe8"},children:["📄 ",X((l.source||"").split(":")[0])]}),f.jsxs("span",{className:"vg-badge",style:{opacity:.8},children:[r.line," ",(l.source||"unknown:0").split(":")[1]]})]}),f.jsxs("div",{style:{marginTop:"8px",fontSize:"11px",color:"#94a3b8"},children:["🌐 ",window.location.href]})]}),f.jsxs("div",{style:{backgroundColor:"#f8fafc",borderRadius:"8px",border:"1px solid #e2e8f0",marginBottom:"20px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[f.jsx("div",{style:{padding:"8px 12px",fontSize:"10px",color:"#94a3b8",textTransform:"uppercase",fontWeight:700,borderBottom:"1px solid #f1f5f9"},children:r.preview}),f.jsx("div",{style:{padding:"12px",display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60px",maxHeight:"150px",overflow:"hidden",backgroundColor:"white"},children:l.visualPreview?f.jsx("img",{src:l.visualPreview,alt:"Element Preview",style:{maxWidth:"100%",maxHeight:"120px",objectFit:"contain",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderRadius:"4px"}}):f.jsxs("div",{style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:['"',l.previewText,'"']})})]}),f.jsx("textarea",{className:"vg-textarea",value:d,onChange:S=>x(S.target.value),rows:4,placeholder:r.placeholder,autoFocus:!0}),f.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"24px"},children:[f.jsx("button",{onClick:()=>m(null),className:"vg-button-ghost",children:r.cancel}),f.jsx("button",{onClick:J,className:"vg-button-primary",disabled:b||!d.trim(),style:{opacity:b||!d.trim()?.6:1},children:b?r.submitting:r.send})]})]})})]})};function Pt(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules")?void 0:{code:e.split(`
|
|
9
|
+
`).map((s,a)=>{const o=a+1,c=d=>d.replace(/\\/g,"/"),l=c(t).replace(c(process.cwd()),"");return s.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n>])/g,(d,x,b)=>d.includes("data-source-path")||b==="Fragment"||b==="React.Fragment"?d:`${x}<${b} data-source-path="${l}:${o}"`)}).join(`
|
|
10
|
+
`),map:null}}}}function Se(e,t,r){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const n=c=>c.replace(/\\/g,"/"),s=n(t).replace(n(r),"");return e.split(`
|
|
11
|
+
`).map((c,l)=>{const m=l+1;return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n>])/g,(d,x,b)=>d.includes("data-source-path")||b==="Fragment"||b==="React.Fragment"?d:`${x}<${b} data-source-path="${s}:${m}"`)}).join(`
|
|
12
|
+
`)}function _t(e){const t=this.resourcePath;return t?Se(e,t,process.cwd()):e}R.ViewGate=Oe,R.ViewGateOverlay=Ee,R.transformSourcePaths=Se,R.useViewGate=ae,R.viewgateNextLoader=_t,R.viewgatePlugin=Pt,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viewgate-wrapper",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/viewgate-wrapper.umd.cjs",
|
|
6
6
|
"module": "./dist/viewgate-wrapper.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"dev": "vite",
|
|
26
|
-
"build": "vite build && tsc --emitDeclarationOnly && npx tsc src/cli.ts --outDir dist --module nodenext --target esnext --moduleResolution nodenext --esModuleInterop --skipLibCheck --rootDir src && cd mcp-server && npm run build",
|
|
26
|
+
"build": "vite build && tsc --emitDeclarationOnly && npx tsc src/cli.ts --outDir dist --module nodenext --target esnext --moduleResolution nodenext --esModuleInterop --skipLibCheck --rootDir src && npx tsc src/plugin/transform-logic.ts src/plugin/vite-plugin-viewgate.ts src/plugin/next-loader.ts --outDir dist/plugin --module nodenext --target esnext --moduleResolution nodenext --esModuleInterop --skipLibCheck --rootDir src/plugin && cd mcp-server && npm run build",
|
|
27
27
|
"preview": "vite preview"
|
|
28
28
|
},
|
|
29
29
|
"keywords": [],
|