viewgate-wrapper 1.1.0 → 1.2.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.
@@ -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,EAiS7B,CAAC"}
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;AAqDhC,eAAO,MAAM,eAAe,EAAE,EA2S7B,CAAC"}
@@ -35,6 +35,16 @@ declare const translations: {
35
35
  preview: string;
36
36
  };
37
37
  };
38
+ export interface SemanticReference {
39
+ tag: string;
40
+ id: string;
41
+ classes: string;
42
+ text: string;
43
+ selector: string;
44
+ outerHtml: string;
45
+ parentContext: string;
46
+ source?: string;
47
+ }
38
48
  interface ViewGateContextType {
39
49
  addToast: (message: string, type: 'success' | 'error') => void;
40
50
  language: Language;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGateProvider.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,wBAAwB,CAAC;AAEhC,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCjB,CAAC;AAQF,UAAU,mBAAmB;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,KAAK,IAAI,CAAC;IAC/D,QAAQ,EAAE,QAAQ,CAAC;IACnB,CAAC,EAAE,OAAO,YAAY,CAAC,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,WAAW,2BAIvB,CAAC;AAEF,UAAU,aAAa;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA8BtC,CAAC"}
1
+ {"version":3,"file":"ViewGateProvider.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,wBAAwB,CAAC;AAEhC,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCjB,CAAC;AAQF,MAAM,WAAW,iBAAiB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,KAAK,IAAI,CAAC;IAC/D,QAAQ,EAAE,QAAQ,CAAC;IACnB,CAAC,EAAE,OAAO,YAAY,CAAC,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,WAAW,2BAIvB,CAAC;AAEF,UAAU,aAAa;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA8BtC,CAAC"}
@@ -1 +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"}
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,UAUnE"}
@@ -3,5 +3,9 @@ export default function viewgateNextLoader(source) {
3
3
  const id = this.resourcePath;
4
4
  if (!id)
5
5
  return source;
6
+ // Debug log to ensure loader is running
7
+ if (process.env.NODE_ENV === 'development') {
8
+ // console.log(`[ViewGate] Transforming: ${id}`);
9
+ }
6
10
  return transformSourcePaths(source, id, process.cwd());
7
11
  }
@@ -8,8 +8,8 @@ export function transformSourcePaths(code, id, cwd) {
8
8
  const lines = code.split('\n');
9
9
  const transformedLines = lines.map((line, index) => {
10
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) => {
11
+ // Regex to find JSX tags and inject data-source-path (handles self-closing tags)
12
+ return line.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g, (match, prefix, tagName) => {
13
13
  if (match.includes('data-source-path') || tagName === 'Fragment' || tagName === 'React.Fragment') {
14
14
  return match;
15
15
  }
@@ -1,14 +1,14 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap";:root{--vg-primary: #2513ec;--vg-primary-gradient: linear-gradient(135deg, #2513ec 0%, #7e3ff2 100%);--vg-glass: rgba(255, 255, 255, .7);--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow: 0 8px 32px 0 rgba(31, 38, 135, .37);--vg-radius: 16px}body{font-family:Inter,system-ui,-apple-system,sans-serif!important;margin:0}.vg-glassmorphism{background:var(--vg-glass);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--vg-glass-border);box-shadow:var(--vg-shadow);border-radius:var(--vg-radius)}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:10px 24px;border-radius:12px;font-weight:600;cursor:pointer;transition:transform .2s,box-shadow .2s;box-shadow:0 4px 12px #2513ec4d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 16px #2513ec66}.vg-button-ghost{background:transparent;color:#444;border:1px solid #ddd;padding:10px 24px;border-radius:12px;cursor:pointer;transition:background .2s}.vg-button-ghost:hover{background:#0000000d}.vg-badge{background:#2513ec1a;color:var(--vg-primary);padding:4px 12px;border-radius:20px;font-size:12px;font-family:JetBrains Mono,monospace;font-weight:700;border:1px solid rgba(37,19,236,.2)}.vg-textarea{width:100%;border:1.5px solid #eee;border-radius:12px;padding:12px;font-family:inherit;color:#0f172a;resize:none;transition:border-color .2s,box-shadow .2s;outline:none}.vg-textarea:focus{border-color:var(--vg-primary);box-shadow:0 0 0 4px #2513ec1a}@keyframes vg-slide-in{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes vg-fade-in{0%{opacity:0}to{opacity:1}}.vg-animate-slide{animation:vg-slide-in .3s cubic-bezier(.16,1,.3,1)}.vg-animate-fade{animation:vg-fade-in .2s ease-out}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px;z-index:100000}.vg-toast{padding:16px 24px;display:flex;align-items:center;gap:12px;min-width:300px}.vg-toast.success{background:#ecfdf5;border:1px solid #10b981;color:#065f46}.vg-toast.error{background:#fef2f2;border:1px solid #ef4444;color:#991b1b}.vg-cursor-pointer *{cursor:pointer!important}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import Ae, { createContext as $e, useState as k, useContext as Fe, useCallback as ie, useEffect as Le } from "react";
3
- var H = { exports: {} }, L = {};
4
- var oe;
2
+ import Ae, { createContext as $e, useState as k, useContext as Fe, useCallback as oe, useEffect as Le } from "react";
3
+ var V = { exports: {} }, L = {};
4
+ var ie;
5
5
  function Oe() {
6
- if (oe) return L;
7
- oe = 1;
6
+ if (ie) return L;
7
+ ie = 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 o = null;
11
- if (a !== void 0 && (o = "" + a), s.key !== void 0 && (o = "" + s.key), "key" in s) {
10
+ var i = null;
11
+ if (a !== void 0 && (i = "" + a), s.key !== void 0 && (i = "" + 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: o,
19
+ key: i,
20
20
  ref: s !== void 0 ? s : null,
21
21
  props: a
22
22
  };
@@ -27,12 +27,12 @@ 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(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) {
30
+ function e(o) {
31
+ if (o == null) return null;
32
+ if (typeof o == "function")
33
+ return o.$$typeof === Pe ? null : o.displayName || o.name || null;
34
+ if (typeof o == "string") return o;
35
+ switch (o) {
36
36
  case T:
37
37
  return "Fragment";
38
38
  case U:
@@ -46,127 +46,127 @@ function Ie() {
46
46
  case ke:
47
47
  return "Activity";
48
48
  }
49
- if (typeof i == "object")
50
- switch (typeof i.tag == "number" && console.error(
49
+ if (typeof o == "object")
50
+ switch (typeof o.tag == "number" && console.error(
51
51
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
52
- ), i.$$typeof) {
52
+ ), o.$$typeof) {
53
53
  case I:
54
54
  return "Portal";
55
55
  case v:
56
- return i.displayName || "Context";
57
- case Y:
58
- return (i._context.displayName || "Context") + ".Consumer";
56
+ return o.displayName || "Context";
57
+ case N:
58
+ return (o._context.displayName || "Context") + ".Consumer";
59
59
  case y:
60
- var u = i.render;
61
- return i = i.displayName, i || (i = u.displayName || u.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i;
60
+ var u = o.render;
61
+ return o = o.displayName, o || (o = u.displayName || u.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
62
62
  case D:
63
- return u = i.displayName || null, u !== null ? u : e(i.type) || "Memo";
64
- case G:
65
- u = i._payload, i = i._init;
63
+ return u = o.displayName || null, u !== null ? u : e(o.type) || "Memo";
64
+ case Y:
65
+ u = o._payload, o = o._init;
66
66
  try {
67
- return e(i(u));
67
+ return e(o(u));
68
68
  } catch {
69
69
  }
70
70
  }
71
71
  return null;
72
72
  }
73
- function t(i) {
74
- return "" + i;
73
+ function t(o) {
74
+ return "" + o;
75
75
  }
76
- function r(i) {
76
+ function r(o) {
77
77
  try {
78
- t(i);
78
+ t(o);
79
79
  var u = !1;
80
80
  } catch {
81
81
  u = !0;
82
82
  }
83
83
  if (u) {
84
84
  u = console;
85
- var h = u.error, g = typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object";
85
+ var h = u.error, g = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
86
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(i);
90
+ ), t(o);
91
91
  }
92
92
  }
93
- function n(i) {
94
- if (i === T) return "<>";
95
- if (typeof i == "object" && i !== null && i.$$typeof === G)
93
+ function n(o) {
94
+ if (o === T) return "<>";
95
+ if (typeof o == "object" && o !== null && o.$$typeof === Y)
96
96
  return "<...>";
97
97
  try {
98
- var u = e(i);
98
+ var u = e(o);
99
99
  return u ? "<" + u + ">" : "<...>";
100
100
  } catch {
101
101
  return "<...>";
102
102
  }
103
103
  }
104
104
  function s() {
105
- var i = N.A;
106
- return i === null ? null : i.getOwner();
105
+ var o = G.A;
106
+ return o === null ? null : o.getOwner();
107
107
  }
108
108
  function a() {
109
109
  return Error("react-stack-top-frame");
110
110
  }
111
- function o(i) {
112
- if (ee.call(i, "key")) {
113
- var u = Object.getOwnPropertyDescriptor(i, "key").get;
111
+ function i(o) {
112
+ if (ee.call(o, "key")) {
113
+ var u = Object.getOwnPropertyDescriptor(o, "key").get;
114
114
  if (u && u.isReactWarning) return !1;
115
115
  }
116
- return i.key !== void 0;
116
+ return o.key !== void 0;
117
117
  }
118
- function c(i, u) {
118
+ function c(o, u) {
119
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
- h.isReactWarning = !0, Object.defineProperty(i, "key", {
125
+ h.isReactWarning = !0, Object.defineProperty(o, "key", {
126
126
  get: h,
127
127
  configurable: !0
128
128
  });
129
129
  }
130
130
  function l() {
131
- var i = e(this.type);
132
- return re[i] || (re[i] = !0, console.error(
131
+ var o = e(this.type);
132
+ return re[o] || (re[o] = !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
- )), i = this.props.ref, i !== void 0 ? i : null;
134
+ )), o = this.props.ref, o !== void 0 ? o : null;
135
135
  }
136
- function m(i, u, h, g, M, B) {
136
+ function m(o, u, h, g, M, B) {
137
137
  var p = h.ref;
138
- return i = {
138
+ return o = {
139
139
  $$typeof: A,
140
- type: i,
140
+ type: o,
141
141
  key: u,
142
142
  props: h,
143
143
  _owner: g
144
- }, (p !== void 0 ? p : null) !== null ? Object.defineProperty(i, "ref", {
144
+ }, (p !== void 0 ? p : null) !== null ? Object.defineProperty(o, "ref", {
145
145
  enumerable: !1,
146
146
  get: l
147
- }) : Object.defineProperty(i, "ref", { enumerable: !1, value: null }), i._store = {}, Object.defineProperty(i._store, "validated", {
147
+ }) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
148
148
  configurable: !1,
149
149
  enumerable: !1,
150
150
  writable: !0,
151
151
  value: 0
152
- }), Object.defineProperty(i, "_debugInfo", {
152
+ }), Object.defineProperty(o, "_debugInfo", {
153
153
  configurable: !1,
154
154
  enumerable: !1,
155
155
  writable: !0,
156
156
  value: null
157
- }), Object.defineProperty(i, "_debugStack", {
157
+ }), Object.defineProperty(o, "_debugStack", {
158
158
  configurable: !1,
159
159
  enumerable: !1,
160
160
  writable: !0,
161
161
  value: M
162
- }), Object.defineProperty(i, "_debugTask", {
162
+ }), Object.defineProperty(o, "_debugTask", {
163
163
  configurable: !1,
164
164
  enumerable: !1,
165
165
  writable: !0,
166
166
  value: B
167
- }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
167
+ }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
168
168
  }
169
- function d(i, u, h, g, M, B) {
169
+ function d(o, u, h, g, M, B) {
170
170
  var p = u.children;
171
171
  if (p !== void 0)
172
172
  if (g)
@@ -180,7 +180,7 @@ function Ie() {
180
180
  );
181
181
  else x(p);
182
182
  if (ee.call(u, "key")) {
183
- p = e(i);
183
+ p = e(o);
184
184
  var P = Object.keys(u).filter(function(je) {
185
185
  return je !== "key";
186
186
  });
@@ -197,16 +197,16 @@ 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, h !== void 0 && (r(h), p = "" + h), o(u) && (r(u.key), p = "" + u.key), "key" in u) {
200
+ if (p = null, h !== void 0 && (r(h), p = "" + h), i(u) && (r(u.key), p = "" + u.key), "key" in u) {
201
201
  h = {};
202
202
  for (var J in u)
203
203
  J !== "key" && (h[J] = u[J]);
204
204
  } else h = u;
205
205
  return p && c(
206
206
  h,
207
- typeof i == "function" ? i.displayName || i.name || "Unknown" : i
207
+ typeof o == "function" ? o.displayName || o.name || "Unknown" : o
208
208
  ), m(
209
- i,
209
+ o,
210
210
  p,
211
211
  h,
212
212
  s(),
@@ -214,50 +214,50 @@ React keys must be passed directly to JSX without using spread:
214
214
  B
215
215
  );
216
216
  }
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));
217
+ function x(o) {
218
+ w(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === Y && (o._payload.status === "fulfilled" ? w(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
219
219
  }
220
- function w(i) {
221
- return typeof i == "object" && i !== null && i.$$typeof === A;
220
+ function w(o) {
221
+ return typeof o == "object" && o !== null && o.$$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"), $ = /* @__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() {
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"), N = /* @__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"), Y = /* @__PURE__ */ Symbol.for("react.lazy"), ke = /* @__PURE__ */ Symbol.for("react.activity"), Pe = /* @__PURE__ */ Symbol.for("react.client.reference"), G = 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(i) {
228
- return i();
227
+ react_stack_bottom_frame: function(o) {
228
+ return o();
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(i, u, h) {
236
- var g = 1e4 > N.recentlyCreatedOwnerStacks++;
235
+ O.Fragment = T, O.jsx = function(o, u, h) {
236
+ var g = 1e4 > G.recentlyCreatedOwnerStacks++;
237
237
  return d(
238
- i,
238
+ o,
239
239
  u,
240
240
  h,
241
241
  !1,
242
242
  g ? Error("react-stack-top-frame") : ne,
243
- g ? q(n(i)) : se
243
+ g ? q(n(o)) : se
244
244
  );
245
- }, O.jsxs = function(i, u, h) {
246
- var g = 1e4 > N.recentlyCreatedOwnerStacks++;
245
+ }, O.jsxs = function(o, u, h) {
246
+ var g = 1e4 > G.recentlyCreatedOwnerStacks++;
247
247
  return d(
248
- i,
248
+ o,
249
249
  u,
250
250
  h,
251
251
  !0,
252
252
  g ? Error("react-stack-top-frame") : ne,
253
- g ? q(n(i)) : se
253
+ g ? q(n(o)) : se
254
254
  );
255
255
  };
256
256
  })()), O;
257
257
  }
258
258
  var le;
259
259
  function De() {
260
- return le || (le = 1, process.env.NODE_ENV === "production" ? H.exports = Oe() : H.exports = Ie()), H.exports;
260
+ return le || (le = 1, process.env.NODE_ENV === "production" ? V.exports = Oe() : V.exports = Ie()), V.exports;
261
261
  }
262
262
  var f = De();
263
263
  const Me = {
@@ -293,7 +293,7 @@ const Me = {
293
293
  errorHeader: "Error",
294
294
  preview: "Vista previa"
295
295
  }
296
- }, ye = $e(void 0), He = () => {
296
+ }, ye = $e(void 0), Ve = () => {
297
297
  const e = Fe(ye);
298
298
  if (!e)
299
299
  throw new Error("useViewGate must be used within a ViewGateProvider");
@@ -304,10 +304,10 @@ const Me = {
304
304
  s((d) => [...d, { id: m, message: c, type: l }]), setTimeout(() => {
305
305
  s((d) => d.filter((x) => x.id !== m));
306
306
  }, 4e3);
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)) })] });
307
+ }, i = Me[t];
308
+ return f.jsxs(ye.Provider, { value: { addToast: a, language: t, t: i, 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" ? i.successHeader : i.errorHeader }), f.jsx("span", { style: { fontSize: "14px" }, children: c.message })] })] }, c.id)) })] });
309
309
  };
310
- function Ve(e, t) {
310
+ function He(e, t) {
311
311
  if (e.match(/^[a-z]+:\/\//i))
312
312
  return e;
313
313
  if (e.match(/^\/\//))
@@ -335,23 +335,23 @@ let _ = null;
335
335
  function we(e = {}) {
336
336
  return _ || (e.includeStyleProperties ? (_ = e.includeStyleProperties, _) : (_ = R(window.getComputedStyle(document.documentElement)), _));
337
337
  }
338
- function V(e, t) {
338
+ function H(e, t) {
339
339
  const n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
340
340
  return n ? parseFloat(n.replace("px", "")) : 0;
341
341
  }
342
342
  function We(e) {
343
- const t = V(e, "border-left-width"), r = V(e, "border-right-width");
343
+ const t = H(e, "border-left-width"), r = H(e, "border-right-width");
344
344
  return e.clientWidth + t + r;
345
345
  }
346
346
  function Ue(e) {
347
- const t = V(e, "border-top-width"), r = V(e, "border-bottom-width");
347
+ const t = H(e, "border-top-width"), r = H(e, "border-bottom-width");
348
348
  return e.clientHeight + t + r;
349
349
  }
350
350
  function xe(e, t = {}) {
351
351
  const r = t.width || We(e), n = t.height || Ue(e);
352
352
  return { width: r, height: n };
353
353
  }
354
- function Ye() {
354
+ function Ne() {
355
355
  let e, t;
356
356
  try {
357
357
  t = process;
@@ -361,7 +361,7 @@ function Ye() {
361
361
  return r && (e = parseInt(r, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
362
362
  }
363
363
  const E = 16384;
364
- function Ge(e) {
364
+ function Ye(e) {
365
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
367
  function z(e) {
@@ -374,12 +374,12 @@ function z(e) {
374
374
  }, n.onerror = r, n.crossOrigin = "anonymous", n.decoding = "async", n.src = e;
375
375
  });
376
376
  }
377
- async function Ne(e) {
377
+ async function Ge(e) {
378
378
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
379
379
  }
380
380
  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
- 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);
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), Ge(s);
383
383
  }
384
384
  const b = (e, t) => {
385
385
  if (e instanceof t)
@@ -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 o = ze();
408
+ const i = ze();
409
409
  try {
410
- t.className = `${t.className} ${o}`;
410
+ t.className = `${t.className} ${i}`;
411
411
  } catch {
412
412
  return;
413
413
  }
414
414
  const c = document.createElement("style");
415
- c.appendChild(Xe(o, r, s, n)), t.appendChild(c);
415
+ c.appendChild(Xe(i, 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);
@@ -452,13 +452,13 @@ async function be(e, t, r) {
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, o) => {
455
+ return new Promise((a, i) => {
456
456
  const c = new FileReader();
457
- c.onerror = o, c.onloadend = () => {
457
+ c.onerror = i, c.onloadend = () => {
458
458
  try {
459
459
  a(r({ res: n, result: c.result }));
460
460
  } catch (l) {
461
- o(l);
461
+ i(l);
462
462
  }
463
463
  }, c.readAsDataURL(s);
464
464
  });
@@ -475,12 +475,12 @@ 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 be(e, r.fetchRequestInit, ({ res: o, result: c }) => (t || (t = o.headers.get("Content-Type") || ""), et(c)));
478
+ const a = await be(e, r.fetchRequestInit, ({ res: i, result: c }) => (t || (t = i.headers.get("Content-Type") || ""), et(c)));
479
479
  s = tt(a, t);
480
480
  } catch (a) {
481
481
  s = r.imagePlaceholder || "";
482
- let o = `Failed to fetch resource: ${e}`;
483
- a && (o = typeof a == "string" ? a : a.message), o && console.warn(o);
482
+ let i = `Failed to fetch resource: ${e}`;
483
+ a && (i = typeof a == "string" ? a : a.message), i && console.warn(i);
484
484
  }
485
485
  return X[n] = s, s;
486
486
  }
@@ -490,8 +490,8 @@ async function nt(e) {
490
490
  }
491
491
  async function st(e, t) {
492
492
  if (e.currentSrc) {
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);
493
+ const a = document.createElement("canvas"), i = a.getContext("2d");
494
+ a.width = e.clientWidth, a.height = e.clientHeight, i?.drawImage(e, 0, 0, a.width, a.height);
495
495
  const c = a.toDataURL();
496
496
  return z(c);
497
497
  }
@@ -507,16 +507,16 @@ async function at(e, t) {
507
507
  }
508
508
  return e.cloneNode(!1);
509
509
  }
510
- async function it(e, t) {
510
+ async function ot(e, t) {
511
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 ot = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", ve = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
513
+ const it = (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 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) => {
519
+ return it(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((i, c) => i.then(() => W(c, r)).then((l) => {
520
520
  l && t.appendChild(l);
521
521
  }), Promise.resolve()), t;
522
522
  }
@@ -526,8 +526,8 @@ 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 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));
529
+ let i = s.getPropertyValue(a);
530
+ a === "font-size" && i.endsWith("px") && (i = `${Math.floor(parseFloat(i.substring(0, i.length - 2))) - 0.1}px`), b(e, HTMLIFrameElement) && a === "display" && i === "inline" && (i = "block"), a === "d" && t.getAttribute("d") && (i = `path(${t.getAttribute("d")})`), n.setProperty(a, i, s.getPropertyPriority(a));
531
531
  });
532
532
  }
533
533
  function ut(e, t) {
@@ -556,18 +556,18 @@ async function mt(e, t) {
556
556
  }
557
557
  const s = Object.values(n);
558
558
  if (s.length) {
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";
559
+ const a = "http://www.w3.org/1999/xhtml", i = document.createElementNS(a, "svg");
560
+ i.setAttribute("xmlns", a), i.style.position = "absolute", i.style.width = "0", i.style.height = "0", i.style.overflow = "hidden", i.style.display = "none";
561
561
  const c = document.createElementNS(a, "defs");
562
- o.appendChild(c);
562
+ i.appendChild(c);
563
563
  for (let l = 0; l < s.length; l++)
564
564
  c.appendChild(s[l]);
565
- e.appendChild(o);
565
+ e.appendChild(i);
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) => it(n, t)).then((n) => ct(e, n, t)).then((n) => dt(e, n, t)).then((n) => mt(n, t));
570
+ return !r && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((n) => ot(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,9 +580,9 @@ 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, o = Q(t);
583
+ const a = r ? He(t, r) : t, i = Q(t);
584
584
  let c;
585
- return s || (c = await K(a, o, n)), e.replace(pt(t), `$1${c}$3`);
585
+ return s || (c = await K(a, i, n)), e.replace(pt(t), `$1${c}$3`);
586
586
  } catch {
587
587
  }
588
588
  return e;
@@ -605,7 +605,7 @@ async function Re(e, t, r) {
605
605
  if (!Se(e))
606
606
  return e;
607
607
  const n = xt(e, r);
608
- return yt(n).reduce((a, o) => a.then((c) => wt(c, o, t, r)), Promise.resolve(n));
608
+ return yt(n).reduce((a, i) => a.then((c) => wt(c, i, t, r)), Promise.resolve(n));
609
609
  }
610
610
  async function j(e, t, r) {
611
611
  var n;
@@ -624,14 +624,14 @@ async function vt(e, t) {
624
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, o) => {
627
+ await new Promise((a, i) => {
628
628
  e.onload = a, e.onerror = t.onImageErrorHandler ? (...l) => {
629
629
  try {
630
630
  a(t.onImageErrorHandler(...l));
631
631
  } catch (m) {
632
- o(m);
632
+ i(m);
633
633
  }
634
- } : o;
634
+ } : i;
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
  });
@@ -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 (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]));
664
+ const n = /url\(["']?([^"')]+)["']?\)/g, a = (r.match(/url\([^)]+\)/g) || []).map(async (i) => {
665
+ let c = i.replace(n, "$1");
666
+ return c.startsWith("https://") || (c = new URL(c, e.url).href), be(c, t.fetchRequestInit, ({ result: l }) => (r = r.replace(i, `url(${l})`), [i, l]));
667
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, o = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", c = new RegExp(o, "gi");
683
+ const a = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, i = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", c = new RegExp(i, "gi");
684
684
  for (; ; ) {
685
685
  let l = a.exec(n);
686
686
  if (l === null) {
@@ -698,9 +698,9 @@ 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, o) => {
701
+ R(s.cssRules || []).forEach((a, i) => {
702
702
  if (a.type === CSSRule.IMPORT_RULE) {
703
- let c = o + 1;
703
+ let c = i + 1;
704
704
  const l = a.href, m = he(l).then((d) => ge(d, t)).then((d) => pe(d).forEach((x) => {
705
705
  try {
706
706
  s.insertRule(x, x.startsWith("@import") ? c += 1 : s.cssRules.length);
@@ -717,9 +717,9 @@ async function Rt(e, t) {
717
717
  }
718
718
  });
719
719
  } catch (a) {
720
- const o = e.find((c) => c.href == null) || document.styleSheets[0];
720
+ const i = 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
- o.insertRule(l, o.cssRules.length);
722
+ i.insertRule(l, i.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 o = a.parentStyleSheet ? a.parentStyleSheet.href : null;
765
- return Re(a.cssText, o, t);
764
+ const i = a.parentStyleSheet ? a.parentStyleSheet.href : null;
765
+ return Re(a.cssText, i, t);
766
766
  }))).join(`
767
767
  `);
768
768
  }
@@ -778,14 +778,14 @@ async function jt(e, t = {}) {
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 } = 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;
781
+ const { width: r, height: n } = xe(e, t), s = await jt(e, t), a = await z(s), i = document.createElement("canvas"), c = i.getContext("2d"), l = t.pixelRatio || Ne(), m = t.canvasWidth || r, d = t.canvasHeight || n;
782
+ return i.width = m * l, i.height = d * l, t.skipAutoScale || Ye(i), i.style.width = `${m}`, i.style.height = `${d}`, t.backgroundColor && (c.fillStyle = t.backgroundColor, c.fillRect(0, 0, i.width, i.height)), c.drawImage(a, 0, 0, i.width, i.height), i;
783
783
  }
784
784
  async function $t(e, t = {}) {
785
785
  return (await At(e, t)).toDataURL();
786
786
  }
787
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) => {
788
+ const { addToast: e, language: t, t: r, apiKey: n } = Ve(), [s, a] = k(!1), [i, c] = k(null), [l, m] = k(null), [d, x] = k(""), [w, C] = k(!1), [A, I] = k(!1), T = oe((v) => {
789
789
  if (!s || l)
790
790
  return;
791
791
  const y = document.elementFromPoint(v.clientX, v.clientY);
@@ -801,13 +801,13 @@ const Ft = () => {
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]), $ = ie(async (v) => {
805
- if (!(!s || l) && o) {
804
+ }, [s, l]), $ = oe(async (v) => {
805
+ if (!(!s || l) && i) {
806
806
  v.preventDefault(), v.stopPropagation(), I(!0);
807
807
  try {
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, {
808
+ const y = i.element.style.display, S = window.getComputedStyle(i.element).display === "inline";
809
+ S && (i.element.style.display = "inline-block");
810
+ const F = await $t(i.element, {
811
811
  backgroundColor: "#ffffff",
812
812
  pixelRatio: 2,
813
813
  skipFonts: !0,
@@ -817,14 +817,14 @@ const Ft = () => {
817
817
  // Extra padding for better look
818
818
  }
819
819
  });
820
- S && (o.element.style.display = y), m({ ...o, visualPreview: F });
820
+ S && (i.element.style.display = y), m({ ...i, visualPreview: F });
821
821
  } catch (y) {
822
- console.error("Failed to capture preview:", y), m(o);
822
+ console.error("Failed to capture preview:", y), m(i);
823
823
  } finally {
824
824
  I(!1), c(null);
825
825
  }
826
826
  }
827
- }, [s, o, l]);
827
+ }, [s, i, l]);
828
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
829
  document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove", T), window.removeEventListener("click", $, !0);
830
830
  }), [s, l, T, $]);
@@ -855,7 +855,7 @@ const Ft = () => {
855
855
  } finally {
856
856
  C(!1);
857
857
  }
858
- }, Y = (v) => v.split("/").pop()?.split("\\").pop() || "unknown";
858
+ }, N = (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 Ft = () => {
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 && o && !l && !A && f.jsx("div", { style: {
871
+ }, children: f.jsx("div", { className: "vg-glassmorphism", style: { padding: "20px 40px", fontWeight: 700 }, children: "Capturing..." }) }), s && i && !l && !A && f.jsx("div", { style: {
872
872
  position: "fixed",
873
- top: o.rect.top,
874
- left: o.rect.left,
875
- width: o.rect.width,
876
- height: o.rect.height,
873
+ top: i.rect.top,
874
+ left: i.rect.left,
875
+ width: i.rect.width,
876
+ height: i.rect.height,
877
877
  border: "2px solid var(--vg-primary)",
878
878
  backgroundColor: "rgba(37, 19, 236, 0.05)",
879
879
  pointerEvents: "none",
@@ -897,7 +897,7 @@ const Ft = () => {
897
897
  padding: "32px",
898
898
  width: "460px",
899
899
  background: "white"
900
- }, 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: ["📄 ", Y((l.source || "").split(":")[0])] }), f.jsxs("span", { className: "vg-badge", style: { opacity: 0.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: {
900
+ }, 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: ["📄 ", N((l.source || "").split(":")[0])] }), f.jsxs("span", { className: "vg-badge", style: { opacity: 0.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: {
901
901
  backgroundColor: "#f8fafc",
902
902
  borderRadius: "8px",
903
903
  border: "1px solid #e2e8f0",
@@ -930,8 +930,8 @@ function Dt() {
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 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}"`);
933
+ const i = a + 1, c = (d) => d.replace(/\\/g, "/"), l = c(t).replace(c(process.cwd()), "");
934
+ return s.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n>])/g, (d, x, w) => d.includes("data-source-path") || w === "Fragment" || w === "React.Fragment" ? d : `${x}<${w} data-source-path="${l}:${i}"`);
935
935
  }).join(`
936
936
  `),
937
937
  map: null
@@ -945,19 +945,19 @@ function Lt(e, t, r) {
945
945
  return e.split(`
946
946
  `).map((c, l) => {
947
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}"`);
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
949
  }).join(`
950
950
  `);
951
951
  }
952
952
  function Mt(e) {
953
953
  const t = this.resourcePath;
954
- return t ? Lt(e, t, process.cwd()) : e;
954
+ return t ? (process.env.NODE_ENV, Lt(e, t, process.cwd())) : e;
955
955
  }
956
956
  export {
957
957
  It as ViewGate,
958
958
  Ft as ViewGateOverlay,
959
959
  Lt as transformSourcePaths,
960
- He as useViewGate,
960
+ Ve as useViewGate,
961
961
  Mt as viewgateNextLoader,
962
962
  Dt as viewgatePlugin
963
963
  };
@@ -4,9 +4,9 @@
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),_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(`
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 Ne(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(Ne(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",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 N(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 Y={};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(Y[n]!=null)return Y[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 Y[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),Ye(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=>!N(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&&!N(e.src))&&!(v(e,SVGImageElement)&&!N(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
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
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
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"})}));
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?(process.env.NODE_ENV,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.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/viewgate-wrapper.umd.cjs",
6
6
  "module": "./dist/viewgate-wrapper.js",