viewgate-wrapper 1.3.2 → 1.3.4

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